From 4ea28cb8377bc7b4654e6ae0216db6a7425d12c9 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 27 Jul 2011 23:28:31 +0900 Subject: Don't send basic auth header to service operated on differenct port. When --http-auth-challenge=true, aria2 only sends basic auth header when requested. Old implementation sends basic auth header to service operated in different port in successive request. This change avoid this bug. --- src/AuthConfigFactory.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/AuthConfigFactory.h') diff --git a/src/AuthConfigFactory.h b/src/AuthConfigFactory.h index 1291b225..8eb70f31 100644 --- a/src/AuthConfigFactory.h +++ b/src/AuthConfigFactory.h @@ -67,11 +67,12 @@ public: std::string user_; std::string password_; std::string host_; + uint16_t port_; std::string path_; bool activated_; BasicCred(const std::string& user, const std::string& password, - const std::string& host, const std::string& path, + const std::string& host, uint16_t port, const std::string& path, bool activated = false); void activate(); @@ -106,12 +107,19 @@ public: // using this AuthConfig object with given host and path "/" and // returns true. bool activateBasicCred - (const std::string& host, const std::string& path, const Option* op); - - // Find a BasicCred using host and path and return the iterator - // pointing to it. If not found, then return basicCreds_.end(). + (const std::string& host, + uint16_t port, + const std::string& path, + const Option* op); + + // Find a BasicCred using host, port and path and return the + // iterator pointing to it. If not found, then return + // basicCreds_.end(). std::deque::iterator - findBasicCred(const std::string& host, const std::string& path); + findBasicCred + (const std::string& host, + uint16_t port, + const std::string& path); // If the same BasicCred is already added, then it is replaced with // given basicCred. Otherwise, insert given basicCred to -- cgit