summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-07-17 14:33:50 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-07-17 14:33:50 +0000
commit27d5c2badc5bdee4cd8082a732244c6ad87677f5 (patch)
treef7df8db69d2f646c83b8c14df7203df80d39d612
parent100cd1afd65aee0aefd81ca0197f72e8ad3ffb08 (diff)
2010-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed prepareForRetry from CreateRequestCommand * src/CreateRequestCommand.cc * src/CreateRequestCommand.h
-rw-r--r--ChangeLog6
-rw-r--r--src/CreateRequestCommand.cc26
-rw-r--r--src/CreateRequestCommand.h2
3 files changed, 6 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index 015a38e9..2c06433a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
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>
+
Set PREF_REUSE_URI=V_FALSE for tracker request.
* src/TrackerWatcherCommand.cc
diff --git a/src/CreateRequestCommand.cc b/src/CreateRequestCommand.cc
index 62783d9b..c7373fc7 100644
--- a/src/CreateRequestCommand.cc
+++ b/src/CreateRequestCommand.cc
@@ -43,9 +43,6 @@
#include "SegmentMan.h"
#include "prefs.h"
#include "Option.h"
-#include "SleepCommand.h"
-#include "Logger.h"
-#include "util.h"
#include "RequestGroupMan.h"
#include "FileAllocationEntry.h"
#include "CheckIntegrityEntry.h"
@@ -104,27 +101,4 @@ bool CreateRequestCommand::executeInternal()
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
diff --git a/src/CreateRequestCommand.h b/src/CreateRequestCommand.h
index 7d8abf26..54e01275 100644
--- a/src/CreateRequestCommand.h
+++ b/src/CreateRequestCommand.h
@@ -46,8 +46,6 @@ public:
DownloadEngine* e);
protected:
virtual bool executeInternal();
-
- virtual bool prepareForRetry(time_t wait);
};
} // namespace aria2