summaryrefslogtreecommitdiff
path: root/src/HttpRequest.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-11-05 12:30:22 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-11-05 12:30:22 +0000
commit93a49e484065d47b5d8426ab3c5a5f12ec8899d4 (patch)
tree4d1e0eb211d549393551cc8579a2b3aa0bf2f762 /src/HttpRequest.cc
parent4797b0e72dc8de97a04670f66a98a249065052fc (diff)
2008-11-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to pool proxy connection. The conneciton in FTP with proxy-method=GET is not pooled. Proxy-Connection header will not be sent when sending CONNECT method. * src/DownloadEngine.cc * src/DownloadEngine.h * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/HttpDownloadCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpSkipResponseCommand.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc
Diffstat (limited to 'src/HttpRequest.cc')
-rw-r--r--src/HttpRequest.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc
index 2b80adaf..0a0656f5 100644
--- a/src/HttpRequest.cc
+++ b/src/HttpRequest.cc
@@ -245,11 +245,12 @@ std::string HttpRequest::createProxyRequest() const
std::string(" HTTP/1.1\r\n")+
"User-Agent: "+userAgent+"\r\n"+
"Host: "+getHost()+":"+Util::uitos(getPort())+"\r\n";
- if(request->isKeepAliveEnabled() || request->isPipeliningEnabled()) {
- requestLine += "Proxy-Connection: Keep-Alive\r\n";
- }else {
- requestLine += "Proxy-Connection: close\r\n";
- }
+ // TODO Is "Proxy-Connection" needed here?
+// if(request->isKeepAliveEnabled() || request->isPipeliningEnabled()) {
+// requestLine += "Proxy-Connection: Keep-Alive\r\n";
+// }else {
+// requestLine += "Proxy-Connection: close\r\n";
+// }
if(!_proxyRequest->getUsername().empty()) {
requestLine += getProxyAuthString();
}
@@ -354,4 +355,9 @@ void HttpRequest::setProxyRequest(const SharedHandle<Request>& proxyRequest)
_proxyRequest = proxyRequest;
}
+bool HttpRequest::isProxyRequestSet() const
+{
+ return !_proxyRequest.isNull();
+}
+
} // namespace aria2