diff options
author | Alexander Tkachev | 2016-07-21 15:39:21 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 5f9beb76cdb7b34acc258cd30c4c7390036f25c1 (patch) | |
tree | a7bccb75234ed2b1352dcb1be1d5189508381da0 /backends | |
parent | bd8f2ed8250f902b9061f2c3688857390ceebe97 (diff) | |
download | scummvm-rg350-5f9beb76cdb7b34acc258cd30c4c7390036f25c1.tar.gz scummvm-rg350-5f9beb76cdb7b34acc258cd30c4c7390036f25c1.tar.bz2 scummvm-rg350-5f9beb76cdb7b34acc258cd30c4c7390036f25c1.zip |
CLOUD: Fix HTTP response code TODOs
Diffstat (limited to 'backends')
-rw-r--r-- | backends/cloud/googledrive/googledrivetokenrefresher.cpp | 6 | ||||
-rw-r--r-- | backends/cloud/onedrive/onedrivetokenrefresher.cpp | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/backends/cloud/googledrive/googledrivetokenrefresher.cpp b/backends/cloud/googledrive/googledrivetokenrefresher.cpp index b876bc2995..1b858504c5 100644 --- a/backends/cloud/googledrive/googledrivetokenrefresher.cpp +++ b/backends/cloud/googledrive/googledrivetokenrefresher.cpp @@ -64,10 +64,12 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) { } Common::JSONObject result = json->asObject(); + long httpResponseCode = -1; if (result.contains("error")) { //new token needed => request token & then retry original request if (_stream) { - debug(9, "code %ld", _stream->httpResponseCode()); + httpResponseCode = _stream->httpResponseCode(); + debug(9, "code %ld", httpResponseCode); } Common::JSONObject error = result.getVal("error")->asObject(); @@ -89,7 +91,7 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) { irrecoverable = false; if (irrecoverable) { - finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), -1)); //TODO: httpCode + finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), httpResponseCode)); delete json; return; } diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp index 88b5154d8a..3e429f1ef8 100644 --- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp +++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp @@ -64,10 +64,12 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) { } Common::JSONObject result = json->asObject(); + long httpResponseCode = -1; if (result.contains("error")) { //new token needed => request token & then retry original request if (_stream) { - debug(9, "code %ld", _stream->httpResponseCode()); + httpResponseCode = _stream->httpResponseCode(); + debug(9, "code %ld", httpResponseCode); } Common::JSONObject error = result.getVal("error")->asObject(); @@ -93,7 +95,7 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) { if (code == "unauthenticated") irrecoverable = false; if (irrecoverable) { - finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), -1)); //TODO: httpCode + finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), httpResponseCode)); delete json; return; } |