mirror of https://github.com/aria2/aria2
2008-05-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Disable http keep-alive if the remote server is not HTTP/1.1. * src/HttpConnection.ccpull/1/head
parent
4f150057ca
commit
e88eedc8f5
|
@ -1,3 +1,8 @@
|
||||||
|
2008-05-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Disable http keep-alive if the remote server is not HTTP/1.1.
|
||||||
|
* src/HttpConnection.cc
|
||||||
|
|
||||||
2008-05-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-05-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Receive content body of 302 response so that the connection can be
|
Receive content body of 302 response so that the connection can be
|
||||||
|
|
|
@ -134,9 +134,12 @@ HttpResponseHandle HttpConnection::receiveResponse()
|
||||||
|
|
||||||
// OK, we got all headers.
|
// OK, we got all headers.
|
||||||
logger->info(MSG_RECEIVE_RESPONSE, cuid, proc->getHeaderString().c_str());
|
logger->info(MSG_RECEIVE_RESPONSE, cuid, proc->getHeaderString().c_str());
|
||||||
|
// Disable persistent connection if:
|
||||||
|
// Connection: close is received or the remote server is not HTTP/1.1.
|
||||||
|
// We don't care whether non-HTTP/1.1 server returns Connection: keep-alive.
|
||||||
SharedHandle<HttpHeader> httpHeader = proc->getHttpResponseHeader();
|
SharedHandle<HttpHeader> httpHeader = proc->getHttpResponseHeader();
|
||||||
if(Util::toLower(httpHeader->getFirst("Connection")).find("close") != std::string::npos) {
|
if(Util::toLower(httpHeader->getFirst("Connection")).find("close") != std::string::npos
|
||||||
|
|| httpHeader->getVersion() != "HTTP/1.1") {
|
||||||
entry->getHttpRequest()->getRequest()->supportsPersistentConnection(false);
|
entry->getHttpRequest()->getRequest()->supportsPersistentConnection(false);
|
||||||
} else {
|
} else {
|
||||||
entry->getHttpRequest()->getRequest()->supportsPersistentConnection(true);
|
entry->getHttpRequest()->getRequest()->supportsPersistentConnection(true);
|
||||||
|
|
Loading…
Reference in New Issue