mirror of https://github.com/aria2/aria2
2010-08-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Set max outstanding request size to 100. Set stepping to 6. * src/BtConstants.h * src/DefaultBtInteractive.ccpull/1/head
parent
a478cfecc4
commit
7633410ebf
|
@ -1,3 +1,9 @@
|
|||
2010-08-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Set max outstanding request size to 100. Set stepping to 6.
|
||||
* src/BtConstants.h
|
||||
* src/DefaultBtInteractive.cc
|
||||
|
||||
2010-08-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Bump up version number 1.10.1
|
||||
|
|
|
@ -53,8 +53,10 @@ typedef std::map<std::string, uint8_t> Extensions;
|
|||
|
||||
#define DEFAULT_MAX_OUTSTANDING_REQUEST 6
|
||||
|
||||
#define OUTSTANDING_REQUEST_STEP 6
|
||||
|
||||
// Upper Bound of the number of outstanding request
|
||||
#define UB_MAX_OUTSTANDING_REQUEST 24
|
||||
#define UB_MAX_OUTSTANDING_REQUEST 100
|
||||
|
||||
#define METADATA_PIECE_SIZE (16*1024)
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ void DefaultBtInteractive::sendKeepAlive() {
|
|||
size_t DefaultBtInteractive::receiveMessages() {
|
||||
size_t countOldOutstandingRequest = dispatcher_->countOutstandingRequest();
|
||||
size_t msgcount = 0;
|
||||
for(int i = 0; i < 50; ++i) {
|
||||
for(int i = 0; i < UB_MAX_OUTSTANDING_REQUEST+50; ++i) {
|
||||
if(requestGroupMan_->doesOverallDownloadSpeedExceed() ||
|
||||
downloadContext_->getOwnerRequestGroup()->doesDownloadSpeedExceed()) {
|
||||
break;
|
||||
|
@ -323,10 +323,11 @@ size_t DefaultBtInteractive::receiveMessages() {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if(countOldOutstandingRequest > 0 &&
|
||||
if(countOldOutstandingRequest >= maxOutstandingRequest_ &&
|
||||
dispatcher_->countOutstandingRequest() == 0){
|
||||
maxOutstandingRequest_ = std::min((size_t)UB_MAX_OUTSTANDING_REQUEST,
|
||||
maxOutstandingRequest_*2);
|
||||
maxOutstandingRequest_ =
|
||||
std::min((size_t)UB_MAX_OUTSTANDING_REQUEST,
|
||||
maxOutstandingRequest_+OUTSTANDING_REQUEST_STEP);
|
||||
}
|
||||
return msgcount;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue