summaryrefslogtreecommitdiff
path: root/src/CreateRequestCommand.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CreateRequestCommand.cc')
-rw-r--r--src/CreateRequestCommand.cc4
1 files changed, 4 insertions, 0 deletions
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;
}