mirror of https://github.com/aria2/aria2
Fix segmentaion fault
parent
f022402dc9
commit
f2d85c38cc
|
@ -63,8 +63,8 @@ namespace aria2 {
|
||||||
|
|
||||||
HttpRequestEntry::HttpRequestEntry
|
HttpRequestEntry::HttpRequestEntry
|
||||||
(const std::shared_ptr<HttpRequest>& httpRequest)
|
(const std::shared_ptr<HttpRequest>& httpRequest)
|
||||||
: httpRequest_(httpRequest),
|
: httpRequest_{httpRequest},
|
||||||
proc_(new HttpHeaderProcessor(HttpHeaderProcessor::CLIENT_PARSER))
|
proc_{make_unique<HttpHeaderProcessor>(HttpHeaderProcessor::CLIENT_PARSER)}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
HttpRequestEntry::~HttpRequestEntry() {}
|
HttpRequestEntry::~HttpRequestEntry() {}
|
||||||
|
@ -152,9 +152,11 @@ std::shared_ptr<HttpResponse> HttpConnection::receiveResponse()
|
||||||
httpResponse->setHttpHeader(proc->getResult());
|
httpResponse->setHttpHeader(proc->getResult());
|
||||||
httpResponse->setHttpRequest(outstandingHttpRequests_.front()->
|
httpResponse->setHttpRequest(outstandingHttpRequests_.front()->
|
||||||
getHttpRequest());
|
getHttpRequest());
|
||||||
outstandingHttpRequests_.pop_front();
|
|
||||||
}
|
|
||||||
socketRecvBuffer_->shiftBuffer(proc->getLastBytesProcessed());
|
socketRecvBuffer_->shiftBuffer(proc->getLastBytesProcessed());
|
||||||
|
outstandingHttpRequests_.pop_front();
|
||||||
|
} else {
|
||||||
|
socketRecvBuffer_->shiftBuffer(proc->getLastBytesProcessed());
|
||||||
|
}
|
||||||
return httpResponse;
|
return httpResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue