diff options
author | Alexander Tkachev | 2016-05-27 17:50:27 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 1348befe297d32de9bf40f89f37bcbae2c91d81f (patch) | |
tree | 57f62e24c9c9f9e6f7b21292368c39312f13cfd3 /backends/networking/curl | |
parent | baf37b9330ee96ca04fe742dc923d9fddfcf4c20 (diff) | |
download | scummvm-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/networking/curl')
-rw-r--r-- | backends/networking/curl/curlrequest.h | 3 | ||||
-rw-r--r-- | backends/networking/curl/networkreadstream.cpp | 2 | ||||
-rw-r--r-- | backends/networking/curl/networkreadstream.h | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/backends/networking/curl/curlrequest.h b/backends/networking/curl/curlrequest.h index 5677720b1d..f77dce92c0 100644 --- a/backends/networking/curl/curlrequest.h +++ b/backends/networking/curl/curlrequest.h @@ -64,6 +64,9 @@ public: * @return its NetworkReadStream in NetworkReadStreamResponse. */ virtual NetworkReadStreamResponse execute(); + + /** Returns Request's NetworkReadStream. */ + const NetworkReadStream *getNetworkReadStream() const { return _stream; } }; } //end of namespace Networking diff --git a/backends/networking/curl/networkreadstream.cpp b/backends/networking/curl/networkreadstream.cpp index 39316deb7c..8658fc7d17 100644 --- a/backends/networking/curl/networkreadstream.cpp +++ b/backends/networking/curl/networkreadstream.cpp @@ -78,7 +78,7 @@ void NetworkReadStream::finished() { _requestComplete = true; } -long NetworkReadStream::httpResponseCode() { +long NetworkReadStream::httpResponseCode() const { long responseCode = -1; if (_easy) curl_easy_getinfo(_easy, CURLINFO_RESPONSE_CODE, &responseCode); diff --git a/backends/networking/curl/networkreadstream.h b/backends/networking/curl/networkreadstream.h index a0c87460cb..14c00a4baa 100644 --- a/backends/networking/curl/networkreadstream.h +++ b/backends/networking/curl/networkreadstream.h @@ -80,7 +80,7 @@ public: * * @note This method should be called when eos() == true. */ - long httpResponseCode(); + long httpResponseCode() const; }; } //end of namespace Networking |