mirror of https://github.com/aria2/aria2
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.hpull/1/head
parent
5cb09dabf5
commit
f9d68a4ecf
|
@ -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>
|
2010-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Fixed the bug which prevents HTTP redirection from working when
|
Fixed the bug which prevents HTTP redirection from working when
|
||||||
|
|
11
src/Netrc.h
11
src/Netrc.h
|
@ -43,6 +43,7 @@
|
||||||
|
|
||||||
#include "SharedHandle.h"
|
#include "SharedHandle.h"
|
||||||
#include "A2STR.h"
|
#include "A2STR.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -75,7 +76,15 @@ public:
|
||||||
|
|
||||||
virtual bool match(const std::string& hostname) const
|
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
|
const std::string& getMachine() const
|
||||||
|
|
Loading…
Reference in New Issue