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
pull/1/head
Tatsuhiro Tsujikawa 2010-08-25 13:52:37 +00:00
parent a478cfecc4
commit 7633410ebf
3 changed files with 14 additions and 5 deletions

View File

@ -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> 2010-08-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Bump up version number 1.10.1 Bump up version number 1.10.1

View File

@ -53,8 +53,10 @@ typedef std::map<std::string, uint8_t> Extensions;
#define DEFAULT_MAX_OUTSTANDING_REQUEST 6 #define DEFAULT_MAX_OUTSTANDING_REQUEST 6
#define OUTSTANDING_REQUEST_STEP 6
// Upper Bound of the number of outstanding request // 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) #define METADATA_PIECE_SIZE (16*1024)

View File

@ -284,7 +284,7 @@ void DefaultBtInteractive::sendKeepAlive() {
size_t DefaultBtInteractive::receiveMessages() { size_t DefaultBtInteractive::receiveMessages() {
size_t countOldOutstandingRequest = dispatcher_->countOutstandingRequest(); size_t countOldOutstandingRequest = dispatcher_->countOutstandingRequest();
size_t msgcount = 0; 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() || if(requestGroupMan_->doesOverallDownloadSpeedExceed() ||
downloadContext_->getOwnerRequestGroup()->doesDownloadSpeedExceed()) { downloadContext_->getOwnerRequestGroup()->doesDownloadSpeedExceed()) {
break; break;
@ -323,10 +323,11 @@ size_t DefaultBtInteractive::receiveMessages() {
break; break;
} }
} }
if(countOldOutstandingRequest > 0 && if(countOldOutstandingRequest >= maxOutstandingRequest_ &&
dispatcher_->countOutstandingRequest() == 0){ dispatcher_->countOutstandingRequest() == 0){
maxOutstandingRequest_ = std::min((size_t)UB_MAX_OUTSTANDING_REQUEST, maxOutstandingRequest_ =
maxOutstandingRequest_*2); std::min((size_t)UB_MAX_OUTSTANDING_REQUEST,
maxOutstandingRequest_+OUTSTANDING_REQUEST_STEP);
} }
return msgcount; return msgcount;
} }