aboutsummaryrefslogtreecommitdiff
path: root/backends/networking/curl/curlrequest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/networking/curl/curlrequest.cpp')
-rw-r--r--backends/networking/curl/curlrequest.cpp9
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());
}