2010-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Removed prepareForRetry from CreateRequestCommand
	* src/CreateRequestCommand.cc
	* src/CreateRequestCommand.h
pull/1/head
Tatsuhiro Tsujikawa 2010-07-17 14:33:50 +00:00
parent 100cd1afd6
commit 27d5c2badc
3 changed files with 6 additions and 28 deletions

View File

@ -1,3 +1,9 @@
2010-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed prepareForRetry from CreateRequestCommand
* src/CreateRequestCommand.cc
* src/CreateRequestCommand.h
2010-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2010-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Set PREF_REUSE_URI=V_FALSE for tracker request. Set PREF_REUSE_URI=V_FALSE for tracker request.

View File

@ -43,9 +43,6 @@
#include "SegmentMan.h" #include "SegmentMan.h"
#include "prefs.h" #include "prefs.h"
#include "Option.h" #include "Option.h"
#include "SleepCommand.h"
#include "Logger.h"
#include "util.h"
#include "RequestGroupMan.h" #include "RequestGroupMan.h"
#include "FileAllocationEntry.h" #include "FileAllocationEntry.h"
#include "CheckIntegrityEntry.h" #include "CheckIntegrityEntry.h"
@ -104,27 +101,4 @@ bool CreateRequestCommand::executeInternal()
return true; return true;
} }
bool CreateRequestCommand::prepareForRetry(time_t wait)
{
// We assume that this method is called from AbstractCommand when
// Segment is not available. Normally,
// AbstractCommand::prepareForRetry() does the job, but it creates
// CreateRequestCommand and deletes current one. At the last stage
// of the download, commands are idle and prepareForRetry() is
// called repeatedly. This means that newly created
// CreateRequestCommand is deleted one second later: This is not
// efficient. For this reason, reuse current CreateRequestCommand.
if(!getPieceStorage().isNull()) {
getSegmentMan()->cancelSegment(getCuid());
}
if(getLogger()->debug()) {
getLogger()->debug("CUID#%s - Reusing CreateRequestCommand",
util::itos(getCuid()).c_str());
}
SleepCommand* scom = new SleepCommand
(getCuid(), getDownloadEngine(), getRequestGroup(), this, wait);
getDownloadEngine()->addCommand(scom);
return false;
}
} // namespace aria2 } // namespace aria2

View File

@ -46,8 +46,6 @@ public:
DownloadEngine* e); DownloadEngine* e);
protected: protected:
virtual bool executeInternal(); virtual bool executeInternal();
virtual bool prepareForRetry(time_t wait);
}; };
} // namespace aria2 } // namespace aria2