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.
This commit is contained in:
Alexander Tkachev 2016-05-26 17:56:13 +06:00
parent eda575a660
commit 62ccf1f902
10 changed files with 117 additions and 21 deletions

View file

@ -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());
}