diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-03-06 16:46:50 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-03-06 16:46:50 +0000 |
commit | d971763aedb5c69b2246389951f8b6bcac1317db (patch) | |
tree | a423c2d26a38b48ee16ea179fcc03fc16446c7f1 /protocols | |
parent | 615a53f6195f25a3d1b517f10f8957d0f0583768 (diff) |
Steam: Send also timeout number in poll requests
I'm not sure if this makes any difference, but lets have it there.
Also I slighly raised internal timeout and add check for returned timeout number.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12353 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Steam/src/Steam/poll.h | 7 | ||||
-rw-r--r-- | protocols/Steam/src/common.h | 1 | ||||
-rw-r--r-- | protocols/Steam/src/steam_pooling.cpp | 6 |
3 files changed, 11 insertions, 3 deletions
diff --git a/protocols/Steam/src/Steam/poll.h b/protocols/Steam/src/Steam/poll.h index 9e095c0b44..33ffe6dce5 100644 --- a/protocols/Steam/src/Steam/poll.h +++ b/protocols/Steam/src/Steam/poll.h @@ -9,15 +9,16 @@ namespace SteamWebApi PollRequest(const char *token, const char *umqId, UINT32 messageId, int idleSeconds) : HttpsPostRequest(STEAM_API_URL "/ISteamWebUserPresenceOAuth/Poll/v0001") { - timeout = 30000; + timeout = (STEAM_API_TIMEOUT + 5) * 1000; flags |= NLHRF_PERSISTENT; CMStringA data; - data.AppendFormat("access_token=%s&umqid=%s&message=%u&secidletime=%d", + data.AppendFormat("access_token=%s&umqid=%s&message=%u&secidletime=%d§imeout=%d", token, umqId, messageId, - idleSeconds); + idleSeconds, + STEAM_API_TIMEOUT); SetData(data, data.GetLength()); diff --git a/protocols/Steam/src/common.h b/protocols/Steam/src/common.h index 64303c9404..086879e365 100644 --- a/protocols/Steam/src/common.h +++ b/protocols/Steam/src/common.h @@ -40,6 +40,7 @@ #define MODULE "Steam" +#define STEAM_API_TIMEOUT 30 #define STEAM_API_IDLEOUT_AWAY 600 #define STEAM_API_IDLEOUT_SNOOZE 8000 diff --git a/protocols/Steam/src/steam_pooling.cpp b/protocols/Steam/src/steam_pooling.cpp index 374ccc4caa..7097cc0dff 100644 --- a/protocols/Steam/src/steam_pooling.cpp +++ b/protocols/Steam/src/steam_pooling.cpp @@ -240,6 +240,12 @@ void CSteamProto::PollingThread(void*) if (response->resultCode == HTTP_STATUS_UNAUTHORIZED) delSetting("TokenSecret"); + // too low timeout? + node = json_get(root, "sectimeout"); + int timeout = json_as_int(node); + if (timeout < STEAM_API_TIMEOUT) + debugLog(_T("CSteamProto::PollingThread: Timeout is too low (%d)"), timeout); + breaked = true; } |