diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-05-14 14:40:38 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-05-14 14:40:38 +0000 |
| commit | cded0f581114770d4fafa9da68d02b8772ec5267 (patch) | |
| tree | 5077d37a18dd4799e9dab4dcd14b55db6820bdce /src | |
| parent | 12b880a72463dc55a69fb5db1a957a26a734eed9 (diff) | |
2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Defined default ftp user and password as static const
std::string
* src/AuthConfigFactory.cc
* src/AuthConfigFactory.h
Diffstat (limited to 'src')
| -rw-r--r-- | src/AuthConfigFactory.cc | 8 | ||||
| -rw-r--r-- | src/AuthConfigFactory.h | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/AuthConfigFactory.cc b/src/AuthConfigFactory.cc index 7be0e1ae..9291e442 100644 --- a/src/AuthConfigFactory.cc +++ b/src/AuthConfigFactory.cc @@ -43,6 +43,10 @@ namespace aria2 { +const std::string AuthConfigFactory::ANONYMOUS("anonymous"); + +const std::string AuthConfigFactory::ARIA2USER_AT("ARIA2USER@"); + AuthConfigFactory::AuthConfigFactory(const Option* option): _option(option) {} @@ -106,7 +110,9 @@ AuthResolverHandle AuthConfigFactory::createFtpAuthResolver() const resolver = authResolver; } resolver->setUserDefinedAuthConfig(createAuthConfig(_option->get(PREF_FTP_USER), _option->get(PREF_FTP_PASSWD))); - SharedHandle<AuthConfig> defaultAuthConfig(new AuthConfig("anonymous", "ARIA2USER@")); + SharedHandle<AuthConfig> defaultAuthConfig + (new AuthConfig(AuthConfigFactory::ANONYMOUS, + AuthConfigFactory::ARIA2USER_AT)); resolver->setDefaultAuthConfig(defaultAuthConfig); return resolver; } diff --git a/src/AuthConfigFactory.h b/src/AuthConfigFactory.h index 44aa3dc0..6635c610 100644 --- a/src/AuthConfigFactory.h +++ b/src/AuthConfigFactory.h @@ -73,6 +73,10 @@ public: SharedHandle<AuthConfig> createAuthConfigForHttpProxy(const SharedHandle<Request>& request) const; void setNetrc(const SharedHandle<Netrc>& netrc); + + static const std::string ANONYMOUS; + + static const std::string ARIA2USER_AT; }; typedef SharedHandle<AuthConfigFactory> AuthConfigFactoryHandle; |
