diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-12-19 17:05:42 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-12-19 17:05:42 +0000 |
commit | f75582e0394eddac7a9f2cc9ceafb157865d7dbf (patch) | |
tree | cc4a80dedabb66f0eefb9abc5c9d071eeb788aac /protocols/Steam/src/steam_polling.cpp | |
parent | a094253430be0bce085860beeb55e457f4a24175 (diff) |
Steam: Simplify errors checking in PollingThread (remove variable "breaked")
And previous commit (r15373) was indeed correct, I missed the switched logic. But I think the change (r15895) makes it more readable anyway.
git-svn-id: http://svn.miranda-ng.org/main/trunk@15896 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_polling.cpp')
-rw-r--r-- | protocols/Steam/src/steam_polling.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index 99f4828938..0078009e15 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -173,8 +173,7 @@ void CSteamProto::PollingThread(void*) int errors = 0; int errorsLimit = getByte("PollingErrorsLimit", POLLING_ERRORS_LIMIT); - bool breaked = false; - while (!isTerminated && !breaked && errors < errorsLimit) + while (!isTerminated && errors < errorsLimit) { PollRequest *request = new PollRequest(token, umqId, messageId, IdleSeconds()); // request->nlc = m_pollingConnection; @@ -196,7 +195,6 @@ void CSteamProto::PollingThread(void*) } else { - errors = 0; JSONNode *node = json_get(root, "error"); if (node) { ptrT error(json_as_string(node)); @@ -215,6 +213,9 @@ void CSteamProto::PollingThread(void*) json_delete(nroot); } + // Reset error counter only when we've got OK + errors = 0; + // m_pollingConnection = response->nlc; } else if (!lstrcmpi(error, _T("Timeout"))) @@ -231,7 +232,8 @@ void CSteamProto::PollingThread(void*) SetStatus(ID_STATUS_OFFLINE); } - breaked = true; + // let it jump out of further processing + errors = errorsLimit; }*/ else { @@ -248,7 +250,8 @@ void CSteamProto::PollingThread(void*) if (timeout < STEAM_API_TIMEOUT) debugLog(_T("CSteamProto::PollingThread: Timeout is too low (%d)"), timeout); - breaked = true; + // let it jump out of further processing + errors = errorsLimit; } } } |