summaryrefslogtreecommitdiff
path: root/src/Request.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-12-15 15:38:07 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-12-15 15:38:07 +0000
commit5a639a3d1e2af05fcc48f9821be5d6afc1cdef87 (patch)
tree589cacb3587323c01cf6689b0f15cd1ce5775c8b /src/Request.cc
parent110749df84956cf4c9d2c3f2070a64179d7cd5f1 (diff)
2008-12-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that causes corrupted downloads if HTTP pipelining is enabled and the server doesn't support keep-alive. * src/AbstractCommand.cc * src/DownloadCommand.cc * src/HttpDownloadCommand.cc * src/HttpDownloadCommand.h * src/HttpResponseCommand.cc * src/Request.cc * src/Request.h * test/RequestTest.cc
Diffstat (limited to 'src/Request.cc')
-rw-r--r--src/Request.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Request.cc b/src/Request.cc
index 71468312..8827c69e 100644
--- a/src/Request.cc
+++ b/src/Request.cc
@@ -69,6 +69,7 @@ Request::Request():
_supportsPersistentConnection(true),
_keepAliveHint(false),
_pipeliningHint(false),
+ _maxPipelinedRequest(1),
method(METHOD_GET)
{}
@@ -115,12 +116,14 @@ static std::string urlencode(const std::string& src)
}
bool Request::setUrl(const std::string& url) {
+ _supportsPersistentConnection = true;
this->url = url;
return parseUrl(urlencode(removeFragment(url)));
}
bool Request::resetUrl() {
previousUrl = referer;
+ _supportsPersistentConnection = true;
return parseUrl(urlencode(removeFragment(url)));
}
@@ -243,4 +246,19 @@ unsigned int Request::getRedirectCount() const
return _redirectCount;
}
+bool Request::isPipeliningHint() const
+{
+ return _pipeliningHint;
+}
+
+void Request::setMaxPipelinedRequest(unsigned int num)
+{
+ _maxPipelinedRequest = num;
+}
+
+unsigned int Request::getMaxPipelinedRequest() const
+{
+ return _maxPipelinedRequest;
+}
+
} // namespace aria2