connectivity: disable HTTP keepalive for connectivity checks

There won't be any further requests, so there's no point in keeping
the connection alive.  Even if the HTTP server doesn't care, proxy
servers in-between might keep the connection open for a couple seconds
for keepalive, and we might as well be nice to them and tell them we
don't need to keep it alive.
This commit is contained in:
Dan Williams 2015-03-16 10:44:16 -05:00
parent 2e86c37dd3
commit 90692e3eff

View file

@ -297,6 +297,8 @@ nm_connectivity_check_async (NMConnectivity *self,
msg = soup_message_new ("GET", priv->uri);
soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
/* Disable HTTP/1.1 keepalive; the connection should not persist */
soup_message_headers_append (msg->request_headers, "Connection", "close");
cb_data->simple = simple;
cb_data->uri = g_strdup (priv->uri);
cb_data->response = g_strdup (priv->response);