diff --git a/ChangeLog b/ChangeLog index 826a4cfd..c6a849ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-01 Tatsuhiro Tsujikawa + + Removed writable check when socket's send buffer is full in BitTorrent + downloads to lower CPU usage. + * src/PeerInteractionCommand.cc + 2008-07-31 Tatsuhiro Tsujikawa Fixed broken gzip inflation. diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc index 89ef1d0c..c098b41e 100644 --- a/src/PeerInteractionCommand.cc +++ b/src/PeerInteractionCommand.cc @@ -223,7 +223,8 @@ bool PeerInteractionCommand::executeInternal() { break; } case WIRED: - disableWriteCheckSocket(); + // See the comment for writable check below. + // disableWriteCheckSocket(); btInteractive->doInteractionProcessing(); if(btInteractive->countReceivedMessageInIteration() > 0) { updateKeepAlive(); @@ -231,9 +232,11 @@ bool PeerInteractionCommand::executeInternal() { if((peer->amInterested() && !peer->peerChoking() && (peer->getLatency() < 1500)) || (peer->peerInterested() && !peer->amChoking())) { - if(btInteractive->isSendingMessageInProgress()) { - setWriteCheckSocket(socket); - } + // Writable check causes CPU usage high because socket becomes writable + // instantly. So don't do it. + // if(btInteractive->isSendingMessageInProgress()) { + // setWriteCheckSocket(socket); + // } if(maxDownloadSpeedLimit > 0) { TransferStat stat = peerStorage->calculateStat();