mirror of https://github.com/aria2/aria2
2010-08-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't listen on IPv6 socket for BitTorrent, DHT, XML-RPC if --disable-ipv6 is true. * src/BtSetup.cc * src/DownloadEngineFactory.cc * src/RequestGroup.ccpull/1/head
parent
5bcc0ba60a
commit
b9522dea25
|
@ -1,3 +1,11 @@
|
||||||
|
2010-08-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Don't listen on IPv6 socket for BitTorrent, DHT, XML-RPC if
|
||||||
|
--disable-ipv6 is true.
|
||||||
|
* src/BtSetup.cc
|
||||||
|
* src/DownloadEngineFactory.cc
|
||||||
|
* src/RequestGroup.cc
|
||||||
|
|
||||||
2010-08-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-08-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Removed unused debug log.
|
Removed unused debug log.
|
||||||
|
|
|
@ -185,7 +185,8 @@ void BtSetup::setup(std::vector<Command*>& commands,
|
||||||
}
|
}
|
||||||
if(PeerListenCommand::getNumInstance() == 0) {
|
if(PeerListenCommand::getNumInstance() == 0) {
|
||||||
static int families[] = { AF_INET, AF_INET6 };
|
static int families[] = { AF_INET, AF_INET6 };
|
||||||
for(size_t i = 0; i < A2_ARRAY_LEN(families); ++i) {
|
size_t familiesLength = e->getOption()->getAsBool(PREF_DISABLE_IPV6)?1:2;
|
||||||
|
for(size_t i = 0; i < familiesLength; ++i) {
|
||||||
PeerListenCommand* listenCommand =
|
PeerListenCommand* listenCommand =
|
||||||
PeerListenCommand::getInstance(e, families[i]);
|
PeerListenCommand::getInstance(e, families[i]);
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
|
@ -171,7 +171,8 @@ DownloadEngineFactory::newDownloadEngine
|
||||||
#ifdef ENABLE_XML_RPC
|
#ifdef ENABLE_XML_RPC
|
||||||
if(op->getAsBool(PREF_ENABLE_XML_RPC)) {
|
if(op->getAsBool(PREF_ENABLE_XML_RPC)) {
|
||||||
static int families[] = { AF_INET, AF_INET6 };
|
static int families[] = { AF_INET, AF_INET6 };
|
||||||
for(size_t i = 0; i < A2_ARRAY_LEN(families); ++i) {
|
size_t familiesLength = op->getAsBool(PREF_DISABLE_IPV6)?1:2;
|
||||||
|
for(size_t i = 0; i < familiesLength; ++i) {
|
||||||
HttpListenCommand* httpListenCommand =
|
HttpListenCommand* httpListenCommand =
|
||||||
new HttpListenCommand(e->newCUID(), e.get(), families[i]);
|
new HttpListenCommand(e->newCUID(), e.get(), families[i]);
|
||||||
if(httpListenCommand->bindPort(op->getAsInt(PREF_XML_RPC_LISTEN_PORT))){
|
if(httpListenCommand->bindPort(op->getAsInt(PREF_XML_RPC_LISTEN_PORT))){
|
||||||
|
|
|
@ -293,13 +293,15 @@ void RequestGroup::createInitialCommand
|
||||||
(progressInfoFile))));
|
(progressInfoFile))));
|
||||||
if(metadataGetMode) {
|
if(metadataGetMode) {
|
||||||
if(option_->getAsBool(PREF_ENABLE_DHT) ||
|
if(option_->getAsBool(PREF_ENABLE_DHT) ||
|
||||||
option_->getAsBool(PREF_ENABLE_DHT6)) {
|
(!e->getOption()->getAsBool(PREF_DISABLE_IPV6) &&
|
||||||
|
option_->getAsBool(PREF_ENABLE_DHT6))) {
|
||||||
if(option_->getAsBool(PREF_ENABLE_DHT)) {
|
if(option_->getAsBool(PREF_ENABLE_DHT)) {
|
||||||
std::vector<Command*> dhtCommands;
|
std::vector<Command*> dhtCommands;
|
||||||
DHTSetup().setup(dhtCommands, e, AF_INET);
|
DHTSetup().setup(dhtCommands, e, AF_INET);
|
||||||
e->addCommand(dhtCommands);
|
e->addCommand(dhtCommands);
|
||||||
}
|
}
|
||||||
if(option_->getAsBool(PREF_ENABLE_DHT6)) {
|
if(!e->getOption()->getAsBool(PREF_DISABLE_IPV6) &&
|
||||||
|
option_->getAsBool(PREF_ENABLE_DHT6)) {
|
||||||
std::vector<Command*> dhtCommands;
|
std::vector<Command*> dhtCommands;
|
||||||
DHTSetup().setup(dhtCommands, e, AF_INET6);
|
DHTSetup().setup(dhtCommands, e, AF_INET6);
|
||||||
e->addCommand(dhtCommands);
|
e->addCommand(dhtCommands);
|
||||||
|
@ -362,13 +364,15 @@ void RequestGroup::createInitialCommand
|
||||||
|
|
||||||
if(!torrentAttrs->privateTorrent &&
|
if(!torrentAttrs->privateTorrent &&
|
||||||
(option_->getAsBool(PREF_ENABLE_DHT) ||
|
(option_->getAsBool(PREF_ENABLE_DHT) ||
|
||||||
option_->getAsBool(PREF_ENABLE_DHT6))) {
|
(!e->getOption()->getAsBool(PREF_DISABLE_IPV6) &&
|
||||||
|
option_->getAsBool(PREF_ENABLE_DHT6)))) {
|
||||||
if(option_->getAsBool(PREF_ENABLE_DHT)) {
|
if(option_->getAsBool(PREF_ENABLE_DHT)) {
|
||||||
std::vector<Command*> dhtCommands;
|
std::vector<Command*> dhtCommands;
|
||||||
DHTSetup().setup(dhtCommands, e, AF_INET);
|
DHTSetup().setup(dhtCommands, e, AF_INET);
|
||||||
e->addCommand(dhtCommands);
|
e->addCommand(dhtCommands);
|
||||||
}
|
}
|
||||||
if(option_->getAsBool(PREF_ENABLE_DHT6)) {
|
if(!e->getOption()->getAsBool(PREF_DISABLE_IPV6) &&
|
||||||
|
option_->getAsBool(PREF_ENABLE_DHT6)) {
|
||||||
std::vector<Command*> dhtCommands;
|
std::vector<Command*> dhtCommands;
|
||||||
DHTSetup().setup(dhtCommands, e, AF_INET6);
|
DHTSetup().setup(dhtCommands, e, AF_INET6);
|
||||||
e->addCommand(dhtCommands);
|
e->addCommand(dhtCommands);
|
||||||
|
|
Loading…
Reference in New Issue