Geary.Util.ConnectivityManager: Fix a spurious connectivity error report

When a general error occurs checking connectivity of a remote server,
only treat it as an error if GNetworkMonitor indicates the network is
available (i.e. that a default route exists). If there is no network,
it's not surprising that the error occurred.

This fixes a spurious error when the delayed check runs but the host
is offline.
This commit is contained in:
Michael Gratton 2020-04-11 12:46:53 +10:00 committed by Michael James Gratton
parent 991c9ef5d7
commit 530c205ce7

View file

@ -166,7 +166,7 @@ public class Geary.ConnectivityManager : BaseObject {
// needlessly hassle the user with expected error
// messages.
GLib.NetworkConnectivity connectivity = this.monitor.connectivity;
if (connectivity == FULL ||
if ((this.monitor.network_available && connectivity == FULL) ||
(connectivity == LOCAL && is_local_address())) {
debug("Error checking %s [%s] reachable, treating unreachable: %s",
endpoint, connectivity.to_string(), err.message);