summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/Steam/src/Steam/poll.h7
-rw-r--r--protocols/Steam/src/common.h1
-rw-r--r--protocols/Steam/src/steam_pooling.cpp6
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&sectimeout=%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;
}