Skip to content

Commit

Permalink
Allow connection retry on some more error types
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Jun 9, 2024
1 parent ee0c49d commit 8b51f3f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/common/downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,16 @@ void Downloader::emitReadReady()

void Downloader::insertError(const QUrl &url, QNetworkReply::NetworkError error)
{
if (error == QNetworkReply::OperationCanceledError)
_errorDownloads.insert(url, _errorDownloads.value(url) + 1);
else
_errorDownloads.insert(url, RETRIES);
switch (error) {
case QNetworkReply::OperationCanceledError:
case QNetworkReply::TimeoutError:
case QNetworkReply::RemoteHostClosedError:
case QNetworkReply::ConnectionRefusedError:
_errorDownloads.insert(url, _errorDownloads.value(url) + 1);
break;
default:
_errorDownloads.insert(url, RETRIES);
}
}

void Downloader::readData(QNetworkReply *reply)
Expand Down

0 comments on commit 8b51f3f

Please sign in to comment.