Browse Source

2010-01-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Fixed the bug that causes segmentaiton fault when aria2 sees '404
	not found' in the N times(N is where --max-file-not-found=N, N>0)
	in a row without single '200 OK' response.
	* src/RequestGroup.cc.
Tatsuhiro Tsujikawa 15 years ago
parent
commit
69850ada49
2 changed files with 9 additions and 1 deletions
  1. 7 0
      ChangeLog
  2. 2 1
      src/RequestGroup.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2010-01-25  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Fixed the bug that causes segmentaiton fault when aria2 sees '404
+	not found' in the N times(N is where --max-file-not-found=N, N>0)
+	in a row without single '200 OK' response.
+	* src/RequestGroup.cc.
+
 2010-01-24  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Fixed compile error with i586-mingw32msvc-g++.  Always Cut console

+ 2 - 1
src/RequestGroup.cc

@@ -1026,7 +1026,8 @@ void RequestGroup::increaseAndValidateFileNotFoundCount()
   ++_fileNotFoundCount;
   const unsigned int maxCount = _option->getAsInt(PREF_MAX_FILE_NOT_FOUND);
   if(maxCount > 0 && _fileNotFoundCount >= maxCount &&
-     _segmentMan->calculateSessionDownloadLength() == 0) {
+     (_segmentMan.isNull() ||
+      _segmentMan->calculateSessionDownloadLength() == 0)) {
     throw DOWNLOAD_FAILURE_EXCEPTION2
       (StringFormat("Reached max-file-not-found count=%u", maxCount).str(),
        downloadresultcode::MAX_FILE_NOT_FOUND);