From 550ac8c074c809865b349aba26080f68e3301696 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 25 Jan 2013 00:01:43 +0900 Subject: [PATCH] Fix bug returnPeer is not called if sequence_ == INITIATOR_SEND_KEY In InitiatorMSEHandshakeCommand, when aborting connection, we must return peer to the PeerStorage. But it is not done if sequence_ is INITIATOR_SEND_KEY. This causes stale Peer objects whose usedBy() returns true eventually occupies peer list and aria2 cannot make any connections. --- src/InitiatorMSEHandshakeCommand.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/InitiatorMSEHandshakeCommand.cc b/src/InitiatorMSEHandshakeCommand.cc index a967ba59..bc516473 100644 --- a/src/InitiatorMSEHandshakeCommand.cc +++ b/src/InitiatorMSEHandshakeCommand.cc @@ -238,7 +238,8 @@ bool InitiatorMSEHandshakeCommand::prepareForNextPeer(time_t wait) void InitiatorMSEHandshakeCommand::onAbort() { - if(getOption()->getAsBool(PREF_BT_REQUIRE_CRYPTO)) { + if(sequence_ == INITIATOR_SEND_KEY || + getOption()->getAsBool(PREF_BT_REQUIRE_CRYPTO)) { peerStorage_->returnPeer(getPeer()); } }