The BRoster initialization (contacting the registrar) can now time out
(generous 1s for delivery and for reply). This allows for the registrar main thread to be debugged. Before the libbe initialization in gdb would block, since it constructed the global be_roster which waited forever for a reply from the registrar. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20144 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5b111b26a3
commit
7b95cc638b
|
@ -2416,11 +2416,17 @@ BRoster::_InitMessengers()
|
|||
port_info info;
|
||||
if (rosterPort >= 0 && get_port_info(rosterPort, &info) == B_OK) {
|
||||
DBG(OUT(" found roster port\n"));
|
||||
// ask for the MIME messenger
|
||||
|
||||
BMessenger::Private(fMessenger).SetTo(info.team, rosterPort,
|
||||
B_PREFERRED_TOKEN);
|
||||
|
||||
// ask for the MIME messenger
|
||||
// Generous 1s + 1s timeouts. It could actually be synchronous, but
|
||||
// timeouts allow us to debug the registrar main thread.
|
||||
BMessage request(B_REG_GET_MIME_MESSENGER);
|
||||
BMessage reply;
|
||||
status_t error = fMessenger.SendMessage(B_REG_GET_MIME_MESSENGER, &reply);
|
||||
status_t error = fMessenger.SendMessage(&request, &reply, 1000000LL,
|
||||
1000000LL);
|
||||
if (error == B_OK && reply.what == B_REG_SUCCESS) {
|
||||
DBG(OUT(" got reply from roster\n"));
|
||||
reply.FindMessenger("messenger", &fMimeMessenger);
|
||||
|
@ -2429,6 +2435,7 @@ BRoster::_InitMessengers()
|
|||
strerror(error)));
|
||||
if (error == B_OK)
|
||||
DBG(reply.PrintToStream());
|
||||
fMessenger = BMessenger();
|
||||
}
|
||||
}
|
||||
DBG(OUT("BRoster::InitMessengers() done\n"));
|
||||
|
|
Loading…
Reference in New Issue