diff options
Diffstat (limited to 'protocols')
33 files changed, 91 insertions, 14 deletions
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 22d1a408ae..fb7e734547 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -237,6 +237,7 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, TCHAR* msg) void __cdecl CIrcProto::ResolveIPThread(LPVOID di)
{
+ Thread_SetName("IRC: ResolveIPThread");
IPRESOLVE* ipr = (IPRESOLVE *)di;
{
mir_cslock lock(m_resolve);
@@ -2382,6 +2383,7 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*) static void __cdecl AwayWarningThread(LPVOID)
{
+ Thread_SetName("IRC: AwayWarningThread");
MessageBox(NULL, TranslateT("The usage of /AWAY in your perform buffer is restricted\n as IRC sends this command automatically."), TranslateT("IRC Error"), MB_OK);
}
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index a78383f4a5..8d462b3a17 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -438,6 +438,7 @@ void CIrcProto::DoReceive() void __cdecl CIrcProto::ThreadProc(void*) { + Thread_SetName("IRC: CIrcProto"); DoReceive(); m_info.Reset(); } @@ -836,6 +837,8 @@ int CDccSession::Connect() void __cdecl CDccSession::ConnectProc(void *pparam) { + Thread_SetName("IRC: ConnectProc"); + CDccSession* pThis = (CDccSession*)pparam; if (!pThis->con) pThis->SetupConnection(); @@ -1039,6 +1042,8 @@ int CDccSession::IncomingConnection(HANDLE hConnection, DWORD dwIP) // here we decide which function to use for communicating with the remote computer, depending on connection type void __cdecl CDccSession::ThreadProc(void *pparam) { + Thread_SetName("IRC: CDccSession::ThreadProc"); + CDccSession* pThis = (CDccSession*)pparam; // if it is an incoming connection on a listening port, then we should close the listenting port so only one can connect (the one you offered diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 0f4caf2a54..4e5c156334 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -480,6 +480,8 @@ struct AckBasicSearchParam void __cdecl CIrcProto::AckBasicSearch(void *arg)
{
+ Thread_SetName("IRC: AckBasicSearch");
+
AckBasicSearchParam *param = (AckBasicSearchParam*)arg;
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
@@ -658,16 +660,19 @@ struct TFakeAckParam void __cdecl CIrcProto::AckMessageFail(void *info)
{
+ Thread_SetName("IRC: AckMessageFail");
ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The protocol is not online"));
}
void __cdecl CIrcProto::AckMessageFailDcc(void *info)
{
+ Thread_SetName("IRC: AckMessageFailDcc");
ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The dcc chat connection is not active"));
}
void __cdecl CIrcProto::AckMessageSuccess(void *info)
{
+ Thread_SetName("IRC: AckMessageSuccess");
TFakeAckParam *param = (TFakeAckParam*)info;
ProtoBroadcastAck(param->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)param->msgid, 0);
delete param;
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp index a0c98d3298..b8cd6b6e7b 100644 --- a/protocols/IRCG/src/scripting.cpp +++ b/protocols/IRCG/src/scripting.cpp @@ -67,6 +67,7 @@ static void __stdcall OnHook(void * pi) static void __cdecl GuiOutThread(LPVOID di)
{
+ Thread_SetName("IRC: GuiOutThread");
GCHOOK* gch = (GCHOOK*)di;
CallFunctionAsync(OnHook, (void*)gch);
}
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 19909dfc4b..d147b48b2e 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -976,6 +976,8 @@ int __cdecl CIrcProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) }
void __cdecl CIrcProto::ConnectServerThread(void*)
{
+ Thread_SetName("IRC: ConnectServer");
+
InterlockedIncrement((long *)&m_bConnectThreadRunning);
InterlockedIncrement((long *)&m_bConnectRequested);
while (!Miranda_Terminated() && m_bConnectRequested > 0) {
@@ -1016,6 +1018,8 @@ void __cdecl CIrcProto::ConnectServerThread(void*) void __cdecl CIrcProto::DisconnectServerThread(void*)
{
+ Thread_SetName("IRC: DisconnectServer");
+
mir_cslock lck(cs);
if (IsConnected())
Disconnect();
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index a48ba14ee5..c1d1b30564 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -671,6 +671,7 @@ void CIcqProto::requestAvatarConnection() void __cdecl CIcqProto::AvatarThread(avatars_server_connection *pInfo)
{
debugLogA("%s thread started.", "Avatar");
+ Thread_SetName("ICQ: AvatarThread");
// Execute connection handler
pInfo->connectionThread();
diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp index 7131dc5b70..0cc7a372ea 100644 --- a/protocols/IcqOscarJ/src/icq_direct.cpp +++ b/protocols/IcqOscarJ/src/icq_direct.cpp @@ -192,6 +192,8 @@ void CIcqProto::CloseDirectConnection(directconnect *dc) void __cdecl CIcqProto::icq_directThread(directthreadstartinfo *dtsi)
{
+ Thread_SetName("ICQ: directThread");
+
directconnect dc = { 0 };
NETLIBPACKETRECVER packetRecv = { 0 };
HANDLE hPacketRecver;
diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp index 64cbaeb4cd..8e4fc2f753 100644 --- a/protocols/IcqOscarJ/src/icq_infoupdate.cpp +++ b/protocols/IcqOscarJ/src/icq_infoupdate.cpp @@ -151,6 +151,7 @@ void __cdecl CIcqProto::InfoUpdateThread( void* ) DWORD dwWait = WAIT_OBJECT_0;
debugLogA("%s thread starting.", "Info-Update");
+ Thread_SetName("ICQ: InfoUpdateThread");
bInfoUpdateRunning = TRUE;
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 444772d9f9..12c8b99307 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -716,6 +716,8 @@ void CIcqProto::CheekySearchThread(void*) ICQSEARCHRESULT isr = { 0 };
isr.hdr.cbSize = sizeof(isr);
+ Thread_SetName("ICQ: CheekySearchThread");
+
if (cheekySearchUin) {
_itoa(cheekySearchUin, szUin, 10);
isr.hdr.id.t = (TCHAR*)szUin;
@@ -1633,6 +1635,8 @@ struct status_message_thread_data void __cdecl CIcqProto::GetAwayMsgThread(void *pStatusData)
{
+ Thread_SetName("ICQ: GetAwayMsgThread");
+
status_message_thread_data *pThreadData = (status_message_thread_data*)pStatusData;
if (pThreadData) {
// wait a little
diff --git a/protocols/IcqOscarJ/src/icq_rates.cpp b/protocols/IcqOscarJ/src/icq_rates.cpp index b0e7d20b57..6a130e3b03 100644 --- a/protocols/IcqOscarJ/src/icq_rates.cpp +++ b/protocols/IcqOscarJ/src/icq_rates.cpp @@ -301,6 +301,7 @@ rates_queue::~rates_queue() static void rateDelayThread(void *param)
{
+ Thread_SetName("ICQ: rateDelayThread");
rates_queue *pQueue = (rates_queue*)param;
pQueue->handleDelay();
}
diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index 3a891b0a5d..87e1007267 100644 --- a/protocols/IcqOscarJ/src/icq_server.cpp +++ b/protocols/IcqOscarJ/src/icq_server.cpp @@ -36,6 +36,8 @@ void icq_newConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, void *pE void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam)
{
+ Thread_SetName("ICQ: ServerThread");
+
serverthread_info info = { 0 };
info.isLoginServer = info.bReinitRecver = true;
info.wAuthKeyLen = infoParam->wPassLen;
@@ -333,6 +335,7 @@ void CIcqProto::sendServPacket(icq_packet *pPacket) void __cdecl CIcqProto::SendPacketAsyncThread(icq_packet* pkt)
{
+ Thread_SetName("ICQ: SendPacketAsyncThread");
sendServPacket( pkt );
SAFE_FREE((void**)&pkt);
}
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 1c1ea58350..0769d7b69c 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -65,6 +65,7 @@ void CIcqProto::servlistEndOperation(int operationCount) void __cdecl CIcqProto::servlistQueueThread(void *param)
{
debugLogA("Server-List: Starting Update board.");
+ Thread_SetName("ICQ: servlistQueueThread");
int *queueState = (int*)param;
SleepEx(50, FALSE);
diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp index 235a752f9c..ee39798610 100644 --- a/protocols/IcqOscarJ/src/log.cpp +++ b/protocols/IcqOscarJ/src/log.cpp @@ -42,6 +42,7 @@ void __cdecl CIcqProto::icq_LogMessageThread(void* arg) LogMessageInfo *err = (LogMessageInfo*)arg;
if (!err)
return;
+ Thread_SetName("ICQ: LogMessageThread");
if (bPopupService && getByte("PopupsLogEnabled", DEFAULT_LOG_POPUPS_ENABLED)) {
ShowPopupMsg(NULL, err->szTitle, err->szMsg, err->bLevel);
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index 6305536dcb..143a1e715e 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -1104,6 +1104,8 @@ void __cdecl CIcqProto::oft_connectionThread(oscarthreadstartinfo *otsi) NETLIBPACKETRECVER packetRecv = { 0 };
HANDLE hPacketRecver;
+ Thread_SetName("ICQ: oft_connectionThread");
+
oc.hContact = otsi->hContact;
oc.hConnection = otsi->hConnection;
oc.type = otsi->type;
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 26ffc7ed66..85a3c36114 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -906,6 +906,7 @@ bool IsStringUIN(const char *pszString) void __cdecl CIcqProto::ProtocolAckThread(icq_ack_args* pArguments)
{
+ Thread_SetName("ICQ: ProtocolAckThread");
Sleep(150);
if (pArguments->nAckResult == ACKRESULT_SUCCESS)
@@ -988,6 +989,7 @@ int CIcqProto::IsMetaInfoChanged(MCONTACT hContact) void __cdecl CIcqProto::SetStatusNoteThread(void *pDelay)
{
+ Thread_SetName("ICQ: SetStatusNoteThread");
if (pDelay)
SleepEx((UINT_PTR)pDelay, TRUE);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 1861e5240b..02c7e6b611 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -148,6 +148,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) int nIqId = 0;
debugLogA("Thread started: type=bytestream_send");
+ Thread_SetName("Jabber: ByteSendThread");
BOOL bDirect = m_options.BsDirect;
@@ -596,6 +597,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt) BOOL validStreamhost = FALSE;
if (jbt == NULL) return;
+ Thread_SetName("Jabber: ByteReceiveThread");
jbt->state = JBT_INIT;
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 4033edb1b7..f0306b9ec4 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -596,6 +596,8 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) void __cdecl CJabberProto::ConsoleThread(void*)
{
+ Thread_SetName("Jabber: ConsoleThread");
+
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
if (msg.message == WM_CREATECONSOLE) {
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index fa45e4a0e2..69951806b0 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -32,6 +32,7 @@ void __cdecl CJabberProto::FileReceiveThread(filetransfer *ft) ThreadData info(this, NULL);
debugLogA("Thread started: type=file_receive server='%s' port='%d'", ft->httpHostName, ft->httpPort);
+ Thread_SetName("Jabber: FileReceiveThread");
ft->type = FT_OOB;
@@ -234,6 +235,7 @@ void JabberFileServerConnection(JABBER_SOCKET hConnection, DWORD /*dwRemoteIP*/, void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
{
debugLogA("Thread started: type=file_send");
+ Thread_SetName("Jabber: FileServerThread");
ThreadData info(this, NULL);
ft->type = FT_OOB;
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp index ae7b45b7ad..0ac2a73150 100644 --- a/protocols/JabberG/src/jabber_ibb.cpp +++ b/protocols/JabberG/src/jabber_ibb.cpp @@ -89,6 +89,7 @@ void CJabberProto::OnIbbCloseResult(HXML, CJabberIqInfo *pInfo) void CJabberProto::IbbSendThread(JABBER_IBB_TRANSFER *jibb)
{
debugLogA("Thread started: type=ibb_send");
+ Thread_SetName("Jabber: IbbSendThread");
jibb->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
jibb->bStreamInitialized = FALSE;
@@ -134,6 +135,7 @@ void CJabberProto::IbbSendThread(JABBER_IBB_TRANSFER *jibb) void __cdecl CJabberProto::IbbReceiveThread(JABBER_IBB_TRANSFER *jibb)
{
debugLogA("Thread started: type=ibb_recv");
+ Thread_SetName("Jabber: IbbReceiveThread");
filetransfer *ft = jibb->ft;
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index 6149d6d1e9..49192e6613 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -133,12 +133,15 @@ void CJabberIqManager::FillPermanentHandlers() void __cdecl CJabberProto::ExpirerThread(void* pParam)
{
+ Thread_SetName("Jabber: ExpirerThread");
CJabberIqManager *pManager = (CJabberIqManager *)pParam;
pManager->ExpirerThread();
}
void CJabberIqManager::ExpirerThread()
{
+ Thread_SetName("Jabber: ExpirerThread");
+
while (!m_bExpirerThreadShutdownRequest) {
CJabberIqInfo *pInfo = DetouchExpired();
if (!pInfo) {
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 71dd2f0eee..40f2b4fb61 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -712,6 +712,8 @@ private: static void QueryServerListThread(void *arg)
{
+ Thread_SetName("Jabber: QueryServerListThread");
+
CDlgOptAccount *wnd = (CDlgOptAccount *)arg;
HWND hwnd = wnd->GetHwnd();
bool bIsError = true;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 94706e8ca9..327415dab4 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -679,6 +679,7 @@ struct JABBER_SEARCH_BASIC void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb)
{
+ Thread_SetName("Jabber: BasicSearchThread");
Sleep(100);
PROTOSEARCHRESULT psr = { 0 };
@@ -938,6 +939,7 @@ struct TFakeAckParams void __cdecl CJabberProto::SendMessageAckThread(void* param)
{
+ Thread_SetName("Jabber: SendMessageAckThread");
TFakeAckParams *par = (TFakeAckParams*)param;
Sleep(100);
debugLogA("Broadcast ACK");
@@ -1122,6 +1124,8 @@ int __cdecl CJabberProto::SetStatus(int iNewStatus) void __cdecl CJabberProto::GetAwayMsgThread(void *param)
{
+ Thread_SetName("Jabber: GetAwayMsgThread");
+
MCONTACT hContact = (DWORD_PTR)param;
ptrT jid(getTStringA(hContact, "jid"));
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 4ab20dfab0..f4e012174f 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -222,6 +222,7 @@ void CJabberProto::ServerThread(JABBER_CONN_DATA *pParam) ThreadData info(this, pParam);
debugLogA("Thread started: type=%d", info.bIsReg);
+ Thread_SetName("Jabber: ServerThread");
if (m_options.ManualConnect == TRUE) {
ptrA szManualHost(getStringA("ManualHost"));
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index cb50955c75..ad0e2caf07 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -884,6 +884,8 @@ bool CJabberProto::IsMyOwnJID(LPCTSTR szJID) void __cdecl CJabberProto::LoadHttpAvatars(void* param)
{
+ Thread_SetName("Jabber: LoadHttpAvatars");
+
OBJLIST<JABBER_HTTP_AVATARS> &avs = *(OBJLIST<JABBER_HTTP_AVATARS>*)param;
HANDLE hHttpCon = NULL;
for (int i = 0; i < avs.getCount(); i++) {
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 62b329e576..3813da9741 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -159,6 +159,8 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) nls.cbSize = sizeof(nls);
+ Thread_SetName("MRA: AvatarsThreadProc");
+
HANDLE hThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
{
mir_cslock lck(pmraaqAvatarsQueue->cs);
@@ -432,16 +434,18 @@ DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPCSTR bool CMraProto::MraAvatarsGetContactTime(MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
{
- if (lpszValueName && pstTime) {
- INTERNET_TIME itAvatarLastModifiedTimeLocal;
- CMStringA szBuff;
- if (mraGetStringA(hContact, lpszValueName, szBuff))
- if (InternetTimeGetTime(szBuff, itAvatarLastModifiedTimeLocal) == NO_ERROR) {
- memcpy(pstTime, &itAvatarLastModifiedTimeLocal.stTime, sizeof(SYSTEMTIME));
- return true;
- }
- }
- return false;
+ INTERNET_TIME itAvatarLastModifiedTimeLocal;
+ CMStringA szBuff;
+
+ if (NULL == lpszValueName ||
+ NULL == pstTime)
+ return false;
+ if (false == mraGetStringA(hContact, lpszValueName, szBuff))
+ return false;
+ if (InternetTimeGetTime(szBuff, itAvatarLastModifiedTimeLocal) != NO_ERROR)
+ return false;
+ memcpy(pstTime, &itAvatarLastModifiedTimeLocal.stTime, sizeof(SYSTEMTIME));
+ return true;
}
void CMraProto::MraAvatarsSetContactTime(MCONTACT hContact, LPSTR lpszValueName, SYSTEMTIME *pstTime)
diff --git a/protocols/MRA/src/MraConstans.h b/protocols/MRA/src/MraConstans.h index a5eb5aa6ff..6b8b391e66 100644 --- a/protocols/MRA/src/MraConstans.h +++ b/protocols/MRA/src/MraConstans.h @@ -184,7 +184,7 @@ static const LPSTR lpcszMailRuDomains[] = #define MRA_DEFAULT_SHOW_ALL_XSTATUSES FALSE /* Do not display some x statuses (like dating) in menu. */
#define MRA_AVT_DEFAULT_ENABLE TRUE
-#define MRA_AVT_DEFAULT_WRK_THREAD_COUNTS 4 // hidden
+#define MRA_AVT_DEFAULT_WRK_THREAD_COUNTS 1 // hidden
#define MRA_AVT_DEFAULT_SERVER "obraz.foto.mail.ru"
#define MRA_AVT_DEFAULT_SERVER_PORT 80
#define MRA_AVT_DEFAULT_TIMEOUT_CONN 10
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index a69fbae0b6..2b860467f0 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -709,6 +709,8 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) {
DWORD dwRetErrorCode = NO_ERROR;
+ Thread_SetName("MRA: FilesQueueRecv");
+
if (lpParameter) {
MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->hFilesQueueHandle;
MRA_FILES_QUEUE_ITEM *dat = ((MRA_FILES_THREADPROC_PARAMS*)lpParameter)->dat;
@@ -965,6 +967,8 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter) {
DWORD dwRetErrorCode = NO_ERROR;
+ Thread_SetName("MRA: FilesQueueSend");
+
if (!lpParameter)
return;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 6f399df52c..b06913d615 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -887,6 +887,7 @@ void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode static void FakeThread(void* param)
{
+ Thread_SetName("MRA: ProtoBroadcastAckAsync");
Sleep(100);
ACKDATA *ack = (ACKDATA*)param;
@@ -935,9 +936,10 @@ CMStringA CopyNumber(const CMStringA &str) {
CMStringA res;
- for (LPCSTR p = str; *p; p++)
- if (*p >= '0' && *p <= '9')
- res.AppendChar(*p);
+ for (LPCSTR p = str; *p; p++) {
+ if (*p >= '0' && *p <= '9')
+ res.AppendChar(*p);
+ }
return res;
}
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 7026623302..df1b11d455 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -37,6 +37,8 @@ void CMraProto::MraThreadProc(LPVOID) CMStringA szHost;
DWORD dwConnectReTryCount, dwCurConnectReTryCount;
+ Thread_SetName("MRA: ProtoThreadProc");
+
SleepEx(100, FALSE);// to prevent high CPU load by some status plugins like allwaysonline
dwConnectReTryCount = getDword("ConnectReTryCountMRIM", MRA_DEFAULT_CONN_RETRY_COUNT_MRIM);
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 5678869b52..c834e43ad0 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -124,6 +124,8 @@ uint32_t CToxProto::GetToxFriendNumber(MCONTACT hContact) void CToxProto::LoadFriendList(void*)
{
+ Thread_SetName("TOX: LoadFriendList");
+
size_t count = tox_self_get_friend_list_size(toxThread->Tox());
if (count > 0)
{
diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp index a44c1084de..c2c409c3e2 100644 --- a/protocols/Tox/src/tox_messages.cpp +++ b/protocols/Tox/src/tox_messages.cpp @@ -42,6 +42,8 @@ struct SendMessageParam void CToxProto::SendMessageAsync(void *arg)
{
+ Thread_SetName("TOX: SendMessageAsync");
+
SendMessageParam *param = (SendMessageParam*)arg;
int32_t friendNumber = GetToxFriendNumber(param->hContact);
@@ -129,6 +131,8 @@ int CToxProto::OnPreCreateMessage(WPARAM, LPARAM lParam) /* STATUS MESSAGE */
void CToxProto::GetStatusMessageAsync(void* arg)
{
+ Thread_SetName("TOX: GetStatusMessageAsync");
+
MCONTACT hContact = (UINT_PTR)arg;
int32_t friendNumber = GetToxFriendNumber(hContact);
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index bf5e54ccc2..4f68ad3c50 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -249,6 +249,7 @@ void CToxProto::CheckConnection(int &retriesCount) void CToxProto::PollingThread(void*)
{
debugLogA(__FUNCTION__": entering");
+ Thread_SetName("TOX: PollingThread");
Tox_Options *options = GetToxOptions();
if (!options)
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp index df15a4ab78..6c99ad123c 100644 --- a/protocols/Tox/src/tox_search.cpp +++ b/protocols/Tox/src/tox_search.cpp @@ -59,6 +59,8 @@ ToxHexAddress ResolveToxAddressFromDns(const char *dnsQuery) void CToxProto::SearchByNameAsync(void *arg)
{
+ Thread_SetName("TOX: SearchByNameAsync");
+
char *query = (char*)arg;
char *name = strtok(query, "@");
char *domain = strtok(NULL, "");
@@ -145,6 +147,7 @@ void CToxProto::SearchByNameAsync(void *arg) void CToxProto::SearchFailedAsync(void*)
{
+ Thread_SetName("TOX: SearchFailedAsync");
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_FAILED, (HWND)1, 0);
}
|