aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud
diff options
context:
space:
mode:
authorAlexander Tkachev2016-05-27 17:50:27 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit1348befe297d32de9bf40f89f37bcbae2c91d81f (patch)
tree57f62e24c9c9f9e6f7b21292368c39312f13cfd3 /backends/cloud
parentbaf37b9330ee96ca04fe742dc923d9fddfcf4c20 (diff)
downloadscummvm-rg350-1348befe297d32de9bf40f89f37bcbae2c91d81f.tar.gz
scummvm-rg350-1348befe297d32de9bf40f89f37bcbae2c91d81f.tar.bz2
scummvm-rg350-1348befe297d32de9bf40f89f37bcbae2c91d81f.zip
CLOUD: Add access to CurlRequest's Stream
One can access CurlRequest's NetworkReadStream in order to find out HTTP response code or some other Stream-related data. OneDriveTokenRefresher uses it to print some info on that 404 error I'm trying to troubleshoot.
Diffstat (limited to 'backends/cloud')
-rw-r--r--backends/cloud/onedrive/onedrivetokenrefresher.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
index 6943d89297..6620c23dc6 100644
--- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp
+++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
@@ -25,6 +25,7 @@
#include "backends/cloud/onedrive/onedrivestorage.h"
#include "backends/networking/curl/connectionmanager.h"
#include "backends/networking/curl/curljsonrequest.h"
+#include "backends/networking/curl/networkreadstream.h"
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/json.h"
@@ -56,6 +57,17 @@ void OneDriveTokenRefresher::innerRequestCallback(Networking::JsonResponse pair)
Common::JSONObject result = pair.value->asObject();
if (result.contains("error")) {
//new token needed => request token & then retry original request
+ CurlJsonRequest *streamRequest = (CurlJsonRequest *)pair.request;
+ if (streamRequest) {
+ const Networking::NetworkReadStream *stream = streamRequest->getNetworkReadStream();
+ if (stream) {
+ debug("code %ld", stream->httpResponseCode());
+ }
+ }
+
+ Common::JSONObject error = result.getVal("error")->asObject();
+ debug("code = %s", error.getVal("code")->asString().c_str());
+ debug("message = %s", error.getVal("message")->asString().c_str());
if (pair.request) pair.request->pause();
_retryRequest = pair.request;
delete pair.value;