From 0bbda43385c5e660a3365830d0b020e1a8f99970 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 31 Aug 2012 22:31:31 +0900 Subject: Fixed assertion error if --retry-wait is used In CreateRequestCommand, if Request object returned from getRequest() is still sleeping, CreateRequestCommand pools it back but still holds its reference. This makes assertion error in UnknownLengthPieceStroage::hasMissingUnusedPiece() from AbstractCommand::execute(). --- src/CreateRequestCommand.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/CreateRequestCommand.cc') diff --git a/src/CreateRequestCommand.cc b/src/CreateRequestCommand.cc index 21edc397..d46936dd 100644 --- a/src/CreateRequestCommand.cc +++ b/src/CreateRequestCommand.cc @@ -101,6 +101,10 @@ bool CreateRequestCommand::executeInternal() } else if(getRequest()->getWakeTime() > global::wallclock()) { A2_LOG_DEBUG("This request object is still sleeping."); getFileEntry()->poolRequest(getRequest()); + // Reset request of this command. Without this, request is doubly + // counted (1 for pooled and another one in this command) and + // AbstractCommand::execute() will behave badly. + resetRequest(); getDownloadEngine()->addCommand(this); return false; } -- cgit