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:
parent
45d75ac7ae
commit
4fb50526bd
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue