Skip to content

Commit

Permalink
Process as many messages as possible in recv buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Jun 25, 2012
1 parent e816c5e commit 3620d27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DHTInteractionCommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bool DHTInteractionCommand::execute()

taskQueue_->executeTask();

for(size_t i = 0; i < 20; ++i) {
while(1) {
SharedHandle<DHTMessage> m = receiver_->receiveMessage();
if(!m) {
break;
Expand Down
2 changes: 1 addition & 1 deletion src/DefaultBtInteractive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void DefaultBtInteractive::sendKeepAlive() {
size_t DefaultBtInteractive::receiveMessages() {
size_t countOldOutstandingRequest = dispatcher_->countOutstandingRequest();
size_t msgcount = 0;
for(int i = 0; i < UB_MAX_OUTSTANDING_REQUEST+50; ++i) {
while(1) {
if(requestGroupMan_->doesOverallDownloadSpeedExceed() ||
downloadContext_->getOwnerRequestGroup()->doesDownloadSpeedExceed()) {
break;
Expand Down

0 comments on commit 3620d27

Please sign in to comment.