More debugging output. Yeah!!!

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1416 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2002-10-06 22:57:09 +00:00
parent 53bf00c9d5
commit 4000397895

View File

@ -115,6 +115,7 @@ TRoster::HandleAddApplication(BMessage *request)
if (request->FindBool("full_registration", &fullReg) != B_OK) if (request->FindBool("full_registration", &fullReg) != B_OK)
fullReg = false; fullReg = false;
PRINT(("team: %ld, signature: %s\n", team, signature)); PRINT(("team: %ld, signature: %s\n", team, signature));
PRINT(("full registration: %d\n", fullReg));
// check the parameters // check the parameters
team_id otherTeam = -1; team_id otherTeam = -1;
uint32 launchFlags = flags & B_LAUNCH_MASK; uint32 launchFlags = flags & B_LAUNCH_MASK;
@ -177,6 +178,7 @@ PRINT(("added ref: %ld, %lld, %s\n", info->ref.device, info->ref.directory, info
else { else {
token = info->token = _NextToken(); token = info->token = _NextToken();
addingSuccess = fEarlyPreRegisteredApps.AddInfo(info); addingSuccess = fEarlyPreRegisteredApps.AddInfo(info);
PRINT(("added to early pre-regs, token: %lu\n", token));
} }
if (!addingSuccess) if (!addingSuccess)
SET_ERROR(error, B_NO_MEMORY); SET_ERROR(error, B_NO_MEMORY);
@ -275,6 +277,8 @@ TRoster::HandleIsAppPreRegistered(BMessage *request)
SET_ERROR(error, B_BAD_VALUE); SET_ERROR(error, B_BAD_VALUE);
if (request->FindInt32("team", &team) != B_OK) if (request->FindInt32("team", &team) != B_OK)
team = -1; team = -1;
PRINT(("team: %ld\n", team));
PRINT(("ref: %ld, %lld, %s\n", ref.device, ref.directory, ref.name));
// check the parameters // check the parameters
// entry_ref // entry_ref
if (error == B_OK & !BEntry(&ref).Exists()) if (error == B_OK & !BEntry(&ref).Exists())
@ -282,23 +286,26 @@ TRoster::HandleIsAppPreRegistered(BMessage *request)
// team // team
if (error == B_OK && team < 0) if (error == B_OK && team < 0)
SET_ERROR(error, B_BAD_VALUE); SET_ERROR(error, B_BAD_VALUE);
// loop the information up // look up the information
RosterAppInfo *info = NULL; RosterAppInfo *info = NULL;
if (error == B_OK) { if (error == B_OK) {
if ((info = fRegisteredApps.InfoFor(team)) != NULL) { if ((info = fRegisteredApps.InfoFor(team)) != NULL) {
PRINT(("found team in fRegisteredApps\n"));
_ReplyToIAPRRequest(request, info); _ReplyToIAPRRequest(request, info);
} else if ((info = fEarlyPreRegisteredApps.InfoFor(&ref)) != NULL) { } else if ((info = fEarlyPreRegisteredApps.InfoFor(&ref)) != NULL) {
PRINT(("found ref in fEarlyRegisteredApps\n"));
// pre-registered and has no team ID assigned yet -- queue the // pre-registered and has no team ID assigned yet -- queue the
// request // request
be_app->DetachCurrentMessage(); be_app->DetachCurrentMessage();
IAPRRequest queuedRequest = { ref, team, request }; IAPRRequest queuedRequest = { ref, team, request };
fIAPRRequests[team] = queuedRequest; fIAPRRequests[team] = queuedRequest;
} else {
PRINT(("didn't find team or ref\n"));
// team not registered, ref not early pre-registered
_ReplyToIAPRRequest(request, NULL);
} }
} } else {
// reply to the request // reply to the request on error
if (error == B_OK)
_ReplyToIAPRRequest(request, info);
else {
BMessage reply(B_REG_ERROR); BMessage reply(B_REG_ERROR);
reply.AddInt32("error", error); reply.AddInt32("error", error);
request->SendReply(&reply); request->SendReply(&reply);
@ -403,6 +410,7 @@ TRoster::HandleSetThreadAndTeam(BMessage *request)
// team // team
if (error == B_OK && team < 0) if (error == B_OK && team < 0)
SET_ERROR(error, B_BAD_VALUE); SET_ERROR(error, B_BAD_VALUE);
PRINT(("team: %ld, thread: %ld, token: %lu\n", team, thread, token));
// update the app_info // update the app_info
if (error == B_OK) { if (error == B_OK) {
RosterAppInfo *info = fEarlyPreRegisteredApps.InfoForToken(token); RosterAppInfo *info = fEarlyPreRegisteredApps.InfoForToken(token);
@ -477,33 +485,34 @@ TRoster::HandleGetAppInfo(BMessage *request)
hasRef = false; hasRef = false;
if (request->FindString("signature", &signature) != B_OK) if (request->FindString("signature", &signature) != B_OK)
hasSignature = false; hasSignature = false;
// check the parameters if (hasTeam)
// If neither of those has been supplied, the active application info is PRINT(("team: %ld\n", team));
// requested. We simple set the team ID. if (hasRef)
if (error == B_OK && !hasTeam && !hasRef && !hasSignature) { PRINT(("ref: %ld, %lld, %s\n", ref.device, ref.directory, ref.name));
} if (hasSignature)
PRINT(("signature: %s\n", signature));
// get the info // get the info
RosterAppInfo *info = NULL; RosterAppInfo *info = NULL;
if (error == B_OK) { if (error == B_OK) {
if (hasTeam) { if (hasTeam) {
info = fRegisteredApps.InfoFor(team); info = fRegisteredApps.InfoFor(team);
if (info == NULL) if (info == NULL)
error = B_BAD_TEAM_ID; SET_ERROR(error, B_BAD_TEAM_ID);
} else if (hasRef) { } else if (hasRef) {
info = fRegisteredApps.InfoFor(&ref); info = fRegisteredApps.InfoFor(&ref);
if (info == NULL) if (info == NULL)
error = B_ERROR; SET_ERROR(error, B_ERROR);
} else if (hasSignature) { } else if (hasSignature) {
info = fRegisteredApps.InfoFor(signature); info = fRegisteredApps.InfoFor(signature);
if (info == NULL) if (info == NULL)
error = B_ERROR; SET_ERROR(error, B_ERROR);
} else { } else {
// If neither of those has been supplied, the active application // If neither of those has been supplied, the active application
// info is requested. // info is requested.
if (fActiveApp) if (fActiveApp)
info = fActiveApp; info = fActiveApp;
else else
error = B_ERROR; SET_ERROR(error, B_ERROR);
} }
} }
// reply to the request // reply to the request
@ -816,6 +825,7 @@ TRoster::_ReplyToIAPRRequest(BMessage *request, const RosterAppInfo *info)
// send reply // send reply
BMessage reply(B_REG_SUCCESS); BMessage reply(B_REG_SUCCESS);
reply.AddBool("pre-registered", preRegistered); reply.AddBool("pre-registered", preRegistered);
PRINT(("_ReplyToIAPRRequest(): pre-registered: %d\n", preRegistered));
if (preRegistered) if (preRegistered)
_AddMessageAppInfo(&reply, info); _AddMessageAppInfo(&reply, info);
request->SendReply(&reply); request->SendReply(&reply);