2008-08-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Removed writable check when socket's send buffer is full in 
BitTorrent
	downloads to lower CPU usage.
	* src/PeerInteractionCommand.cc
This commit is contained in:
Tatsuhiro Tsujikawa 2008-07-31 15:25:23 +00:00
parent d3f05f44b7
commit dfe3b9bf15
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2008-08-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
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 <tujikawa at rednoah dot com>
Fixed broken gzip inflation.

View File

@ -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();