Decide interest and choking after receiving messages

pull/709/head
Tatsuhiro Tsujikawa 2016-07-10 00:04:42 +09:00
parent c4cf8fa61d
commit 4d27668d7c
1 changed files with 4 additions and 4 deletions

View File

@ -563,17 +563,17 @@ void DefaultBtInteractive::doInteractionProcessing()
} }
else { else {
checkActiveInteraction(); checkActiveInteraction();
decideChoking();
detectMessageFlooding();
if (perSecTimer_.difference(global::wallclock()) >= 1_s) { if (perSecTimer_.difference(global::wallclock()) >= 1_s) {
perSecTimer_ = global::wallclock(); perSecTimer_ = global::wallclock();
dispatcher_->checkRequestSlotAndDoNecessaryThing(); dispatcher_->checkRequestSlotAndDoNecessaryThing();
} }
numReceivedMessage_ = receiveMessages();
detectMessageFlooding();
decideChoking();
decideInterest();
checkHave(); checkHave();
sendKeepAlive(); sendKeepAlive();
numReceivedMessage_ = receiveMessages();
btRequestFactory_->removeCompletedPiece(); btRequestFactory_->removeCompletedPiece();
decideInterest();
if (!pieceStorage_->downloadFinished()) { if (!pieceStorage_->downloadFinished()) {
addRequests(); addRequests();
} }