diff options
-rw-r--r-- | protocols/Steam/src/steam_polling.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index 1078b1a037..bd0cdaf8dd 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -183,9 +183,18 @@ void CSteamProto::OnGotPoll(const HttpResponse &response, void *arg) } json_string error = root["error"].as_string(); - if (error == "Timeout") + if (error == "Timeout") { + // too low timeout? + int timeout = root["sectimeout"].as_int(); + if (timeout < STEAM_API_TIMEOUT) { + debugLogA(__FUNCTION__ ": Timeout is too low (%d)", timeout); + // perhaps it will break connection + Sleep(STEAM_API_TIMEOUT * 1000); + } + // do nothing as this is not necessarily an error return; + } if (error == "OK") { // remember last message timestamp @@ -224,11 +233,6 @@ void CSteamProto::OnGotPoll(const HttpResponse &response, void *arg) // something wrong debugLogA(__FUNCTION__ ": %s (%d)", error.c_str(), response.GetStatusCode()); - // too low timeout? - int timeout = root["sectimeout"].as_int(); - if (timeout < STEAM_API_TIMEOUT) - debugLogA(__FUNCTION__ ": Timeout is too low (%d)", timeout); - // let it jump out of further processing param->errors = param->errorsLimit; } |