2010-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

In .netrc file, if machine name starts ".", aria2 performs domain
	match instead of exact match. This is an extension of aria2.
	* src/Netrc.h
pull/1/head
Tatsuhiro Tsujikawa 2010-08-31 11:53:48 +00:00
parent 5cb09dabf5
commit f9d68a4ecf
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2010-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
In .netrc file, if machine name starts ".", aria2 performs domain
match instead of exact match. This is an extension of aria2.
* src/Netrc.h
2010-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug which prevents HTTP redirection from working when

View File

@ -43,6 +43,7 @@
#include "SharedHandle.h"
#include "A2STR.h"
#include "util.h"
namespace aria2 {
@ -75,7 +76,15 @@ public:
virtual bool match(const std::string& hostname) const
{
return hostname == machine_;
if(util::isNumericHost(hostname)) {
return hostname == machine_;
} else {
if(util::startsWith(machine_, A2STR::DOT_C)) {
return util::endsWith(A2STR::DOT_C+hostname, machine_);
} else {
return hostname == machine_;
}
}
}
const std::string& getMachine() const