2009-11-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Cancel segment in prepareForRetry() because there is a chance that
	the command has segments.
	* src/CreateRequestCommand.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-11-20 15:27:10 +00:00
parent 60e3e46c52
commit 2764b6739d
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2009-11-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Cancel segment in prepareForRetry() because there is a chance that
the command has segments.
* src/CreateRequestCommand.cc
2009-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that slow server is not knocked down in favor of

View File

@ -108,6 +108,9 @@ bool CreateRequestCommand::prepareForRetry(time_t wait)
// called repeatedly. This means that newly created
// CreateRequestCommand is deleted one second later: This is not
// efficient. For this reason, reuse current CreateRequestCommand.
if(!_requestGroup->getPieceStorage().isNull()) {
_requestGroup->getSegmentMan()->cancelSegment(cuid);
}
logger->debug("CUID#%d - Reusing CreateRequestCommand", cuid);
SleepCommand* scom = new SleepCommand(cuid, e, _requestGroup, this, wait);
e->commands.push_back(scom);