Turn off keepalive for connectivity checking

This commit is contained in:
Dan Williams 2015-03-16 10:55:27 -05:00
parent 70ab67a4ec
commit d296fac843
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From 46c836e5cd5342cab5dfb4cd6eb5daf6170b70a0 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Mon, 16 Mar 2015 10:44:16 -0500
Subject: [PATCH] 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.
(cherry picked from commit 90692e3efff398f0e4420827fc6d7ac342360e5c)
---
src/nm-connectivity.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
index 4d5feef..85bd70a 100644
--- a/src/nm-connectivity.c
+++ b/src/nm-connectivity.c
@@ -247,6 +247,8 @@ nm_connectivity_check_async (NMConnectivity *self,
if (priv->uri && priv->interval) {
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");
soup_session_queue_message (priv->soup_session,
msg,
nm_connectivity_check_cb,
--
2.1.0

View File

@ -12,7 +12,7 @@
%define snapshot %{nil}
%define realversion 0.9.10.2
%define release_version 1
%define release_version 2
%define epoch_version 1
%define obsoletes_nmver 1:0.9.9.95-1
@ -78,6 +78,7 @@ Source3: 20-connectivity-fedora.conf
# Not upstream.
Patch0: 0000-explain-dns1-dns2.patch
Patch1: 0001-connectivity-disable-HTTP-keepalive-for-connectivity.patch
# Cherry-picks from upstream:
# http://cgit.freedesktop.org/NetworkManager/NetworkManager/log/?h=nm-0-9-10
@ -320,6 +321,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%setup -q -n NetworkManager-%{realversion}
%patch0 -p1 -b .explain-dns1-dns2.orig
%patch1 -p1 -b .0001-connectivity-disable-HTTP-keepalive-for-connectivity.orig
%build
@ -591,6 +593,9 @@ fi
%endif
%changelog
* Mon Mar 16 2015 Dan Williams <dcbw@redhat.com> - 1:0.9.10.2-2
- Turn off keepalive for connectivity checking
* Wed Mar 4 2015 Dan Williams <dcbw@redhat.com> - 1:0.9.10.2-1
- Update to 0.9.10.2 release