summaryrefslogtreecommitdiff
path: root/src/nm-connectivity.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2015-03-16 10:44:16 -0500
committerDan Williams <dcbw@redhat.com>2015-03-16 10:45:25 -0500
commit90692e3efff398f0e4420827fc6d7ac342360e5c (patch)
tree55df6c1baebd6e4c8e1209b3423ba29135b05e20 /src/nm-connectivity.c
parent2e86c37dd3c996e85f0ab71c12bec0ae2e097a87 (diff)
downloadNetworkManager-90692e3efff398f0e4420827fc6d7ac342360e5c.tar.gz
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.
Diffstat (limited to 'src/nm-connectivity.c')
-rw-r--r--src/nm-connectivity.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
index 34465aad03..ecb9c0f5c1 100644
--- a/src/nm-connectivity.c
+++ b/src/nm-connectivity.c
@@ -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);