summaryrefslogtreecommitdiff
path: root/src/AuthConfigFactory.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-05-13 14:15:23 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-05-13 14:15:23 +0000
commit386d19693bc3b06bea14f8fa606f513b6fe1ac9d (patch)
tree0137a837f6ce609ac1319b859a5333e0753f7527 /src/AuthConfigFactory.cc
parent9d03f0d2f747c7c66a64081a7cabcf4e02c11020 (diff)
2008-05-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Replaced "" with static const variable A2STR::NIL. Replaced string comparison against "" with std::string::empty(). Added PROTO_* to Request class and use them as a protocol string constant. Made "started", "stopped", "completed" static const variable in AnnounceList class.
Diffstat (limited to 'src/AuthConfigFactory.cc')
-rw-r--r--src/AuthConfigFactory.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/AuthConfigFactory.cc b/src/AuthConfigFactory.cc
index b41821f8..7be0e1ae 100644
--- a/src/AuthConfigFactory.cc
+++ b/src/AuthConfigFactory.cc
@@ -51,9 +51,10 @@ AuthConfigFactory::~AuthConfigFactory() {}
AuthConfigHandle
AuthConfigFactory::createAuthConfig(const RequestHandle& request) const
{
- if(request->getProtocol() == "http" || request->getProtocol() == "https") {
+ if(request->getProtocol() == Request::PROTO_HTTP ||
+ request->getProtocol() == Request::PROTO_HTTPS) {
return createHttpAuthResolver()->resolveAuthConfig(request->getHost());
- } else if(request->getProtocol() == "ftp") {
+ } else if(request->getProtocol() == Request::PROTO_FTP) {
if(!request->getUsername().empty()) {
return createAuthConfig(request->getUsername(), request->getPassword());
} else {