cleanup...now the xmpp thread will not suck your cpu
This commit is contained in:
parent
556436ef77
commit
c92a7038d0
|
@ -191,7 +191,7 @@ status_t
|
||||||
MSNP::Process(BMessage* msg)
|
MSNP::Process(BMessage* msg)
|
||||||
{
|
{
|
||||||
// printf("Process()\n");
|
// printf("Process()\n");
|
||||||
msg->PrintToStream();
|
// msg->PrintToStream();
|
||||||
|
|
||||||
switch (msg->what) {
|
switch (msg->what) {
|
||||||
case IM_MESSAGE:
|
case IM_MESSAGE:
|
||||||
|
@ -314,6 +314,7 @@ MSNP::Process(BMessage* msg)
|
||||||
y = x;
|
y = x;
|
||||||
} else {
|
} else {
|
||||||
delete fSwitchboardList.ItemAt(x)->second;
|
delete fSwitchboardList.ItemAt(x)->second;
|
||||||
|
//delete fSwitchboardList.ItemAt(x)->first;
|
||||||
fSwitchboardList.RemoveItemAt(x);
|
fSwitchboardList.RemoveItemAt(x);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1066,7 +1067,7 @@ int MSNP::listenOnPort(int port)
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.sin_family = AF_INET;
|
addr.sin_family = AF_INET;
|
||||||
addr.sin_port = htons(port);
|
addr.sin_port = htons((uint16)port);
|
||||||
|
|
||||||
if (bind(s, (sockaddr *)(&addr), sizeof(addr)) < 0 || listen(s, 1) < 0) {
|
if (bind(s, (sockaddr *)(&addr), sizeof(addr)) < 0 || listen(s, 1) < 0) {
|
||||||
close(s);
|
close(s);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
static status_t
|
static status_t
|
||||||
connect_thread(void* data)
|
connect_thread(void* data)
|
||||||
{
|
{
|
||||||
|
|
||||||
JabberHandler* handler = (JabberHandler*)data;
|
JabberHandler* handler = (JabberHandler*)data;
|
||||||
if (!handler)
|
if (!handler)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
@ -34,7 +35,7 @@ connect_thread(void* data)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
gloox::ConnectionError e;
|
gloox::ConnectionError e;
|
||||||
while ((e = client->recv(1000)) == gloox::ConnNoError);
|
while ((e = client->recv(10000000)) == gloox::ConnNoError);
|
||||||
|
|
||||||
if (e != gloox::ConnUserDisconnected)
|
if (e != gloox::ConnUserDisconnected)
|
||||||
handler->HandleError(e);
|
handler->HandleError(e);
|
||||||
|
|
Ŝarĝante…
Reference in New Issue