summaryrefslogtreecommitdiff
path: root/src/PeerInteractionCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-06-16 16:06:24 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-06-16 16:06:24 +0000
commit067aa16499aede436a739c57ede3e5bd95552717 (patch)
treee7db87ff63e4be9e8f81ee805cc22ca351733bcd /src/PeerInteractionCommand.cc
parent1c2dd30bf74200e1033fcb09ceec22a4e1f34e05 (diff)
2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Moved the call setWriteCheckSocket inside the previous clause to reduce the number of socket to watch out. * src/PeerInteractionCommand.cc
Diffstat (limited to 'src/PeerInteractionCommand.cc')
-rw-r--r--src/PeerInteractionCommand.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc
index 3ca8cc0c..89ef1d0c 100644
--- a/src/PeerInteractionCommand.cc
+++ b/src/PeerInteractionCommand.cc
@@ -230,6 +230,11 @@ bool PeerInteractionCommand::executeInternal() {
}
if((peer->amInterested() && !peer->peerChoking() && (peer->getLatency() < 1500)) ||
(peer->peerInterested() && !peer->amChoking())) {
+
+ if(btInteractive->isSendingMessageInProgress()) {
+ setWriteCheckSocket(socket);
+ }
+
if(maxDownloadSpeedLimit > 0) {
TransferStat stat = peerStorage->calculateStat();
if(maxDownloadSpeedLimit < stat.downloadSpeed) {
@@ -244,9 +249,6 @@ bool PeerInteractionCommand::executeInternal() {
} else {
disableReadCheckSocket();
}
- if(btInteractive->isSendingMessageInProgress()) {
- setWriteCheckSocket(socket);
- }
break;
}
if(btInteractive->countPendingMessage() > 0) {