Suppress "connection refused" errors when stopping Syncthing ourselves

When stopping the Syncthing service ourselves we can apparently also
get "connection refused" and not just "remote host closed". So this
kind of error should be supressed as well.
This commit is contained in:
Martchus 2023-04-04 17:13:27 +02:00
parent 45d75ac7ae
commit 4fb50526bd
1 changed files with 3 additions and 3 deletions

View File

@ -36,9 +36,9 @@ bool InternalError::isRelevant(const SyncthingConnection &connection, SyncthingE
}
// consider process/launcher or systemd unit status
const auto remoteHostClosed(networkError == QNetworkReply::RemoteHostClosedError || networkError == QNetworkReply::ProxyConnectionClosedError);
// ignore "remote host closed" error if we've just stopped Syncthing ourselves
const auto *launcher(SyncthingLauncher::mainInstance());
const auto remoteHostClosed = networkError == QNetworkReply::ConnectionRefusedError || networkError == QNetworkReply::RemoteHostClosedError
|| networkError == QNetworkReply::ProxyConnectionClosedError;
// ignore "remote host closed" error if we've just stopped Syncthing ourselves (or "connection refused" which can also be the result of stopping Syncthing ourselves)
if (settings.launcher.considerForReconnect && remoteHostClosed && launcher && launcher->isManuallyStopped()) {
return false;
}