diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/IcqOscarJ/src/chan_04close.cpp | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_proto.h | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_server.cpp | 14 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_server.h | 27 |
5 files changed, 17 insertions, 30 deletions
diff --git a/protocols/IcqOscarJ/src/chan_04close.cpp b/protocols/IcqOscarJ/src/chan_04close.cpp index 5979919c62..409926b3df 100644 --- a/protocols/IcqOscarJ/src/chan_04close.cpp +++ b/protocols/IcqOscarJ/src/chan_04close.cpp @@ -87,7 +87,7 @@ void CIcqProto::handleLoginReply(BYTE *buf, WORD datalen, serverthread_info *inf if (!chain->getLength(0x06, 1)) {
disposeChain(&chain);
SetCurrentStatus(ID_STATUS_OFFLINE);
- icq_serverDisconnect(FALSE);
+ icq_serverDisconnect();
return; // Failure
}
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index e122c1f845..345be0d80d 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -1690,7 +1690,7 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus) if (hServerConn) { // Connected, Send disconnect packet
icq_sendCloseConnection();
- icq_serverDisconnect(FALSE);
+ icq_serverDisconnect();
SetCurrentStatus(ID_STATUS_OFFLINE);
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index cc4b6a8e4b..a3fb7b44f9 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -555,7 +555,7 @@ struct CIcqProto : public PROTO<CIcqProto> void __cdecl SendPacketAsyncThread(icq_packet* pArgs);
void __cdecl ServerThread(serverthread_start_info *infoParam);
- void icq_serverDisconnect(BOOL bBlock);
+ void icq_serverDisconnect(void);
void icq_login(const char* szPassword);
int handleServerPackets(BYTE *buf, int len, serverthread_info *info);
diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index ebb6050c02..2a0e433761 100644 --- a/protocols/IcqOscarJ/src/icq_server.cpp +++ b/protocols/IcqOscarJ/src/icq_server.cpp @@ -210,26 +210,22 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam) debugLogA("%s thread ended.", "Server");
}
-
-void CIcqProto::icq_serverDisconnect(BOOL bBlock)
+void CIcqProto::icq_serverDisconnect()
{
- if ( !hServerConn)
+ if (!hServerConn)
return;
debugLogA("Server shutdown requested");
Netlib_Shutdown(hServerConn);
+ debugLogA("Dropping server thread");
if (serverThreadHandle) {
- // Not called from network thread?
- if (bBlock && GetCurrentThreadId() != serverThreadId)
- while (ICQWaitForSingleObject(serverThreadHandle, INFINITE) != WAIT_OBJECT_0);
-
+ debugLogA("Closing server thread handle: %08p", serverThreadHandle);
CloseHandle(serverThreadHandle);
serverThreadHandle = NULL;
}
}
-
int CIcqProto::handleServerPackets(BYTE *buf, int len, serverthread_info *info)
{
BYTE channel;
@@ -328,7 +324,7 @@ void CIcqProto::sendServPacket(icq_packet *pPacket) DWORD dwErrorCode = GetLastError();
if (dwErrorCode != WSAESHUTDOWN)
icq_LogUsingErrorCode(LOG_ERROR, GetLastError(), LPGEN("Your connection with the ICQ server was abortively closed"));
- icq_serverDisconnect(FALSE);
+ icq_serverDisconnect();
if (m_iStatus != ID_STATUS_OFFLINE)
SetCurrentStatus(ID_STATUS_OFFLINE);
diff --git a/protocols/IcqOscarJ/src/icq_server.h b/protocols/IcqOscarJ/src/icq_server.h index eba3ecfa42..2559ced355 100644 --- a/protocols/IcqOscarJ/src/icq_server.h +++ b/protocols/IcqOscarJ/src/icq_server.h @@ -40,32 +40,23 @@ struct serverthread_start_info struct serverthread_info
{
struct CIcqProto *ppro;
- int bLoggedIn;
- int isLoginServer;
+ int bLoggedIn;
+ int isLoginServer;
BYTE szAuthKey[20];
WORD wAuthKeyLen;
WORD wServerPort;
char *newServer;
BYTE *cookieData;
- int cookieDataLen;
- int newServerSSL;
- int newServerReady;
- int isMigrating;
+ int cookieDataLen;
+ int newServerSSL;
+ int newServerReady;
+ int isMigrating;
+ int bReinitRecver;
+ int bMyAvatarInited;
+
HANDLE hPacketRecver;
- int bReinitRecver;
- int bMyAvatarInited;
-//
HANDLE hDirectBoundPort;
-//
HANDLE hKeepAliveEvent;
};
-/*---------* Functions *---------------*/
-
-void icq_serverDisconnect(BOOL bBlock);
-void icq_login(const char *szPassword);
-
-int IsServerOverRate(WORD wFamily, WORD wCommand, int nLevel);
-
-
#endif /* __ICQ_SERVER_H */
|