diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-11 14:01:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-11 14:01:25 +0000 |
commit | 773421e8ba17637d994088c393d406226b516a30 (patch) | |
tree | 130c0bf529e30f493ae4f2abbe1230d31fecdeed /protocols/MSN | |
parent | 3fc8b6f686262e8a595fc10b2bd947526ca77bdc (diff) |
- m_hNetlibUser moved to PROTO_INTERFACE;
- unified protocol loggers
git-svn-id: http://svn.miranda-ng.org/main/trunk@6435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN')
-rw-r--r-- | protocols/MSN/src/msn_auth.cpp | 6 | ||||
-rw-r--r-- | protocols/MSN/src/msn_avatar.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_commands.cpp | 46 | ||||
-rw-r--r-- | protocols/MSN/src/msn_errors.cpp | 4 | ||||
-rw-r--r-- | protocols/MSN/src/msn_ftold.cpp | 24 | ||||
-rw-r--r-- | protocols/MSN/src/msn_mail.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 21 | ||||
-rw-r--r-- | protocols/MSN/src/msn_natdetect.cpp | 38 | ||||
-rw-r--r-- | protocols/MSN/src/msn_p2p.cpp | 138 | ||||
-rw-r--r-- | protocols/MSN/src/msn_p2ps.cpp | 6 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.cpp | 6 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.h | 4 | ||||
-rw-r--r-- | protocols/MSN/src/msn_svcs.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_threads.cpp | 36 | ||||
-rw-r--r-- | protocols/MSN/src/msn_ws.cpp | 10 |
15 files changed, 164 insertions, 181 deletions
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index 23d1001f83..dd860176c6 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -255,7 +255,7 @@ int CMsnProto::MSN_GetPassportAuth(void) {
if (errurl)
{
- MSN_DebugLog("Starting URL: '%s'", errurl);
+ debugLogA("Starting URL: '%s'", errurl);
CallService(MS_UTILS_OPENURL, 1, (LPARAM)errurl);
}
@@ -264,7 +264,7 @@ int CMsnProto::MSN_GetPassportAuth(void) if (tokrdr != NULL)
{
strcpy(szPassportHost, ezxml_txt(tokrdr));
- MSN_DebugLog("Redirected to '%s'", szPassportHost);
+ debugLogA("Redirected to '%s'", szPassportHost);
}
else
{
@@ -325,7 +325,7 @@ int CMsnProto::MSN_GetPassportAuth(void) setString("MsnPassportHost", szPassportHost);
mir_free(szPassportHost);
- MSN_DebugLog("MSN_CheckRedirector exited with errorCode = %d", retVal);
+ debugLogA("MSN_CheckRedirector exited with errorCode = %d", retVal);
return retVal;
}
diff --git a/protocols/MSN/src/msn_avatar.cpp b/protocols/MSN/src/msn_avatar.cpp index db57bf4769..5af6b7ad87 100644 --- a/protocols/MSN/src/msn_avatar.cpp +++ b/protocols/MSN/src/msn_avatar.cpp @@ -64,7 +64,7 @@ bool CMsnProto::loadHttpAvatar(AvatarQueueEntry *p) nlhr.headers = (NETLIBHTTPHEADER*)&nlbhHeaders;
nlhr.headersCount = 1;
- NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUser, (LPARAM)&nlhr);
+ NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&nlhr);
if (nlhrReply == NULL)
return false;
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 43d413a206..a7e5774f43 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -30,7 +30,7 @@ void MSN_ConnectionProc(HANDLE hNewConnection, DWORD /* dwRemoteIP */, void* ext {
CMsnProto *proto = (CMsnProto*)extra;
- proto->MSN_DebugLog("File transfer connection accepted");
+ proto->debugLogA("File transfer connection accepted");
NETLIBCONNINFO connInfo = { sizeof(connInfo) };
CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hNewConnection, (LPARAM)&connInfo);
@@ -43,7 +43,7 @@ void MSN_ConnectionProc(HANDLE hNewConnection, DWORD /* dwRemoteIP */, void* ext }
else
{
- proto->MSN_DebugLog("There's no registered file transfers for incoming port #%u, connection closed", connInfo.wPort);
+ proto->debugLogA("There's no registered file transfers for incoming port #%u, connection closed", connInfo.wPort);
Netlib_CloseHandle(hNewConnection);
}
}
@@ -317,7 +317,7 @@ void CMsnProto::sttCustomSmiley(const char* msgBody, char* email, char* nick, in delete ft;
else
{
- MSN_DebugLog("Custom Smiley p2p invite for object : %s", ft->p2p_object);
+ debugLogA("Custom Smiley p2p invite for object : %s", ft->p2p_object);
p2p_invite(iSmileyType, ft, email);
Sleep(3000);
}
@@ -343,7 +343,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para if (sttDivideWords(params, SIZEOF(tWords), tWords) < 3)
{
- MSN_DebugLog("Invalid %.3s command, ignoring", cmdString);
+ debugLogA("Invalid %.3s command, ignoring", cmdString);
return;
}
@@ -377,7 +377,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para memcpy(msg, msgb, msgBytes);
msg[msgBytes] = 0;
- MSN_DebugLog("Message:\n%s", msg);
+ debugLogA("Message:\n%s", msg);
MimeHeaders tHeader;
char* msgBody = tHeader.readFromBuffer(msg);
@@ -1102,7 +1102,7 @@ int CMsnProto::MSN_HandleCommands(ThreadData* info, char* cmdString) }
else params = cmdString+4;
}
-// MSN_DebugLog("%s", cmdString);
+// debugLogA("%s", cmdString);
switch((*(PDWORD)cmdString & 0x00FFFFFF) | 0x20000000)
{
@@ -1117,7 +1117,7 @@ int CMsnProto::MSN_HandleCommands(ThreadData* info, char* cmdString) char* tWords[1];
if (sttDivideWords(params, 1, tWords) != 1)
{
- MSN_DebugLog("Invalid %.3s command, ignoring", cmdString);
+ debugLogA("Invalid %.3s command, ignoring", cmdString);
}
else
{
@@ -1132,7 +1132,7 @@ int CMsnProto::MSN_HandleCommands(ThreadData* info, char* cmdString) if (sttDivideWords(params, 1, tWords) != 1)
{
LBL_InvalidCommand:
- MSN_DebugLog("Invalid %.3s command, ignoring", cmdString);
+ debugLogA("Invalid %.3s command, ignoring", cmdString);
break;
}
@@ -1270,7 +1270,7 @@ LBL_InvalidCommand: {
m_iStatus = newStatus;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, newStatus);
- MSN_DebugLog("Status change acknowledged: %s", params);
+ debugLogA("Status change acknowledged: %s", params);
MSN_RemoveEmptyGroups();
}
if (newStatus == ID_STATUS_OFFLINE) return 1;
@@ -1509,7 +1509,7 @@ remove: if (wlid == NULL) //can happen if both parties send first message at the same time
{
- MSN_DebugLog("USR (SB) internal: thread created for no reason");
+ debugLogA("USR (SB) internal: thread created for no reason");
return 1;
}
@@ -1553,7 +1553,7 @@ remove: }
mir_utf8decode(data.userNick, NULL);
- MSN_DebugLog("New contact in channel %s %s", data.userEmail, data.userNick);
+ debugLogA("New contact in channel %s %s", data.userEmail, data.userNick);
if (info->contactJoined(data.userEmail) <= 1)
{
@@ -1603,7 +1603,7 @@ remove: ProtoBroadcastAck(info->getContactHandle(),
ACKTYPE_MESSAGE, ACKRESULT_FAILED,
(HANDLE)trid, (LPARAM)Translate("Message delivery failed"));
- MSN_DebugLog("Message send failed (trid=%d)", trid);
+ debugLogA("Message send failed (trid=%d)", trid);
break;
case ' TON': //********* NOT: notification message
@@ -1622,7 +1622,7 @@ remove: if (!_stricmp(params, "OTH"))
{
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
- MSN_DebugLog("You have been disconnected from the MSN server because you logged on from another location using the same MSN passport.");
+ debugLogA("You have been disconnected from the MSN server because you logged on from another location using the same MSN passport.");
}
if (!_stricmp(params, "MIG")) // ignore it
@@ -1671,7 +1671,7 @@ remove: stripColorCode(data.callerNick);
if (strcmp(data.security, "CKI")) {
- MSN_DebugLog("Unknown security package in RNG command: %s", data.security);
+ debugLogA("Unknown security package in RNG command: %s", data.security);
break;
}
@@ -1685,7 +1685,7 @@ remove: ReleaseSemaphore(newThread->hWaitEvent, MSN_PACKETS_COMBINE, NULL);
- MSN_DebugLog("Opening caller's switchboard server '%s'...", data.newServer);
+ debugLogA("Opening caller's switchboard server '%s'...", data.newServer);
newThread->startThread(&CMsnProto::MSNServerThread, this);
break;
}
@@ -1746,7 +1746,7 @@ remove: case 4:
case 8:
ProtoBroadcastAck( NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION );
- MSN_DebugLog( "You have been disconnected from the MSN server because you logged on from another location using the same MSN passport." );
+ debugLogA( "You have been disconnected from the MSN server because you logged on from another location using the same MSN passport." );
break;
case 6:
@@ -1780,7 +1780,7 @@ remove: if (strcmp(data.status, "OK"))
{
- MSN_DebugLog("Unknown status to USR command (SB): '%s'", data.status);
+ debugLogA("Unknown status to USR command (SB): '%s'", data.status);
break;
}
@@ -1817,7 +1817,7 @@ remove: }
else
{
- MSN_DebugLog("Unknown security package '%s'", data.security);
+ debugLogA("Unknown security package '%s'", data.security);
if (info->mType == SERVER_NOTIFICATION)
{
@@ -1909,7 +1909,7 @@ remove: usingGateway |= (*data.security == 'G');
info->mIsMainThread = false;
- MSN_DebugLog("Switching to notification server '%s'...", data.newServer);
+ debugLogA("Switching to notification server '%s'...", data.newServer);
newThread->startThread(&CMsnProto::MSNServerThread, this);
return 1; //kill the old thread
}
@@ -1923,7 +1923,7 @@ remove: if (strcmp(data.security, "CKI"))
{
- MSN_DebugLog("Unknown XFR SB security package '%s'", data.security);
+ debugLogA("Unknown XFR SB security package '%s'", data.security);
break;
}
@@ -1934,15 +1934,15 @@ remove: newThread->mCaller = 1;
strcpy(newThread->mCookie, data.authChallengeInfo);
- MSN_DebugLog("Opening switchboard server '%s'...", data.newServer);
+ debugLogA("Opening switchboard server '%s'...", data.newServer);
newThread->startThread(&CMsnProto::MSNServerThread, this);
}
- else MSN_DebugLog("Unknown referral server: %s", data.type);
+ else debugLogA("Unknown referral server: %s", data.type);
break;
}
default:
- MSN_DebugLog("Unrecognised message: %s", cmdString);
+ debugLogA("Unrecognised message: %s", cmdString);
break;
}
diff --git a/protocols/MSN/src/msn_errors.cpp b/protocols/MSN/src/msn_errors.cpp index 9a4acbe0c8..ce18c956a3 100644 --- a/protocols/MSN/src/msn_errors.cpp +++ b/protocols/MSN/src/msn_errors.cpp @@ -28,7 +28,7 @@ int CMsnProto::MSN_HandleErrors(ThreadData* info, char* cmdString) int errorCode, packetID = -1;
sscanf(cmdString, "%d %d", &errorCode, &packetID);
- MSN_DebugLog("Server error:%s", cmdString);
+ debugLogA("Server error:%s", cmdString);
switch(errorCode) {
case ERR_INTERNAL_SERVER:
@@ -83,7 +83,7 @@ int CMsnProto::MSN_HandleErrors(ThreadData* info, char* cmdString) return 1;
default:
- MSN_DebugLog("Unprocessed error: %s", cmdString);
+ debugLogA("Unprocessed error: %s", cmdString);
if (errorCode >= 500) //all these errors look fatal-ish
MSN_ShowError("Unrecognised error %d. The server has closed our connection", errorCode);
diff --git a/protocols/MSN/src/msn_ftold.cpp b/protocols/MSN/src/msn_ftold.cpp index 25e5f0279d..d2cd516d33 100644 --- a/protocols/MSN/src/msn_ftold.cpp +++ b/protocols/MSN/src/msn_ftold.cpp @@ -154,7 +154,7 @@ int CMsnProto::MSN_HandleMSNFTP(ThreadData *info, char *cmdString) char email[130],authcookie[14];
if (sscanf(params,"%129s %13s",email,authcookie) < 2)
{
- MSN_DebugLog("Invalid USR OK command, ignoring");
+ debugLogA("Invalid USR OK command, ignoring");
break;
}
@@ -169,7 +169,7 @@ int CMsnProto::MSN_HandleMSNFTP(ThreadData *info, char *cmdString) if (sscanf(params, "%6s", protocol1) < 1)
{
LBL_InvalidCommand:
- MSN_DebugLog("Invalid %.3s command, ignoring", cmdString);
+ debugLogA("Invalid %.3s command, ignoring", cmdString);
break;
}
@@ -179,7 +179,7 @@ LBL_InvalidCommand: int tFieldCount = sscanf(params, "%d %6s", &tempInt, protocol1);
if (tFieldCount != 2 || strcmp(protocol1, "MSNFTP") != 0)
{
- MSN_DebugLog("Another side requested the unknown protocol (%s), closing thread", params);
+ debugLogA("Another side requested the unknown protocol (%s), closing thread", params);
return 1;
}
}
@@ -259,13 +259,13 @@ void __cdecl CMsnProto::msnftp_sendFileThread(void* arg) {
ThreadData* info = (ThreadData*)arg;
- MSN_DebugLog("Waiting for an incoming connection to '%s'...", info->mServer);
+ debugLogA("Waiting for an incoming connection to '%s'...", info->mServer);
switch(WaitForSingleObject(info->hWaitEvent, 60000))
{
case WAIT_TIMEOUT:
case WAIT_FAILED:
- MSN_DebugLog("Incoming connection timed out, closing file transfer");
+ debugLogA("Incoming connection timed out, closing file transfer");
return;
}
@@ -299,18 +299,18 @@ void __cdecl CMsnProto::msnftp_sendFileThread(void* arg) char msg[sizeof(info->mData)];
memcpy(msg, info->mData, peol - info->mData); msg[peol - info->mData] = 0;
if (*++peol != '\n')
- MSN_DebugLog("Dodgy line ending to command: ignoring");
+ debugLogA("Dodgy line ending to command: ignoring");
else
peol++;
info->mBytesInData -= peol - info->mData;
memmove(info->mData, peol, info->mBytesInData);
- MSN_DebugLog("RECV:%s", msg);
+ debugLogA("RECV:%s", msg);
if (!isalnum(msg[0]) || !isalnum(msg[1]) || !isalnum(msg[2]) || (msg[3] && msg[3]!=' '))
{
- MSN_DebugLog("Invalid command name");
+ debugLogA("Invalid command name");
continue;
}
@@ -321,12 +321,12 @@ void __cdecl CMsnProto::msnftp_sendFileThread(void* arg) if (info->mBytesInData == sizeof(info->mData))
{
- MSN_DebugLog("sizeof(data) is too small: the longest line won't fit");
+ debugLogA("sizeof(data) is too small: the longest line won't fit");
break;
}
}
- MSN_DebugLog("Closing file transfer thread");
+ debugLogA("Closing file transfer thread");
}
void CMsnProto::msnftp_startFileSend(ThreadData* info, const char* Invcommand, const char* Invcookie)
@@ -344,9 +344,9 @@ void CMsnProto::msnftp_startFileSend(ThreadData* info, const char* Invcommand, c nlb.pfnNewConnectionV2 = MSN_ConnectionProc;
nlb.pExtra = this;
- sb = (HANDLE)CallService(MS_NETLIB_BINDPORT, (WPARAM)hNetlibUser, (LPARAM)&nlb);
+ sb = (HANDLE)CallService(MS_NETLIB_BINDPORT, (WPARAM)m_hNetlibUser, (LPARAM)&nlb);
if (sb == NULL)
- MSN_DebugLog("Unable to bind the port for incoming transfers");
+ debugLogA("Unable to bind the port for incoming transfers");
}
char hostname[256] = "";
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index faf479027b..58488c44a0 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -372,7 +372,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) while (*tParams == ' ') ++tParams;
- MSN_DebugLog("Running mailer \"%s\" with params \"%s\"", tCmd, tParams);
+ debugLogA("Running mailer \"%s\" with params \"%s\"", tCmd, tParams);
ShellExecuteA(NULL, "open", tCmd, tParams, NULL, TRUE);
}
}
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 96c5e236e0..8a515d7ffa 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -118,21 +118,6 @@ void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const ch }
/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_DebugLog - writes a line of comments to the network log
-
-void CMsnProto::MSN_DebugLog(const char *fmt, ...)
-{
- char str[4096];
- va_list vararg;
-
- va_start(vararg, fmt);
- if (mir_vsnprintf(str, sizeof(str), fmt, vararg) != 0)
- {
- str[sizeof(str)-1] = 0;
- CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)str);
- }
- va_end(vararg);
-}
void CMsnProto::InitCustomFolders(void)
{
@@ -716,7 +701,7 @@ int ThreadData::sendPacket(const char* cmd, const char* fmt,...) void CMsnProto::MSN_SetServerStatus(int newStatus)
{
- MSN_DebugLog("Setting MSN server status %d, logged in = %d", newStatus, msnLoggedIn);
+ debugLogA("Setting MSN server status %d, logged in = %d", newStatus, msnLoggedIn);
if (!msnLoggedIn)
return;
@@ -833,7 +818,7 @@ void CMsnProto::MsnInvokeMyURL(bool ismail, const char* url) mir_free(post);
}
- MSN_DebugLog("Starting URL: '%s'", hippy);
+ debugLogA("Starting URL: '%s'", hippy);
CallService(MS_UTILS_OPENURL, 1, (LPARAM)hippy);
}
@@ -1018,7 +1003,7 @@ filetransfer::filetransfer(CMsnProto* prt) filetransfer::~filetransfer(void)
{
if (p2p_sessionid)
- proto->MSN_DebugLog("Destroying file transfer session %08X", p2p_sessionid);
+ proto->debugLogA("Destroying file transfer session %08X", p2p_sessionid);
WaitForSingleObject(hLockHandle, 2000);
CloseHandle(hLockHandle);
diff --git a/protocols/MSN/src/msn_natdetect.cpp b/protocols/MSN/src/msn_natdetect.cpp index 5837602347..77ef7f1adf 100644 --- a/protocols/MSN/src/msn_natdetect.cpp +++ b/protocols/MSN/src/msn_natdetect.cpp @@ -56,13 +56,13 @@ void CMsnProto::DecryptEchoPacket(UDPProbePkt& pkt) IN_ADDR addr;
- MSN_DebugLog("Echo packet: version: 0x%x service code: 0x%x transaction ID: 0x%x",
+ debugLogA("Echo packet: version: 0x%x service code: 0x%x transaction ID: 0x%x",
pkt.version, pkt.serviceCode, pkt.trId);
addr.S_un.S_addr = pkt.clientIP;
- MSN_DebugLog("Echo packet: client port: %u client addr: %s",
+ debugLogA("Echo packet: client port: %u client addr: %s",
pkt.clientPort, inet_ntoa(addr));
addr.S_un.S_addr = pkt.testIP;
- MSN_DebugLog("Echo packet: discard port: %u test port: %u test addr: %s",
+ debugLogA("Echo packet: discard port: %u test port: %u test addr: %s",
pkt.discardPort, pkt.testPort, inet_ntoa(addr));
}
@@ -97,7 +97,7 @@ void CMsnProto::MSNatDetect(void) PHOSTENT host = gethostbyname("echo.edge.messenger.live.com");
if (host == NULL)
{
- MSN_DebugLog("P2PNAT could not find echo server \"echo.edge.messenger.live.com\"");
+ debugLogA("P2PNAT could not find echo server \"echo.edge.messenger.live.com\"");
return;
}
@@ -106,7 +106,7 @@ void CMsnProto::MSNatDetect(void) addr.sin_port = _htons(7001);
addr.sin_addr = *( PIN_ADDR )host->h_addr_list[0];
- MSN_DebugLog("P2PNAT Detected echo server IP %d.%d.%d.%d",
+ debugLogA("P2PNAT Detected echo server IP %d.%d.%d.%d",
addr.sin_addr.S_un.S_un_b.s_b1, addr.sin_addr.S_un.S_un_b.s_b2,
addr.sin_addr.S_un.S_un_b.s_b3, addr.sin_addr.S_un.S_un_b.s_b4);
@@ -127,7 +127,7 @@ void CMsnProto::MSNatDetect(void) getsockname(s, (SOCKADDR*)&myaddr, &szname);
MyConnection.intIP = myaddr.sin_addr.S_un.S_addr;
- MSN_DebugLog("P2PNAT Detected IP facing internet %d.%d.%d.%d",
+ debugLogA("P2PNAT Detected IP facing internet %d.%d.%d.%d",
myaddr.sin_addr.S_un.S_un_b.s_b1, myaddr.sin_addr.S_un.S_un_b.s_b2,
myaddr.sin_addr.S_un.S_un_b.s_b3, myaddr.sin_addr.S_un.S_un_b.s_b4);
@@ -146,7 +146,7 @@ void CMsnProto::MSNatDetect(void) if (Miranda_Terminated()) break;
// Send echo request to server 1
- MSN_DebugLog("P2PNAT Request 1 attempt %d sent", i);
+ debugLogA("P2PNAT Request 1 attempt %d sent", i);
sendto(s1, (char*)&pkt, sizeof(pkt), 0, (SOCKADDR*)&addr, sizeof(addr));
fd_set fd;
@@ -156,14 +156,14 @@ void CMsnProto::MSNatDetect(void) if (select(1, &fd, NULL, NULL, &tv) == 1)
{
- MSN_DebugLog("P2PNAT Request 1 attempt %d response", i);
+ debugLogA("P2PNAT Request 1 attempt %d response", i);
recv(s1, (char*)&rpkt, sizeof(rpkt), 0);
pkt2 = rpkt;
DecryptEchoPacket(rpkt);
break;
}
else
- MSN_DebugLog("P2PNAT Request 1 attempt %d timeout", i);
+ debugLogA("P2PNAT Request 1 attempt %d timeout", i);
}
closesocket(s);
@@ -196,7 +196,7 @@ void CMsnProto::MSNatDetect(void) nlb.pfnNewConnectionV2 = MSN_ConnectionProc;
nlb.pExtra = this;
- HANDLE sb = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM)hNetlibUser, (LPARAM)&nlb);
+ HANDLE sb = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM)m_hNetlibUser, (LPARAM)&nlb);
if ( sb != NULL )
{
MyConnection.upnpNAT = htonl(nlb.dwExternalIP) == MyConnection.extIP;
@@ -216,7 +216,7 @@ void CMsnProto::MSNatDetect(void) {
if (Miranda_Terminated()) break;
- MSN_DebugLog("P2PNAT Request 2 attempt %d sent", i);
+ debugLogA("P2PNAT Request 2 attempt %d sent", i);
// Remove IP restriction for server 2
sendto(s1, NULL, 0, 0, (SOCKADDR*)&addr2, sizeof(addr2));
// Send echo request to server 1 for server 2
@@ -229,13 +229,13 @@ void CMsnProto::MSNatDetect(void) if (select(1, &fd, NULL, NULL, &tv) == 1)
{
- MSN_DebugLog("P2PNAT Request 2 attempt %d response", i);
+ debugLogA("P2PNAT Request 2 attempt %d response", i);
recv(s1, (char*)&rpkt2, sizeof(rpkt2), 0);
DecryptEchoPacket(rpkt2);
break;
}
else
- MSN_DebugLog("P2PNAT Request 2 attempt %d timeout", i);
+ debugLogA("P2PNAT Request 2 attempt %d timeout", i);
}
// Response recieved so it's an IP Restricted NAT (Restricted Cone NAT)
@@ -255,7 +255,7 @@ void CMsnProto::MSNatDetect(void) {
if (Miranda_Terminated()) break;
- MSN_DebugLog("P2PNAT Request 3 attempt %d sent", i);
+ debugLogA("P2PNAT Request 3 attempt %d sent", i);
// Send echo request to server 1
sendto(s1, (char*)&pkt, sizeof(pkt), 0, (SOCKADDR*)&addr2, sizeof(addr2));
@@ -266,13 +266,13 @@ void CMsnProto::MSNatDetect(void) if ( select(1, &fd, NULL, NULL, &tv) == 1 )
{
- MSN_DebugLog("P2PNAT Request 3 attempt %d response", i);
+ debugLogA("P2PNAT Request 3 attempt %d response", i);
recv(s1, (char*)&rpkt2, sizeof(rpkt2), 0);
DecryptEchoPacket(rpkt2);
break;
}
else
- MSN_DebugLog("P2PNAT Request 3 attempt %d timeout", i);
+ debugLogA("P2PNAT Request 3 attempt %d timeout", i);
}
if (i < 4)
{
@@ -380,7 +380,7 @@ void CMsnProto::MSNConnDetectThread( void* ) switch (gethst)
{
case 0:
- MSN_DebugLog("P2PNAT User overwrote IP connection is guessed by user settings only");
+ debugLogA("P2PNAT User overwrote IP connection is guessed by user settings only");
// User specified host by himself so check if it matches MSN information
// if it does, move to connection type autodetection,
@@ -444,7 +444,7 @@ void CMsnProto::MSNConnDetectThread( void* ) // If user mapped incoming ports consider direct connection
if (portsMapped)
{
- MSN_DebugLog("P2PNAT User manually mapped ports for incoming connection");
+ debugLogA("P2PNAT User manually mapped ports for incoming connection");
switch(MyConnection.udpConType)
{
case conUnknown:
@@ -462,7 +462,7 @@ void CMsnProto::MSNConnDetectThread( void* ) }
}
- MSN_DebugLog("P2PNAT Connection %s found UPnP: %d ICF: %d", conStr[MyConnection.udpConType],
+ debugLogA("P2PNAT Connection %s found UPnP: %d ICF: %d", conStr[MyConnection.udpConType],
MyConnection.upnpNAT, MyConnection.icf);
MyConnection.CalculateWeight();
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index 03f0b74a16..bfc5fc0d96 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -40,44 +40,44 @@ static const char p2pV2Caps[] = { 0x01, 0x0C, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0E void P2P_Header::logHeader(CMsnProto *ppro)
{
- ppro->MSN_DebugLog("--- Printing message header");
- ppro->MSN_DebugLog(" SessionID = %08X", mSessionID);
- ppro->MSN_DebugLog(" MessageID = %08X", mID);
+ ppro->debugLogA("--- Printing message header");
+ ppro->debugLogA(" SessionID = %08X", mSessionID);
+ ppro->debugLogA(" MessageID = %08X", mID);
#ifndef __GNUC__
- ppro->MSN_DebugLog(" Offset of data = %I64u", mOffset);
- ppro->MSN_DebugLog(" Total amount of data = %I64u", mTotalSize);
+ ppro->debugLogA(" Offset of data = %I64u", mOffset);
+ ppro->debugLogA(" Total amount of data = %I64u", mTotalSize);
#else
- ppro->MSN_DebugLog(" Offset of data = %llu", mOffset);
- ppro->MSN_DebugLog(" Total amount of data = %llu", hdrdata->mTotalSize);
+ ppro->debugLogA(" Offset of data = %llu", mOffset);
+ ppro->debugLogA(" Total amount of data = %llu", hdrdata->mTotalSize);
#endif
- ppro->MSN_DebugLog(" Data in packet = %lu bytes", mPacketLen);
- ppro->MSN_DebugLog(" Flags = %08X", mFlags);
- ppro->MSN_DebugLog(" Acknowledged session ID: %08X", mAckSessionID);
- ppro->MSN_DebugLog(" Acknowledged message ID: %08X", mAckUniqueID);
+ ppro->debugLogA(" Data in packet = %lu bytes", mPacketLen);
+ ppro->debugLogA(" Flags = %08X", mFlags);
+ ppro->debugLogA(" Acknowledged session ID: %08X", mAckSessionID);
+ ppro->debugLogA(" Acknowledged message ID: %08X", mAckUniqueID);
#ifndef __GNUC__
- ppro->MSN_DebugLog(" Acknowledged data size: %I64u", mAckDataSize);
+ ppro->debugLogA(" Acknowledged data size: %I64u", mAckDataSize);
#else
- ppro->MSN_DebugLog(" Acknowledged data size: %llu", mAckDataSize);
+ ppro->debugLogA(" Acknowledged data size: %llu", mAckDataSize);
#endif
- ppro->MSN_DebugLog("------------------------");
+ ppro->debugLogA("------------------------");
}
void P2PV2_Header::logHeader(CMsnProto *ppro)
{
- ppro->MSN_DebugLog("--- Printing message header");
- ppro->MSN_DebugLog(" SessionID = %08X", mSessionID);
- ppro->MSN_DebugLog(" MessageID = %08X", mID);
+ ppro->debugLogA("--- Printing message header");
+ ppro->debugLogA(" SessionID = %08X", mSessionID);
+ ppro->debugLogA(" MessageID = %08X", mID);
#ifndef __GNUC__
- ppro->MSN_DebugLog(" Remaining amount of data = %I64u", mRemSize);
+ ppro->debugLogA(" Remaining amount of data = %I64u", mRemSize);
#else
- ppro->MSN_DebugLog(" Remaining amount of data = %llu", mTotalSize);
+ ppro->debugLogA(" Remaining amount of data = %llu", mTotalSize);
#endif
- ppro->MSN_DebugLog(" Data in packet = %lu bytes", mPacketLen);
- ppro->MSN_DebugLog(" Packet Number = %lu", mPacketNum);
- ppro->MSN_DebugLog(" Operation Code = %08X", mOpCode);
- ppro->MSN_DebugLog(" TF Code = %08X", mTFCode);
- ppro->MSN_DebugLog(" Acknowledged message ID: %08X", mAckUniqueID);
- ppro->MSN_DebugLog("------------------------");
+ ppro->debugLogA(" Data in packet = %lu bytes", mPacketLen);
+ ppro->debugLogA(" Packet Number = %lu", mPacketNum);
+ ppro->debugLogA(" Operation Code = %08X", mOpCode);
+ ppro->debugLogA(" TF Code = %08X", mTFCode);
+ ppro->debugLogA(" Acknowledged message ID: %08X", mAckUniqueID);
+ ppro->debugLogA("------------------------");
}
bool CMsnProto::p2p_createListener(filetransfer* ft, directconnection *dc, MimeHeaders& chdrs)
@@ -88,10 +88,10 @@ bool CMsnProto::p2p_createListener(filetransfer* ft, directconnection *dc, MimeH nlb.cbSize = sizeof(nlb);
nlb.pfnNewConnectionV2 = MSN_ConnectionProc;
nlb.pExtra = this;
- HANDLE sb = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM) hNetlibUser, (LPARAM)&nlb);
+ HANDLE sb = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM) m_hNetlibUser, (LPARAM)&nlb);
if (sb == NULL)
{
- MSN_DebugLog("Unable to bind the port for incoming transfers");
+ debugLogA("Unable to bind the port for incoming transfers");
return false;
}
@@ -259,7 +259,7 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft) ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
char *filename = mir_utf8encodeT(AI.filename);
- MSN_DebugLog("Avatar for contact %08x saved to file '%s'", AI.hContact, filename);
+ debugLogA("Avatar for contact %08x saved to file '%s'", AI.hContact, filename);
mir_free(filename);
}
break;
@@ -450,7 +450,7 @@ void CMsnProto::p2p_sendAbortSession(filetransfer* ft) {
if (ft == NULL)
{
- MSN_DebugLog(sttVoidSession);
+ debugLogA(sttVoidSession);
return;
}
@@ -482,7 +482,7 @@ void CMsnProto::p2p_sendRedirect(filetransfer* ft) {
if (ft == NULL)
{
- MSN_DebugLog(sttVoidSession);
+ debugLogA(sttVoidSession);
return;
}
@@ -510,7 +510,7 @@ void CMsnProto::p2p_sendSlp(int iKind, filetransfer *ft, MimeHeaders &pHeaders, {
if (ft == NULL)
{
- MSN_DebugLog(sttVoidSession);
+ debugLogA(sttVoidSession);
return;
}
@@ -604,7 +604,7 @@ void CMsnProto::p2p_sendBye(filetransfer* ft) {
if (ft == NULL)
{
- MSN_DebugLog(sttVoidSession);
+ debugLogA(sttVoidSession);
return;
}
@@ -631,7 +631,7 @@ void CMsnProto::p2p_sendNoCall(filetransfer* ft) {
if (ft == NULL)
{
- MSN_DebugLog(sttVoidSession);
+ debugLogA(sttVoidSession);
return;
}
@@ -655,7 +655,7 @@ void CMsnProto::p2p_sendStatus(filetransfer* ft, long lStatus) {
if (ft == NULL)
{
- MSN_DebugLog(sttVoidSession);
+ debugLogA(sttVoidSession);
return;
}
@@ -729,13 +729,13 @@ bool CMsnProto::p2p_connectTo(ThreadData* info, directconnection *dc) tConn.wPort = (WORD)atol(tPortDelim + 1);
}
- MSN_DebugLog("Connecting to %s:%d", tConn.szHost, tConn.wPort);
+ debugLogA("Connecting to %s:%d", tConn.szHost, tConn.wPort);
- info->s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&tConn);
+ info->s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&tConn);
if (info->s == NULL)
{
TWinErrorCode err;
- MSN_DebugLog("Connection Failed (%d): %s", err.mErrorCode, err.getText());
+ debugLogA("Connection Failed (%d): %s", err.mErrorCode, err.getText());
return false;
}
info->send(p2p_greeting, sizeof(p2p_greeting));
@@ -764,7 +764,7 @@ bool CMsnProto::p2p_connectTo(ThreadData* info, directconnection *dc) BYTE* p;
if ((p = buf.surelyRead(4)) == NULL)
{
- MSN_DebugLog("Error reading data, closing filetransfer");
+ debugLogA("Error reading data, closing filetransfer");
return false;
}
@@ -796,7 +796,7 @@ bool CMsnProto::p2p_connectTo(ThreadData* info, directconnection *dc) if (!cookieMatch)
{
- MSN_DebugLog("Invalid cookie received, exiting");
+ debugLogA("Invalid cookie received, exiting");
return false;
}
@@ -812,10 +812,10 @@ bool CMsnProto::p2p_listen(ThreadData* info, directconnection *dc) {
case WAIT_TIMEOUT:
case WAIT_FAILED:
- MSN_DebugLog("Incoming connection timed out, closing file transfer");
+ debugLogA("Incoming connection timed out, closing file transfer");
MSN_StartP2PTransferByContact(info->mInitialContactWLID);
LBL_Error:
- MSN_DebugLog("File listen failed");
+ debugLogA("File listen failed");
return false;
}
@@ -827,13 +827,13 @@ LBL_Error: if (memcmp(p, p2p_greeting, 8) != 0)
{
- MSN_DebugLog("Invalid input data, exiting");
+ debugLogA("Invalid input data, exiting");
return false;
}
if ((p = buf.surelyRead(4)) == NULL)
{
- MSN_DebugLog("Error reading data, closing filetransfer");
+ debugLogA("Error reading data, closing filetransfer");
return false;
}
@@ -860,7 +860,7 @@ LBL_Error: if (!cookieMatch)
{
- MSN_DebugLog("Invalid cookie received, exiting");
+ debugLogA("Invalid cookie received, exiting");
return false;
}
@@ -876,7 +876,7 @@ LBL_Error: if (!cookieMatch)
{
- MSN_DebugLog("Invalid cookie received, exiting");
+ debugLogA("Invalid cookie received, exiting");
goto LBL_Error;
}
@@ -964,7 +964,7 @@ LONG CMsnProto::p2p_sendPortion(filetransfer* ft, ThreadData* T, bool isV2) }
}
else
- MSN_DebugLog(" Error sending");
+ debugLogA(" Error sending");
ft->ts = time(NULL);
ft->p2p_waitack = true;
@@ -983,12 +983,12 @@ void __cdecl CMsnProto::p2p_sendFeedThread(void* arg) info->contactJoined(info->mInitialContactWLID);
mir_free(info->mInitialContactWLID); info->mInitialContactWLID = NULL;
- MSN_DebugLog("File send thread started");
+ debugLogA("File send thread started");
switch(WaitForSingleObject(info->hWaitEvent, 6000))
{
case WAIT_FAILED:
- MSN_DebugLog("File send wait failed");
+ debugLogA("File send wait failed");
return;
}
@@ -1034,7 +1034,7 @@ void __cdecl CMsnProto::p2p_sendFeedThread(void* arg) {
if (fault)
{
- MSN_DebugLog("File send failed");
+ debugLogA("File send failed");
break;
}
else
@@ -1062,7 +1062,7 @@ void __cdecl CMsnProto::p2p_sendFeedThread(void* arg) p2p_sessionComplete(ft);
}
- MSN_DebugLog("File send thread completed");
+ debugLogA("File send thread completed");
}
@@ -1129,7 +1129,7 @@ void __cdecl CMsnProto::p2p_fileActiveThread(void* arg) {
ThreadData* info = (ThreadData*)arg;
- MSN_DebugLog("p2p_fileActiveThread() started: connecting to '%s'", info->mServer);
+ debugLogA("p2p_fileActiveThread() started: connecting to '%s'", info->mServer);
directconnection *dc = p2p_getDCByCallID(info->mCookie, info->mInitialContactWLID);
if (dc)
@@ -1146,14 +1146,14 @@ void __cdecl CMsnProto::p2p_fileActiveThread(void* arg) p2p_unregisterDC(dc);
}
- MSN_DebugLog("p2p_fileActiveThread() completed: connecting to '%s'", info->mServer);
+ debugLogA("p2p_fileActiveThread() completed: connecting to '%s'", info->mServer);
}
void __cdecl CMsnProto::p2p_filePassiveThread(void* arg)
{
ThreadData* info = (ThreadData*)arg;
- MSN_DebugLog("p2p_filePassiveThread() started: listening");
+ debugLogA("p2p_filePassiveThread() started: listening");
directconnection *dc = p2p_getDCByCallID(info->mCookie, info->mInitialContactWLID);
if (dc)
@@ -1169,7 +1169,7 @@ void __cdecl CMsnProto::p2p_filePassiveThread(void* arg) p2p_unregisterDC(dc);
}
- MSN_DebugLog("p2p_filePassiveThread() completed");
+ debugLogA("p2p_filePassiveThread() completed");
}
@@ -1191,7 +1191,7 @@ void CMsnProto::p2p_InitFileTransfer( szBranch += 7;
}
if (szCallID == NULL || szBranch == NULL) {
- MSN_DebugLog("Ignoring invalid invitation: CallID='%s', szBranch='%s'", szCallID, szBranch);
+ debugLogA("Ignoring invalid invitation: CallID='%s', szBranch='%s'", szCallID, szBranch);
return;
}
@@ -1202,7 +1202,7 @@ void CMsnProto::p2p_InitFileTransfer( if (szSessionID == NULL || szAppId == NULL || szEufGuid == NULL)
{
- MSN_DebugLog("Ignoring invalid invitation: SessionID='%s', AppID=%s, Branch='%s',Context='%s'",
+ debugLogA("Ignoring invalid invitation: SessionID='%s', AppID=%s, Branch='%s',Context='%s'",
szSessionID, szAppId, szEufGuid, szContext);
return;
}
@@ -1269,14 +1269,14 @@ void CMsnProto::p2p_InitFileTransfer( {
p2p_sendStatus(ft, 603);
MSN_ShowError("Your avatar not set correctly. Avatar should be set in View/Change My Details | Avatar");
- MSN_DebugLog("Unable to open avatar file '%s', error %d", szFileName, errno);
+ debugLogA("Unable to open avatar file '%s', error %d", szFileName, errno);
p2p_unregisterSession(ft);
}
else
{
mir_free(ft->std.tszCurrentFile);
ft->std.tszCurrentFile = mir_tstrdup(szFileName);
-// MSN_DebugLog("My avatar file opened for %s as %08p::%d", szEmail, ft, ft->fileId);
+// debugLogA("My avatar file opened for %s as %08p::%d", szEmail, ft, ft->fileId);
ft->std.totalBytes = ft->std.currentFileSize = _filelengthi64(ft->fileId);
ft->std.flags |= PFTS_SENDING;
@@ -1294,7 +1294,7 @@ void CMsnProto::p2p_InitFileTransfer( else
{
p2p_sendStatus(ft, 603);
- MSN_DebugLog("Requested avatar does not match current avatar");
+ debugLogA("Requested avatar does not match current avatar");
p2p_unregisterSession(ft);
}
}
@@ -1359,7 +1359,7 @@ void CMsnProto::p2p_InitFileTransfer( default:
p2p_sendStatus(ft, 603);
p2p_unregisterSession(ft);
- MSN_DebugLog("Invalid or unknown data transfer request (AppID/EUF-GUID: %ld/%s)", dwAppID, szEufGuid);
+ debugLogA("Invalid or unknown data transfer request (AppID/EUF-GUID: %ld/%s)", dwAppID, szEufGuid);
break;
}
@@ -1384,13 +1384,13 @@ void CMsnProto::p2p_InitDirectTransfer(MimeHeaders& tFileInfo, MimeHeaders& tFil }
if (szCallID == NULL || szBranch == NULL)
{
- MSN_DebugLog("Ignoring invalid invitation: CallID='%s', Branch='%s'", szCallID, szBranch);
+ debugLogA("Ignoring invalid invitation: CallID='%s', Branch='%s'", szCallID, szBranch);
return;
}
if (szConnType == NULL || szUPnPNat == NULL || szICF == NULL || szNetID == NULL)
{
- MSN_DebugLog("Ignoring invalid invitation: ConnType='%s', UPnPNat='%s', ICF='%s', NetID='%s'",
+ debugLogA("Ignoring invalid invitation: ConnType='%s', UPnPNat='%s', ICF='%s', NetID='%s'",
szConnType, szUPnPNat, szICF, szNetID);
return;
}
@@ -1455,7 +1455,7 @@ void CMsnProto::p2p_InitDirectTransfer(MimeHeaders& tFileInfo, MimeHeaders& tFil MimeHeaders chdrs(12);
bool listen = false;
- MSN_DebugLog("Connection weight, his: %d mine: %d", conType.weight, MyConnection.weight);
+ debugLogA("Connection weight, his: %d mine: %d", conType.weight, MyConnection.weight);
if (conType.weight <= MyConnection.weight)
listen = p2p_createListener(ft, dc, chdrs);
@@ -1535,7 +1535,7 @@ void CMsnProto::p2p_InitDirectTransfer2(MimeHeaders& tFileInfo, MimeHeaders& tFi if ((szNonce == NULL && szHashedNonce == NULL) || szListening == NULL)
{
- MSN_DebugLog("Ignoring invalid invitation: Listening='%s', Nonce=%s", szListening, szNonce);
+ debugLogA("Ignoring invalid invitation: Listening='%s', Nonce=%s", szListening, szNonce);
return;
}
@@ -1591,7 +1591,7 @@ void CMsnProto::p2p_AcceptTransfer(MimeHeaders& tFileInfo, MimeHeaders& tFileInf if (szCallID == NULL || szBranch == NULL || szOldContentType == NULL)
{
- MSN_DebugLog("Ignoring invalid invitation: CallID='%s', szBranch='%s'", szCallID, szBranch);
+ debugLogA("Ignoring invalid invitation: CallID='%s', szBranch='%s'", szCallID, szBranch);
LBL_Close:
p2p_sendStatus(ft, 500);
return;
@@ -1665,7 +1665,7 @@ LBL_Close: if ((szNonce == NULL && szHashedNonce == NULL) || szListening == NULL)
{
- MSN_DebugLog("Invalid data packet, exiting...");
+ debugLogA("Invalid data packet, exiting...");
goto LBL_Close;
}
@@ -1767,7 +1767,7 @@ void CMsnProto::p2p_processSIP(ThreadData* info, char* msgbody, P2PB_Header* hdr const char* szContentType = tFileInfo["Content-Type"];
if (szContentType == NULL)
{
- MSN_DebugLog("Invalid or missing Content-Type field, exiting");
+ debugLogA("Invalid or missing Content-Type field, exiting");
return;
}
@@ -1945,7 +1945,7 @@ void CMsnProto::p2p_processMsgV2(ThreadData* info, char* msgbody, const char* w ft->nNotify = clock() + 500;
//---- send an ack: body was transferred correctly
- MSN_DebugLog("Transferred %I64u bytes remaining %I64u", ft->std.currentFileProgress, hdrdata.mRemSize);
+ debugLogA("Transferred %I64u bytes remaining %I64u", ft->std.currentFileProgress, hdrdata.mRemSize);
}
if (hdrdata.mRemSize == 0)
@@ -2119,7 +2119,7 @@ void CMsnProto::p2p_processMsg(ThreadData* info, char* msgbody, const char* wli }
//---- send an ack: body was transferred correctly
- MSN_DebugLog("Transferred %I64u bytes out of %I64u", ft->std.currentFileProgress, hdrdata.mTotalSize);
+ debugLogA("Transferred %I64u bytes out of %I64u", ft->std.currentFileProgress, hdrdata.mTotalSize);
}
if (ft->std.currentFileProgress >= hdrdata.mTotalSize)
diff --git a/protocols/MSN/src/msn_p2ps.cpp b/protocols/MSN/src/msn_p2ps.cpp index b642180695..1f2a3d9577 100644 --- a/protocols/MSN/src/msn_p2ps.cpp +++ b/protocols/MSN/src/msn_p2ps.cpp @@ -68,7 +68,7 @@ filetransfer* CMsnProto::p2p_getSessionByID(unsigned id) LeaveCriticalSection(&sessionLock);
if (ft == NULL)
- MSN_DebugLog("Ignoring unknown session id %08x", id);
+ debugLogA("Ignoring unknown session id %08x", id);
return ft;
}
@@ -93,7 +93,7 @@ filetransfer* CMsnProto::p2p_getSessionByUniqueID(unsigned id) LeaveCriticalSection(&sessionLock);
if (ft == NULL)
- MSN_DebugLog("Ignoring unknown unique id %08x", id);
+ debugLogA("Ignoring unknown unique id %08x", id);
return ft;
}
@@ -295,7 +295,7 @@ filetransfer* CMsnProto::p2p_getSessionByCallID(const char* CallID, const char* LeaveCriticalSection(&sessionLock);
if (ft == NULL)
- MSN_DebugLog("Ignoring unknown session call id %s", CallID);
+ debugLogA("Ignoring unknown session call id %s", CallID);
return ft;
}
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 8312a02c9b..1ad594116f 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -142,7 +142,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : nlu.pfnHttpGatewayUnwrapRecv = msn_httpGatewayUnwrapRecv;
mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin connections"), m_tszUserName);
- hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
}
CMsnProto::~CMsnProto()
@@ -159,7 +159,7 @@ CMsnProto::~CMsnProto() P2pSessions_Uninit();
CachedMsg_Uninit();
- Netlib_CloseHandle(hNetlibUser);
+ Netlib_CloseHandle(m_hNetlibUser);
Netlib_CloseHandle(hNetlibUserHttps);
mir_free(mailsoundname);
@@ -1017,7 +1017,7 @@ int __cdecl CMsnProto::SetStatus(int iNewStatus) if (m_iDesiredStatus == iNewStatus) return 0;
m_iDesiredStatus = iNewStatus;
- MSN_DebugLog("PS_SETSTATUS(%d,0)", iNewStatus);
+ debugLogA("PS_SETSTATUS(%d,0)", iNewStatus);
if (m_iDesiredStatus == ID_STATUS_OFFLINE)
{
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index eef0a1313e..aaaee49351 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -179,7 +179,7 @@ struct CMsnProto : public PROTO<CMsnProto> clock_t mStatusMsgTS;
HANDLE msnSearchId;
- HANDLE hNetlibUser, hNetlibUserHttps;
+ HANDLE hNetlibUserHttps;
HANDLE hHttpsConnection;
HANDLE hMSNNudge;
HANDLE hPopupError, hPopupHotmail, hPopupNotify;
@@ -191,8 +191,6 @@ struct CMsnProto : public PROTO<CMsnProto> void InitCustomFolders(void);
- void MSN_DebugLog(const char* fmt, ...);
-
char* getSslResult(char** parUrl, const char* parAuthInfo, const char* hdrs, unsigned& status);
bool getMyAvatarFile(char *url, TCHAR *fname);
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index 5f1db4ff16..436fc36a79 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -400,7 +400,7 @@ int CMsnProto::OnContactDeleted(WPARAM wParam, LPARAM lParam) if (szEmail[0])
{
- MSN_DebugLog("Deleted Handler Email");
+ debugLogA("Deleted Handler Email");
if (Lists_IsInList(LIST_FL, szEmail))
{
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index e25bbb7085..72690d3bc0 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -72,7 +72,7 @@ void __cdecl CMsnProto::msn_keepAliveThread(void*) }
CloseHandle(hKeepAliveThreadEvt); hKeepAliveThreadEvt = NULL;
- MSN_DebugLog("Closing keep-alive thread");
+ debugLogA("Closing keep-alive thread");
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -133,12 +133,12 @@ void __cdecl CMsnProto::MSNServerThread(void* arg) }
}
- MSN_DebugLog("Thread started: server='%s:%d', type=%d", tConn.szHost, tConn.wPort, info->mType);
+ debugLogA("Thread started: server='%s:%d', type=%d", tConn.szHost, tConn.wPort, info->mType);
- info->s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&tConn);
+ info->s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&tConn);
if (info->s == NULL)
{
- MSN_DebugLog("Connection Failed (%d) server='%s:%d'", WSAGetLastError(), tConn.szHost, tConn.wPort);
+ debugLogA("Connection Failed (%d) server='%s:%d'", WSAGetLastError(), tConn.szHost, tConn.wPort);
switch (info->mType)
{
@@ -156,7 +156,7 @@ void __cdecl CMsnProto::MSNServerThread(void* arg) if (usingGateway)
CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(info->s), info->mGatewayTimeout);
- MSN_DebugLog("Connected with handle=%08X", info->s);
+ debugLogA("Connected with handle=%08X", info->s);
if (info->mType == SERVER_NOTIFICATION)
{
@@ -176,20 +176,20 @@ void __cdecl CMsnProto::MSNServerThread(void* arg) msnNsThread = info;
}
- MSN_DebugLog("Entering main recv loop");
+ debugLogA("Entering main recv loop");
info->mBytesInData = 0;
for (;;)
{
int recvResult = info->recv(info->mData + info->mBytesInData, sizeof(info->mData) - info->mBytesInData);
if (recvResult == SOCKET_ERROR)
{
- MSN_DebugLog("Connection %08p [%08X] was abortively closed", info->s, GetCurrentThreadId());
+ debugLogA("Connection %08p [%08X] was abortively closed", info->s, GetCurrentThreadId());
break;
}
if (!recvResult)
{
- MSN_DebugLog("Connection %08p [%08X] was gracefully closed", info->s, GetCurrentThreadId());
+ debugLogA("Connection %08p [%08X] was gracefully closed", info->s, GetCurrentThreadId());
break;
}
@@ -215,17 +215,17 @@ void __cdecl CMsnProto::MSNServerThread(void* arg) memcpy(msg, info->mData, peol-info->mData); msg[peol-info->mData] = 0;
if (*++peol != '\n')
- MSN_DebugLog("Dodgy line ending to command: ignoring");
+ debugLogA("Dodgy line ending to command: ignoring");
else
peol++;
info->mBytesInData -= peol - info->mData;
memmove(info->mData, peol, info->mBytesInData);
- MSN_DebugLog("RECV: %s", msg);
+ debugLogA("RECV: %s", msg);
if (!isalnum(msg[0]) || !isalnum(msg[1]) || !isalnum(msg[2]) || (msg[3] && msg[3] != ' '))
{
- MSN_DebugLog("Invalid command name");
+ debugLogA("Invalid command name");
continue;
}
@@ -251,7 +251,7 @@ void __cdecl CMsnProto::MSNServerThread(void* arg) if (info->mBytesInData == sizeof(info->mData))
{
- MSN_DebugLog("sizeof(data) is too small: the longest line won't fit");
+ debugLogA("sizeof(data) is too small: the longest line won't fit");
break;
}
}
@@ -297,7 +297,7 @@ LBL_Exit: }
}
- MSN_DebugLog("Thread [%08X] ending now", GetCurrentThreadId());
+ debugLogA("Thread [%08X] ending now", GetCurrentThreadId());
}
void CMsnProto::MSN_InitThreads(void)
@@ -638,7 +638,7 @@ ThreadData::~ThreadData() if (s != NULL)
{
- proto->MSN_DebugLog("Closing connection handle %08X", s);
+ proto->debugLogA("Closing connection handle %08X", s);
Netlib_CloseHandle(s);
}
@@ -693,7 +693,7 @@ void ThreadData::applyGatewayData(HANDLE hConn, bool isPoll) char szHttpPostUrl[300];
getGatewayUrl(szHttpPostUrl, sizeof(szHttpPostUrl), isPoll);
- proto->MSN_DebugLog("applying '%s' to %08X [%08X]", szHttpPostUrl, this, GetCurrentThreadId());
+ proto->debugLogA("applying '%s' to %08X [%08X]", szHttpPostUrl, this, GetCurrentThreadId());
NETLIBHTTPPROXYINFO nlhpi = {0};
nlhpi.cbSize = sizeof(nlhpi);
@@ -753,11 +753,11 @@ void __cdecl CMsnProto::ThreadStub(void* arg) {
ThreadData* info = (ThreadData*)arg;
- MSN_DebugLog("Starting thread %08X (%08X)", GetCurrentThreadId(), info->mFunc);
+ debugLogA("Starting thread %08X (%08X)", GetCurrentThreadId(), info->mFunc);
(this->*(info->mFunc))(info);
- MSN_DebugLog("Leaving thread %08X (%08X)", GetCurrentThreadId(), info->mFunc);
+ debugLogA("Leaving thread %08X (%08X)", GetCurrentThreadId(), info->mFunc);
EnterCriticalSection(&sttLock);
sttThreads.LIST<ThreadData>::remove(info);
@@ -814,7 +814,7 @@ BYTE* HReadBuffer::surelyRead(size_t parBytes) if (parBytes > bufferSize)
{
- owner->proto->MSN_DebugLog("HReadBuffer::surelyRead: not enough memory, %d %d %d", parBytes, bufferSize, startOffset);
+ owner->proto->debugLogA("HReadBuffer::surelyRead: not enough memory, %d %d %d", parBytes, bufferSize, startOffset);
return NULL;
}
}
diff --git a/protocols/MSN/src/msn_ws.cpp b/protocols/MSN/src/msn_ws.cpp index 5833dbf626..98d89698a2 100644 --- a/protocols/MSN/src/msn_ws.cpp +++ b/protocols/MSN/src/msn_ws.cpp @@ -42,7 +42,7 @@ int ThreadData::send(const char data[], size_t datalen) if (rlen == SOCKET_ERROR)
{
// should really also check if sendlen is the same as datalen
- proto->MSN_DebugLog("Send failed: %d", WSAGetLastError());
+ proto->debugLogA("Send failed: %d", WSAGetLastError());
return FALSE;
}
@@ -91,7 +91,7 @@ bool ThreadData::isTimeout(void) {
bool sbsess = mType == SERVER_SWITCHBOARD;
- proto->MSN_DebugLog("Dropping the idle %s due to inactivity", sbsess ? "switchboard" : "p2p");
+ proto->debugLogA("Dropping the idle %s due to inactivity", sbsess ? "switchboard" : "p2p");
if (!sbsess || termPending) return true;
if (proto->getByte("EnableSessionPopup", 0))
@@ -132,7 +132,7 @@ int ThreadData::recv(char* data, size_t datalen) int ret = CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls);
if (ret < 0)
{
- proto->MSN_DebugLog("Connection abortively closed, error %d", WSAGetLastError());
+ proto->debugLogA("Connection abortively closed, error %d", WSAGetLastError());
return ret;
}
else if (ret == 0)
@@ -148,13 +148,13 @@ LBL_RecvAgain: int ret = CallService(MS_NETLIB_RECV, (WPARAM)s, (LPARAM)&nlb);
if (ret == 0)
{
- proto->MSN_DebugLog("Connection closed gracefully");
+ proto->debugLogA("Connection closed gracefully");
return 0;
}
if (ret < 0)
{
- proto->MSN_DebugLog("Connection abortively closed, error %d", WSAGetLastError());
+ proto->debugLogA("Connection abortively closed, error %d", WSAGetLastError());
return ret;
}
|