diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-11-03 10:06:25 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-11-03 10:06:25 +0000 |
| commit | 8fab0ff2160399487fb0010d3b0c8b431dfe545f (patch) | |
| tree | dd0e1fbe1b28176773dccc0fd71bbed77fdf89fb /src/HttpRequest.cc | |
| parent | e6707208d1821d043b8d2b01551b5424a0768cd8 (diff) | |
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
AuthConfigFactory is now part of DownloadEngine.
* src/AbstractProxyRequestCommand.cc
* src/AuthConfigFactory.h
* src/DownloadEngine.cc
* src/DownloadEngine.h
* src/FtpConnection.cc
* src/FtpConnection.h
* src/FtpNegotiationCommand.cc
* src/HttpConnection.cc
* src/HttpRequest.cc
* src/HttpRequest.h
* src/HttpRequestCommand.cc
* src/HttpResponse.cc
* src/HttpResponseCommand.cc
* src/HttpSkipResponseCommand.cc
* src/MultiUrlRequestInfo.cc
* src/main.cc
* test/FtpConnectionTest.cc
* test/HttpRequestTest.cc
* test/HttpResponseTest.cc
Diffstat (limited to 'src/HttpRequest.cc')
| -rw-r--r-- | src/HttpRequest.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index a5dd0e59..9dd8e976 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -33,6 +33,10 @@ */ /* copyright --> */ #include "HttpRequest.h" + +#include <cassert> +#include <numeric> + #include "Request.h" #include "Segment.h" #include "Range.h" @@ -45,8 +49,6 @@ #include "AuthConfig.h" #include "a2functional.h" #include "TimeA2.h" -#include <numeric> -#include <cassert> namespace aria2 { @@ -134,9 +136,8 @@ std::string HttpRequest::getHostText(const std::string& host, uint16_t port) con std::string HttpRequest::createRequest() const { - SharedHandle<AuthConfig> authConfig = AuthConfigFactorySingleton::instance() - ->createAuthConfig(request); - + SharedHandle<AuthConfig> authConfig = + _authConfigFactory->createAuthConfig(request); std::string requestLine = "GET "; if(getProtocol() == Request::PROTO_FTP || proxyEnabled) { if(getProtocol() == Request::PROTO_FTP && @@ -257,9 +258,11 @@ std::string HttpRequest::createProxyRequest() const return requestLine; } -std::string HttpRequest::getProxyAuthString() const { +std::string HttpRequest::getProxyAuthString() const +{ return "Proxy-Authorization: Basic "+ - Base64::encode(AuthConfigFactorySingleton::instance()->createAuthConfigForHttpProxy(request)->getAuthText())+"\r\n"; + Base64::encode(_authConfigFactory->createAuthConfigForHttpProxy(request)-> + getAuthText())+"\r\n"; } void HttpRequest::enableContentEncoding() @@ -348,4 +351,10 @@ SharedHandle<CookieStorage> HttpRequest::getCookieStorage() const return _cookieStorage; } +void HttpRequest::setAuthConfigFactory +(const SharedHandle<AuthConfigFactory>& factory) +{ + _authConfigFactory = factory; +} + } // namespace aria2 |
