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:
parent
eda575a660
commit
62ccf1f902
10 changed files with 117 additions and 21 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue