From 2764b6739d0b0414cf0ce31c2f8db5b24f68b75e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 20 Nov 2009 15:27:10 +0000 Subject: 2009-11-21 Tatsuhiro Tsujikawa Cancel segment in prepareForRetry() because there is a chance that the command has segments. * src/CreateRequestCommand.cc --- src/CreateRequestCommand.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/CreateRequestCommand.cc') diff --git a/src/CreateRequestCommand.cc b/src/CreateRequestCommand.cc index 81003541..f23bd192 100644 --- a/src/CreateRequestCommand.cc +++ b/src/CreateRequestCommand.cc @@ -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); -- cgit