Apply --retry-wait when retrying after 404

Previously, --retry-wait was not used when retrying after 404
(--max-file-not-found).  The retry was done without delay.  Also the
maximum retry count (--max-retries) was ignored when retrying with
404.

This commit makes --retry-wait apply for retrying with 404 as well.
It also combines --max-retries and --max-file-not-found.  When
retrying with 404, it is counted toward retry count.
This commit is contained in:
Tatsuhiro Tsujikawa 2015-12-18 23:00:35 +09:00
parent c54ecdf8e1
commit 029d6897f2

View File

@ -215,7 +215,8 @@ bool HttpSkipResponseCommand::processResponse()
throw DL_ABORT_EX2(MSG_RESOURCE_NOT_FOUND,
error_code::RESOURCE_NOT_FOUND);
}
return prepareForRetry(0);
throw DL_RETRY_EX2(MSG_RESOURCE_NOT_FOUND,
error_code::RESOURCE_NOT_FOUND);
} else if(statusCode == 503) {
// Only retry if pretry-wait > 0. Hammering 'busy' server is not
// a good idea.