Przeglądaj źródła

2009-11-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Cancel segment in prepareForRetry() because there is a chance that
	the command has segments.
	* src/CreateRequestCommand.cc
Tatsuhiro Tsujikawa 16 lat temu
rodzic
commit
2764b6739d
2 zmienionych plików z 9 dodań i 0 usunięć
  1. 6 0
      ChangeLog
  2. 3 0
      src/CreateRequestCommand.cc

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2009-11-21  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Cancel segment in prepareForRetry() because there is a chance that
+	the command has segments.
+	* src/CreateRequestCommand.cc
+
 2009-11-20  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Fixed the bug that slow server is not knocked down in favor of

+ 3 - 0
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);