From 4a4096bf5d55b9ab033dee43ef40e84dbf34f666 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 16 Oct 2023 15:22:53 +0300 Subject: YAMN: slack debug code removed --- protocols/YAMN/src/proto/netlib.cpp | 30 +++++++++--------- protocols/YAMN/src/proto/pop3/pop3.cpp | 2 +- protocols/YAMN/src/proto/pop3/pop3comm.cpp | 50 +++++++++++++++--------------- 3 files changed, 41 insertions(+), 41 deletions(-) (limited to 'protocols/YAMN/src/proto') diff --git a/protocols/YAMN/src/proto/netlib.cpp b/protocols/YAMN/src/proto/netlib.cpp index 21c1f771fa..4354b6e9be 100644 --- a/protocols/YAMN/src/proto/netlib.cpp +++ b/protocols/YAMN/src/proto/netlib.cpp @@ -33,7 +33,7 @@ void __stdcall SSL_DebugLog(const char *fmt, ...) HANDLE RegisterNLClient(char *name) { #ifdef DEBUG_COMM - DebugLog(CommFile, ""); + mir_writeLogA(CommFile, ""); #endif NETLIBUSER nlu = {}; @@ -44,9 +44,9 @@ HANDLE RegisterNLClient(char *name) #ifdef DEBUG_COMM if (NULL == hNetlibUser) - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); else - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif return hNetlibUser; } @@ -84,7 +84,7 @@ void CNLClient::Connect(const char *servername, const int port) isTLSed = false; #ifdef DEBUG_COMM - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif try { if (nullptr == (hConnection = Netlib_OpenConnection(hNetlibUser, servername, port))) { @@ -92,13 +92,13 @@ void CNLClient::Connect(const char *servername, const int port) throw NetworkError = (uint32_t)ENL_CONNECT; } #ifdef DEBUG_COMM - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif return; } catch (...) { #ifdef DEBUG_COMM - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif throw; } @@ -120,7 +120,7 @@ void CNLClient::Send(const char *query) if (hConnection == nullptr) return; #ifdef DEBUG_COMM - DebugLog(CommFile, "%s", query); + mir_writeLogA(CommFile, "%s", query); #endif try { if ((SOCKET_ERROR == (Sent = LocalNetlib_Send(hConnection, query, (int)mir_strlen(query), MSG_DUMPASTEXT))) || Sent != (unsigned int)mir_strlen(query)) { @@ -128,12 +128,12 @@ void CNLClient::Send(const char *query) throw NetworkError = (uint32_t)ENL_SEND; } #ifdef DEBUG_COMM - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif } catch (...) { #ifdef DEBUG_COMM - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif throw; } @@ -161,7 +161,7 @@ int CNLClient::LocalNetlib_Recv(HNETLIBCONN hConn, char *buf, int len, int flags char *CNLClient::Recv(char *buf, int buflen) { #ifdef DEBUG_COMM - DebugLog(CommFile, ""); + mir_writeLogA(CommFile, ""); #endif try { if (buf == nullptr) @@ -197,14 +197,14 @@ char *CNLClient::Recv(char *buf, int buflen) } #ifdef DEBUG_COMM *(buf + Rcv) = 0; //end the buffer to write it to file - DebugLog(CommFile, "%s", buf); - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "%s", buf); + mir_writeLogA(CommFile, "\n"); #endif return(buf); } catch (...) { #ifdef DEBUG_COMM - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif throw; } @@ -221,12 +221,12 @@ void CNLClient::Disconnect() void UnregisterNLClient() { #ifdef DEBUG_COMM - DebugLog(CommFile, ""); + mir_writeLogA(CommFile, ""); #endif Netlib_CloseHandle(hNetlibUser); hNetlibUser = nullptr; #ifdef DEBUG_COMM - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif } diff --git a/protocols/YAMN/src/proto/pop3/pop3.cpp b/protocols/YAMN/src/proto/pop3/pop3.cpp index 8d24a5218c..31bb24314f 100644 --- a/protocols/YAMN/src/proto/pop3/pop3.cpp +++ b/protocols/YAMN/src/proto/pop3/pop3.cpp @@ -41,7 +41,7 @@ char *CPop3Client::Connect(const char *servername, const int port, BOOL UseSSL, NetClient = new CNLClient; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "Connect:servername: %s port:%d\n", servername, port); + mir_writeLogA(DecodeFile, "Connect:servername: %s port:%d\n", servername, port); #endif POP3Error = EPOP3_CONNECT; NetClient->Connect(servername, port); diff --git a/protocols/YAMN/src/proto/pop3/pop3comm.cpp b/protocols/YAMN/src/proto/pop3/pop3comm.cpp index c734847ff5..89c5c4e359 100644 --- a/protocols/YAMN/src/proto/pop3/pop3comm.cpp +++ b/protocols/YAMN/src/proto/pop3/pop3comm.cpp @@ -583,7 +583,7 @@ void MIR_CDECL SynchroPOP3(CheckParam *WhichTemp) TranslateHeaderFcn(Temp, MyClient->NetClient->Rcv - (Temp - DataRX), &MsgQueuePtr->MailData->TranslatedHeader); #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "\n"); #endif MsgQueuePtr->Flags |= YAMN_MSG_NORMALNEW; if (autoretr) @@ -655,7 +655,7 @@ void MIR_CDECL SynchroPOP3(CheckParam *WhichTemp) if (ActualAccount->Client.POP3Error == EPOP3_STOPPED) ActualAccount->SystemError = EACC_STOPPED; #ifdef DEBUG_COMM - DebugLog(CommFile, "ERROR: %x\n", ErrorCode); + mir_writeLogA(CommFile, "ERROR: %x\n", ErrorCode); #endif { SWriteGuard swm(ActualAccount->MessagesAccessSO); @@ -684,7 +684,7 @@ void MIR_CDECL SynchroPOP3(CheckParam *WhichTemp) } #ifdef DEBUG_COMM - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif } @@ -743,7 +743,7 @@ void __cdecl DeleteMailsPOP3(void *param) try { SetContactStatus(ActualAccount, ID_STATUS_OCCUPIED); #ifdef DEBUG_COMM - DebugLog(CommFile, "<--------Communication-------->\n"); + mir_writeLogA(CommFile, "<--------Communication-------->\n"); #endif if ((MyClient->NetClient == nullptr) || !MyClient->NetClient->Connected()) { SetStatusFcn(ActualAccount, TranslateT("Connecting to server")); @@ -787,7 +787,7 @@ void __cdecl DeleteMailsPOP3(void *param) } #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "<--------Deleting requested mails-------->\n"); + mir_writeLogA(DecodeFile, "<--------Deleting requested mails-------->\n"); #endif if (POP3_DELETEFROMCHECK != POP3PluginParam) // We do not need to get mails on server as we have already it from check function { @@ -796,13 +796,13 @@ void __cdecl DeleteMailsPOP3(void *param) char *DataRX = MyClient->Stat(); #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "\n"); #endif ExtractStat(DataRX, &mboxsize, &msgs); #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "%d\n", mboxsize); - DebugLog(DecodeFile, "%d\n", msgs); - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "%d\n", mboxsize); + mir_writeLogA(DecodeFile, "%d\n", msgs); + mir_writeLogA(DecodeFile, "\n"); #endif if (DataRX != nullptr) free(DataRX); @@ -822,12 +822,12 @@ void __cdecl DeleteMailsPOP3(void *param) if (msgs) { #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "\n"); #endif DataRX = MyClient->Uidl(); ExtractUIDL(DataRX, MyClient->NetClient->Rcv, NewMails); #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "\n"); #endif if (DataRX != nullptr) free(DataRX); @@ -894,7 +894,7 @@ void __cdecl DeleteMailsPOP3(void *param) } #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "\n"); #endif // TODO: now, we have in NewMails new mails. If NewMails is not NULL, we found some new mails, so Checking for new mail should be performed @@ -931,7 +931,7 @@ void __cdecl DeleteMailsPOP3(void *param) if (ActualAccount->Client.POP3Error == EPOP3_STOPPED) ActualAccount->SystemError = EACC_STOPPED; #ifdef DEBUG_COMM - DebugLog(CommFile, "ERROR %x\n", ErrorCode); + mir_writeLogA(CommFile, "ERROR %x\n", ErrorCode); #endif switch (ActualAccount->SystemError) { @@ -951,7 +951,7 @@ void __cdecl DeleteMailsPOP3(void *param) DeleteMessagesToEndFcn(ActualAccount, DeleteMails); #ifdef DEBUG_COMM - DebugLog(CommFile, "\n"); + mir_writeLogA(CommFile, "\n"); #endif // WriteAccounts(); @@ -989,14 +989,14 @@ void ExtractMail(char *stream, int len, HYAMNMAIL queue) if (DOTLINE(finder + 1)) // at the end of stream break; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "\n"); #endif SkipSpaces(finder); // jump whitespace if (1 != sscanf(finder, "%d", &msgnr)) throw (uint32_t)EPOP3_UIDL; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "%d\n", msgnr); + mir_writeLogA(DecodeFile, "%d\n", msgnr); #endif SkipNonSpaces(finder); @@ -1009,8 +1009,8 @@ void ExtractMail(char *stream, int len, HYAMNMAIL queue) queueptr->MailData->Body[i] = 0; // ends string queueptr->Number = msgnr; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "%s\n", queueptr->MailData->Body); - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "%s\n", queueptr->MailData->Body); + mir_writeLogA(DecodeFile, "\n"); #endif queueptr = queueptr->Next; while (!ENDLINE(finder)) finder++; @@ -1032,13 +1032,13 @@ void ExtractUIDL(char *stream, int len, HYAMNMAIL queue) if (DOTLINE(finder + 1)) // at the end of stream break; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "\n"); #endif SkipSpaces(finder); if (1 != sscanf(finder, "%d", &msgnr)) throw (uint32_t)EPOP3_UIDL; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "%d\n", msgnr); + mir_writeLogA(DecodeFile, "%d\n", msgnr); #endif // for (i=1,queueptr=queue;(queueptr->Next != NULL) && (iNext,i++); // if (i != msgnr) @@ -1053,8 +1053,8 @@ void ExtractUIDL(char *stream, int len, HYAMNMAIL queue) queueptr->ID[i] = 0; // ends string queueptr->Number = msgnr; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "%s\n", queueptr->ID); - DebugLog(DecodeFile, "\n"); + mir_writeLogA(DecodeFile, "%s\n", queueptr->ID); + mir_writeLogA(DecodeFile, "\n"); #endif queueptr = queueptr->Next; while (!ENDLINE(finder)) finder++; @@ -1076,13 +1076,13 @@ void ExtractList(char *stream, int len, HYAMNMAIL queue) if (DOTLINE(finder + 1)) // at the end of stream break; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "\n", NULL, 0); + mir_writeLogA(DecodeFile, "\n", NULL, 0); #endif SkipSpaces(finder); if (1 != sscanf(finder, "%d", &msgnr)) // message nr. throw (uint32_t)EPOP3_LIST; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "%d\n", msgnr); + mir_writeLogA(DecodeFile, "%d\n", msgnr); #endif for (i = 1, queueptr = queue; (queueptr->Next != nullptr) && (i < msgnr); queueptr = queueptr->Next, i++); @@ -1095,7 +1095,7 @@ void ExtractList(char *stream, int len, HYAMNMAIL queue) if (1 != sscanf(finder, "%u", &queueptr->MailData->Size)) throw (uint32_t)EPOP3_LIST; #ifdef DEBUG_DECODE - DebugLog(DecodeFile, "%d\n", queueptr->MailData->Size); + mir_writeLogA(DecodeFile, "%d\n", queueptr->MailData->Size); #endif while (!ENDLINE(finder)) finder++; } -- cgit v1.2.3