1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Allow connection retry on some more error types

This commit is contained in:
Martin Tůma 2024-06-09 09:36:02 +02:00
parent ee0c49db9d
commit 8b51f3ff04

View File

@ -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)