From e8e0ef6300526ab64eaba534c6b22b23631cf8a9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 20 Feb 2018 16:51:24 +0100 Subject: [PATCH] connectivity: reduce timeout for connectivity checks to 20 seconds The main issue is that `nmcli networking connectivity check` uses nm_client_check_connectivity(), which has a timeout of 25 seconds. Using a timeout of 30 seconds server side, means that if the requests don't complete in time, the client side will time out and abort with a failure. That is not right. Fix that by using a shorter timeout server side. 20 seconds is still plenty for a small HTTP request. If the network takes longer than that, it's fair to call that LIMITED connectivity. --- src/nm-connectivity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c index dd11bdc0f7..039ff71d05 100644 --- a/src/nm-connectivity.c +++ b/src/nm-connectivity.c @@ -500,7 +500,7 @@ nm_connectivity_check_start (NMConnectivity *self, curl_easy_setopt (ehandle, CURLOPT_INTERFACE, cb_data->ifspec); curl_multi_add_handle (priv->concheck.curl_mhandle, ehandle); - cb_data->timeout_id = g_timeout_add_seconds (30, _timeout_cb, cb_data); + cb_data->timeout_id = g_timeout_add_seconds (20, _timeout_cb, cb_data); _LOG2D ("start request to '%s'", priv->uri); return cb_data;