diff options
author | ElzorFox <elzorfox@ya.ru> | 2017-03-19 01:36:11 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2017-03-19 01:37:22 +0500 |
commit | ca65019975d21b5cd96b71499b6d675c3b11e2a9 (patch) | |
tree | a57248dfde866cfbcbd85d65b037afe8f78a9d08 | |
parent | 46cb46859ce27e2d23da0bcbecbe92da7b349b26 (diff) |
VKontakte:
fix sending unneeded GetServerHistory requestes
tempory (?) increase timeout between API requests
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_history.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_queue.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 6938f7fdb2..284ff08032 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -317,7 +317,7 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, const JSONNode &jnNode) case VKERR_INTERNAL_SERVER_ERR:
if (pReq->m_iRetry > 0) {
pReq->bNeedsRestart = true;
- Sleep(500); //Pause for fix err
+ Sleep(1000); //Pause for fix err
debugLogA("CVkProto::CheckJsonResult Retry = %d", pReq->m_iRetry);
pReq->m_iRetry--;
}
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index 4f71591353..305182ee81 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -116,7 +116,7 @@ void CVkProto::GetServerHistoryLastNDay(MCONTACT hContact, int NDay) void CVkProto::GetServerHistory(MCONTACT hContact, int iOffset, int iCount, int iTime, int iLastMsgId, bool once)
{
debugLogA("CVkProto::GetServerHistory %d %d %d %d %d", iOffset, iCount, iTime, iLastMsgId, (int)once);
- if (!IsOnline())
+ if (!IsOnline() || iCount == 0)
return;
LONG userID = getDword(hContact, "ID", VK_INVALID_USER);
diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp index 870575837b..d23c68e995 100644 --- a/protocols/VKontakte/src/vk_queue.cpp +++ b/protocols/VKontakte/src/vk_queue.cpp @@ -166,7 +166,7 @@ void CVkProto::WorkerThread(void*) break;
ExecuteRequest(pReq);
if (need_sleep) { // There can be maximum 3 requests to API methods per second from a client
- Sleep(330); // (c) https://vk.com/dev/api_requests
+ Sleep(800); // (c) https://vk.com/dev/api_requests
debugLogA("CVkProto::WorkerThread: need sleep");
}
}
|