diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2016-06-11 23:45:23 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2016-06-11 23:45:23 +0000 |
commit | 3e4284bb32b1515cdcac6741d2c2e94f64f08063 (patch) | |
tree | 15602d9e534406646b4b10c889809e10ff07ef30 /protocols/MRA | |
parent | f36117c31cd21ba5442be8fd1d7234b1e71380b2 (diff) |
MRA: change avatars load threads count default value from 4 to 1
add threads names
git-svn-id: http://svn.miranda-ng.org/main/trunk@16948 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA')
-rw-r--r-- | protocols/MRA/src/MraAvatars.cpp | 24 | ||||
-rw-r--r-- | protocols/MRA/src/MraConstans.h | 2 | ||||
-rw-r--r-- | protocols/MRA/src/MraFilesQueue.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_functions.cpp | 8 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 2 |
5 files changed, 26 insertions, 14 deletions
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);
|