mirror of https://github.com/aria2/aria2
Enable write socket check when there is pending messages to send
parent
93bd6cfbb8
commit
5ec84f9eae
|
@ -340,19 +340,11 @@ bool PeerInteractionCommand::executeInternal()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WIRED:
|
case WIRED:
|
||||||
// See the comment for writable check below.
|
|
||||||
disableWriteCheckSocket();
|
|
||||||
|
|
||||||
btInteractive_->doInteractionProcessing();
|
btInteractive_->doInteractionProcessing();
|
||||||
if (btInteractive_->countReceivedMessageInIteration() > 0) {
|
if (btInteractive_->countReceivedMessageInIteration() > 0) {
|
||||||
updateKeepAlive();
|
updateKeepAlive();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Writable check to avoid slow seeding
|
|
||||||
if (btInteractive_->isSendingMessageInProgress()) {
|
|
||||||
setWriteCheckSocket(getSocket());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getDownloadEngine()
|
if (getDownloadEngine()
|
||||||
->getRequestGroupMan()
|
->getRequestGroupMan()
|
||||||
->doesOverallDownloadSpeedExceed() ||
|
->doesOverallDownloadSpeedExceed() ||
|
||||||
|
@ -368,9 +360,14 @@ bool PeerInteractionCommand::executeInternal()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (btInteractive_->countPendingMessage() > 0) {
|
if (btInteractive_->countPendingMessage() > 0 ||
|
||||||
setNoCheck(true);
|
btInteractive_->isSendingMessageInProgress()) {
|
||||||
|
setWriteCheckSocket(getSocket());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
disableWriteCheckSocket();
|
||||||
|
}
|
||||||
|
|
||||||
addCommandSelf();
|
addCommandSelf();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue