Fix a wait in the retry for HTTP 404 error

pull/1714/head
bapcyk 2020-11-24 13:53:47 +02:00
parent 15cad965eb
commit 0b9fa1e1a7
2 changed files with 5 additions and 1 deletions

View File

@ -386,7 +386,10 @@ bool AbstractCommand::execute()
return true;
}
if (err.getErrorCode() == error_code::HTTP_SERVICE_UNAVAILABLE) {
if (err.getErrorCode() == error_code::HTTP_SERVICE_UNAVAILABLE ||
err.getErrorCode() == error_code::RESOURCE_NOT_FOUND) {
A2_LOG_DEBUG(fmt(MSG_RETRY_WAITING, getCuid(), getOption()->getAsInt(PREF_RETRY_WAIT),
req_->getUri().c_str()));
Timer wakeTime(global::wallclock());
wakeTime.advance(
std::chrono::seconds(getOption()->getAsInt(PREF_RETRY_WAIT)));

View File

@ -47,6 +47,7 @@
#define MSG_SENDING_REQUEST "CUID#%" PRId64 " - Requesting:\n%s"
#define MSG_RECEIVE_RESPONSE "CUID#%" PRId64 " - Response received:\n%s"
#define MSG_DOWNLOAD_ABORTED "CUID#%" PRId64 " - Download aborted. URI=%s"
#define MSG_RETRY_WAITING "CUID#%" PRId64 " - Waiting (%d sec) for retry of the download. URI=%s"
#define MSG_RESTARTING_DOWNLOAD "CUID#%" PRId64 " - Restarting the download. URI=%s"
#define MSG_TORRENT_DOWNLOAD_ABORTED "CUID#%" PRId64 " - Download aborted."
#define MSG_MAX_TRY \