From c0197f10406e9c56989617baceeaeb1a3091d5cb Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 13 Nov 2008 15:39:22 +0000 Subject: [PATCH] 2008-11-14 Tatsuhiro Tsujikawa Avoid slow seeding * src/PeerInteractionCommand.cc --- ChangeLog | 5 +++++ src/PeerInteractionCommand.cc | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d46428aa..bd348e8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-14 Tatsuhiro Tsujikawa + + Avoid slow seeding + * src/PeerInteractionCommand.cc + 2008-11-14 Tatsuhiro Tsujikawa Updated usage for -i option. diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc index 611c7498..186a2960 100644 --- a/src/PeerInteractionCommand.cc +++ b/src/PeerInteractionCommand.cc @@ -249,7 +249,8 @@ bool PeerInteractionCommand::executeInternal() { } case WIRED: // See the comment for writable check below. - // disableWriteCheckSocket(); + disableWriteCheckSocket(); + btInteractive->doInteractionProcessing(); if(btInteractive->countReceivedMessageInIteration() > 0) { updateKeepAlive(); @@ -258,11 +259,10 @@ bool PeerInteractionCommand::executeInternal() { (peer->getLatency() < 1500)) || (peer->peerInterested() && !peer->amChoking())) { - // Writable check causes CPU usage high because socket becomes writable - // instantly. So don't do it. - // if(btInteractive->isSendingMessageInProgress()) { - // setWriteCheckSocket(socket); - // } + // Writable check to avoid slow seeding + if(btInteractive->isSendingMessageInProgress()) { + setWriteCheckSocket(socket); + } if(maxDownloadSpeedLimit > 0) { TransferStat stat = _requestGroup->calculateStat();