summaryrefslogtreecommitdiff
path: root/src/HttpRequestCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-01 13:46:03 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-01 13:46:03 +0000
commit398d53f5f5073d6bc7d4ac788ea202281f766524 (patch)
treec28aed260915c3a06d0ec90912888bcff769b4d5 /src/HttpRequestCommand.cc
parentf670cdbba906c0d7a014e7d86026cb408b7eda30 (diff)
2008-09-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use CookieStorage class instead of CookieBox class. Now CookieStorage accepts cookies from numeric host such as 192.168.1.1. * src/AbstractProxyRequestCommand.cc * src/CookieStorage.cc * src/DownloadEngine.cc * src/DownloadEngine.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/Makefile.am * src/MultiUrlRequestInfo.cc * src/Request.cc * src/Request.h * src/main.cc * test/AllTest.cc * test/CookieStorageTest.cc * test/CookieTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc * test/Makefile.am * test/NsCookieParserTest.cc * test/Sqlite3MozCookieParserTest.cc * test/nscookietest.txt
Diffstat (limited to 'src/HttpRequestCommand.cc')
-rw-r--r--src/HttpRequestCommand.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc
index 2e4707c5..3f8a3e65 100644
--- a/src/HttpRequestCommand.cc
+++ b/src/HttpRequestCommand.cc
@@ -46,6 +46,7 @@
#include "prefs.h"
#include "a2functional.h"
#include "Util.h"
+#include "CookieStorage.h"
#include <algorithm>
namespace aria2 {
@@ -71,7 +72,8 @@ createHttpRequest(const SharedHandle<Request>& req,
const SharedHandle<Segment>& segment,
uint64_t totalLength,
const Option* option,
- const RequestGroup* rg)
+ const RequestGroup* rg,
+ const SharedHandle<CookieStorage>& cookieStorage)
{
HttpRequestHandle httpRequest(new HttpRequest());
httpRequest->setUserAgent(option->get(PREF_USER_AGENT));
@@ -79,6 +81,7 @@ createHttpRequest(const SharedHandle<Request>& req,
httpRequest->setSegment(segment);
httpRequest->setEntityLength(totalLength);
httpRequest->addHeader(option->get(PREF_HEADER));
+ httpRequest->setCookieStorage(cookieStorage);
if(!rg->getAcceptFeatures().empty()) {
const std::deque<std::string>& acceptFeatures = rg->getAcceptFeatures();
std::string acceptFeaturesHeader = "Accept-Features: ";
@@ -103,7 +106,8 @@ bool HttpRequestCommand::executeInternal() {
HttpRequestHandle httpRequest
(createHttpRequest(req, SharedHandle<Segment>(),
_requestGroup->getTotalLength(), e->option,
- _requestGroup));
+ _requestGroup,
+ e->getCookieStorage()));
_httpConnection->sendRequest(httpRequest);
} else {
for(Segments::iterator itr = _segments.begin(); itr != _segments.end(); ++itr) {
@@ -112,7 +116,8 @@ bool HttpRequestCommand::executeInternal() {
HttpRequestHandle httpRequest
(createHttpRequest(req, segment,
_requestGroup->getTotalLength(), e->option,
- _requestGroup));
+ _requestGroup,
+ e->getCookieStorage()));
_httpConnection->sendRequest(httpRequest);
}
}