diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-03-27 16:16:44 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-03-27 16:16:44 +0000 |
| commit | 6e6ba30c603826718b159cb1c0800b20147c23c7 (patch) | |
| tree | 80e45880d16a2a9eb468b2f673f400cc709f72f7 /test/HttpRequestTest.cc | |
| parent | 9b73454b07dc23e2aaf08baf6eff1643590e30f3 (diff) | |
2007-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To add the command-line option which disables netrc support:
* src/OptionHandlerFactory.cc
(createOptionHandlers): Added PREF_NO_NETRC.
* src/main.cc: Added -n option.
* src/prefs.h (PREF_NO_NETRC): New definition.
* src/RequestFactory.cc: Do not use netrc in ftp if
PREF_NO_NETRC is
V_TRUE.
Note that netrc is not used in http, http proxy even if
PREF_NO_NETRC
is V_FALSE. This may get configurable in the future release.
To clear peer's error status by time basis:
* src/PeerAbstractCommand.cc
(onAbort): Call Peer::startBadCondition().
* src/Peer.h, src/Peer.cc
(error): Removed.
(_badConditionStartTime): New variable.
(_badConditionInterval): New variable. Initialized to 10
seconds.
(startBadCondition): New function.
(isGood): New function.
* src/DefaultPeerStorage.cc
(addPeer): Use Peer::isGood().
(FindFinePeer): Use Peer::isGood().
Always include port number in http request header:
* src/HttpRequest.cc (getHostText): Always include port number
in
http request header.
Diffstat (limited to 'test/HttpRequestTest.cc')
| -rw-r--r-- | test/HttpRequestTest.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/HttpRequestTest.cc b/test/HttpRequestTest.cc index 54ff16a3..288204b1 100644 --- a/test/HttpRequestTest.cc +++ b/test/HttpRequestTest.cc @@ -335,7 +335,7 @@ void HttpRequestTest::testCreateRequest_with_cookie() string expectedText = "GET /archives/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n" "User-Agent: aria2\r\n" "Accept: */*\r\n" - "Host: localhost\r\n" + "Host: localhost:80\r\n" "Pragma: no-cache\r\n" "Cache-Control: no-cache\r\n" "Cookie: name1=value1;\r\n" @@ -348,7 +348,7 @@ void HttpRequestTest::testCreateRequest_with_cookie() expectedText = "GET /archives/download/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n" "User-Agent: aria2\r\n" "Accept: */*\r\n" - "Host: localhost\r\n" + "Host: localhost:80\r\n" "Pragma: no-cache\r\n" "Cache-Control: no-cache\r\n" "Cookie: name1=value1;name2=value2;\r\n" @@ -361,7 +361,7 @@ void HttpRequestTest::testCreateRequest_with_cookie() expectedText = "GET /archives/download/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n" "User-Agent: aria2\r\n" "Accept: */*\r\n" - "Host: tt.localhost\r\n" + "Host: tt.localhost:80\r\n" "Pragma: no-cache\r\n" "Cache-Control: no-cache\r\n" "Cookie: name1=value1;name2=value2;name3=value3;\r\n" @@ -374,7 +374,7 @@ void HttpRequestTest::testCreateRequest_with_cookie() expectedText = "GET /archives/download/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n" "User-Agent: aria2\r\n" "Accept: */*\r\n" - "Host: tt.localhost\r\n" + "Host: tt.localhost:443\r\n" "Pragma: no-cache\r\n" "Cache-Control: no-cache\r\n" "Cookie: name1=value1;name2=value2;name3=value3;name4=value4;\r\n" @@ -387,7 +387,7 @@ void HttpRequestTest::testCreateRequest_with_cookie() void HttpRequestTest::testCreateProxyRequest() { RequestHandle request = new Request(); - request->setUrl("http://localhost:8080/archives/aria2-1.0.0.tar.bz2"); + request->setUrl("http://localhost/archives/aria2-1.0.0.tar.bz2"); SegmentHandle segment = new Segment(); HttpRequest httpRequest; @@ -395,10 +395,10 @@ void HttpRequestTest::testCreateProxyRequest() httpRequest.setRequest(request); httpRequest.setSegment(segment); - string expectedText = "CONNECT localhost:8080 HTTP/1.1\r\n" + string expectedText = "CONNECT localhost:80 HTTP/1.1\r\n" "User-Agent: aria2\r\n" "Proxy-Connection: close\r\n" - "Host: localhost:8080\r\n" + "Host: localhost:80\r\n" "\r\n"; CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createProxyRequest()); |
