diff options
| author | Alexander Tkachev | 2016-05-26 17:56:13 +0600 |
|---|---|---|
| committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
| commit | 62ccf1f902100febfb1be02b67e84a6e4938ebbf (patch) | |
| tree | 1f86b079605ac27d897ae9fc3f9e6cc84e8bf205 /backends/networking/curl/curlrequest.cpp | |
| parent | eda575a660543884b1a4addd21b676a67d2c2a31 (diff) | |
| download | scummvm-rg350-62ccf1f902100febfb1be02b67e84a6e4938ebbf.tar.gz scummvm-rg350-62ccf1f902100febfb1be02b67e84a6e4938ebbf.tar.bz2 scummvm-rg350-62ccf1f902100febfb1be02b67e84a6e4938ebbf.zip | |
CLOUD: Add RequestInfo struct
ConnectionManager upgrade: it now contains a special struct for each
request, so you can access request status and data by request id.
Diffstat (limited to 'backends/networking/curl/curlrequest.cpp')
| -rw-r--r-- | backends/networking/curl/curlrequest.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/backends/networking/curl/curlrequest.cpp b/backends/networking/curl/curlrequest.cpp index e13adaca59..e1c8f2b18c 100644 --- a/backends/networking/curl/curlrequest.cpp +++ b/backends/networking/curl/curlrequest.cpp @@ -42,13 +42,20 @@ bool CurlRequest::handle() { if (_stream && _stream->eos()) { if (_stream->httpResponseCode() != 200) - warning("HTTP response code is not 200 OK (it's %ld)", _stream->httpResponseCode()); + warning("HTTP response code is not 200 OK (it's %ld)", _stream->httpResponseCode()); + ConnMan.getRequestInfo(_id).state = Networking::FINISHED; return true; } return false; } +void CurlRequest::restart() { + if (_stream) delete _stream; + _stream = 0; + //with no stream available next handle() will create another one +} + void CurlRequest::addHeader(Common::String header) { _headersList = curl_slist_append(_headersList, header.c_str()); } |
