mirror of https://github.com/aria2/aria2
2009-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that when downloading more than one torrent, listening port is not reported properly to tracker for 2nd or later torrents. * src/BtSetup.cc * src/PeerListenCommand.cc * src/PeerListenCommand.h * src/RequestGroup.ccpull/1/head
parent
b63cd3a82a
commit
a71b642db1
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2009-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Fixed the bug that when downloading more than one torrent,
|
||||||
|
listening port is not reported properly to tracker for 2nd or
|
||||||
|
later torrents.
|
||||||
|
* src/BtSetup.cc
|
||||||
|
* src/PeerListenCommand.cc
|
||||||
|
* src/PeerListenCommand.h
|
||||||
|
* src/RequestGroup.cc
|
||||||
|
|
||||||
2009-10-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-10-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Bump up version number to 1.6.3
|
Bump up version number to 1.6.3
|
||||||
|
|
|
@ -158,6 +158,9 @@ void BtSetup::setup(std::deque<Command*>& commands,
|
||||||
_logger->error(_("Errors occurred while binding port.\n"));
|
_logger->error(_("Errors occurred while binding port.\n"));
|
||||||
delete listenCommand;
|
delete listenCommand;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
PeerListenCommand* listenCommand = PeerListenCommand::getInstance(e);
|
||||||
|
btRuntime->setListenPort(listenCommand->getPort());
|
||||||
}
|
}
|
||||||
time_t btStopTimeout = option->getAsInt(PREF_BT_STOP_TIMEOUT);
|
time_t btStopTimeout = option->getAsInt(PREF_BT_STOP_TIMEOUT);
|
||||||
if(btStopTimeout > 0) {
|
if(btStopTimeout > 0) {
|
||||||
|
|
|
@ -96,6 +96,17 @@ bool PeerListenCommand::bindPort(uint16_t& port, IntSequence& seq)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t PeerListenCommand::getPort() const
|
||||||
|
{
|
||||||
|
if(socket.isNull()) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
std::pair<std::string, uint16_t> addr;
|
||||||
|
socket->getAddrInfo(addr);
|
||||||
|
return addr.second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool PeerListenCommand::execute() {
|
bool PeerListenCommand::execute() {
|
||||||
if(e->isHaltRequested() || e->_requestGroupMan->downloadFinished()) {
|
if(e->isHaltRequested() || e->_requestGroupMan->downloadFinished()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -67,6 +67,9 @@ public:
|
||||||
*/
|
*/
|
||||||
bool bindPort(uint16_t& port, IntSequence& seq);
|
bool bindPort(uint16_t& port, IntSequence& seq);
|
||||||
|
|
||||||
|
// Returns binded port
|
||||||
|
uint16_t getPort() const;
|
||||||
|
|
||||||
void setLowestSpeedLimit(unsigned int speed)
|
void setLowestSpeedLimit(unsigned int speed)
|
||||||
{
|
{
|
||||||
_lowestSpeedLimit = speed;
|
_lowestSpeedLimit = speed;
|
||||||
|
|
|
@ -233,7 +233,6 @@ void RequestGroup::createInitialCommand(std::deque<Command*>& commands,
|
||||||
_option.get()));
|
_option.get()));
|
||||||
|
|
||||||
BtRuntimeHandle btRuntime(new BtRuntime());
|
BtRuntimeHandle btRuntime(new BtRuntime());
|
||||||
btRuntime->setListenPort(_option->getAsInt(PREF_LISTEN_PORT));
|
|
||||||
btRuntime->setMaxPeers(_option->getAsInt(PREF_BT_MAX_PEERS));
|
btRuntime->setMaxPeers(_option->getAsInt(PREF_BT_MAX_PEERS));
|
||||||
_btRuntime = btRuntime;
|
_btRuntime = btRuntime;
|
||||||
progressInfoFile->setBtRuntime(btRuntime);
|
progressInfoFile->setBtRuntime(btRuntime);
|
||||||
|
|
Loading…
Reference in New Issue