From c1dd780b9547886f30fe489931aedcaef79ce335 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 28 Sep 2008 11:13:20 +0000 Subject: [PATCH] 2008-09-28 Tatsuhiro Tsujikawa Made a socket of incoming peer non-blocking. * src/PeerListenCommand.cc --- ChangeLog | 5 +++++ src/PeerListenCommand.cc | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4930d4a0..7cd34e46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-28 Tatsuhiro Tsujikawa + + Made a socket of incoming peer non-blocking. + * src/PeerListenCommand.cc + 2008-09-28 Tatsuhiro Tsujikawa Fixed the bug that aria2 may send duplicate data to BitTorrent peer if diff --git a/src/PeerListenCommand.cc b/src/PeerListenCommand.cc index 15df4703..ab2fab23 100644 --- a/src/PeerListenCommand.cc +++ b/src/PeerListenCommand.cc @@ -97,9 +97,7 @@ bool PeerListenCommand::execute() { std::pair peerInfo; peerSocket->getPeerInfo(peerInfo); - // Since peerSocket may be in non-blocking mode, make it blocking mode - // here. - //peerSocket->setBlockingMode(); + peerSocket->setNonBlockingMode(); PeerHandle peer(new Peer(peerInfo.first, peerInfo.second, true)); int32_t cuid = CUIDCounterSingletonHolder::instance()->newID();