Hello community,
here is the log from the commit of package python-cheroot for
openSUSE:Leap:15.2 checked in at 2020-05-12 11:32:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-cheroot (Old)
and /work/SRC/openSUSE:Leap:15.2/.python-cheroot.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cheroot"
Tue May 12 11:32:05 2020 rev:13 rq:801869 version:6.5.5
Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-cheroot/python-cheroot.changes
2020-03-01 08:50:26.365161718 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.python-cheroot.new.2738/python-cheroot.changes
2020-05-12 11:32:16.711729008 +0200
@@ -1,0 +2,8 @@
+Thu May 7 09:44:50 UTC 2020 - Pablo Suárez Hernández
<[email protected]>
+
+- Avoid possible race condition on persistent HTTP connections (bsc#1169604)
+
+- Added:
+ * 0001-Avoid-race-condition-on-persistent-HTTP-connections.patch
+
+-------------------------------------------------------------------
New:
----
0001-Avoid-race-condition-on-persistent-HTTP-connections.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-cheroot.spec ++++++
--- /var/tmp/diff_new_pack.00w6wj/_old 2020-05-12 11:32:17.195730026 +0200
+++ /var/tmp/diff_new_pack.00w6wj/_new 2020-05-12 11:32:17.195730026 +0200
@@ -25,6 +25,9 @@
Group: Development/Languages/Python
URL: https://github.com/cherrypy/cheroot
Source:
https://files.pythonhosted.org/packages/source/c/cheroot/cheroot-%{version}.tar.gz
+# PATCH-FIX_UPSTREAM //github.com/cherrypy/cheroot/pull/282
+Patch1: 0001-Avoid-race-condition-on-persistent-HTTP-connections.patch
+
BuildRequires: %{python_module more-itertools >= 2.6}
BuildRequires: %{python_module pyOpenSSL}
BuildRequires: %{python_module pytest >= 2.8}
@@ -56,6 +59,7 @@
%prep
%setup -q -n cheroot-%{version}
+%patch1 -p1
# do not require cov/xdist/etc
sed -i -e '/addopts/d' pytest.ini
++++++ 0001-Avoid-race-condition-on-persistent-HTTP-connections.patch ++++++
>From 18c7bad7cef259551ab5f36f01ffa9d50440327a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<[email protected]>
Date: Wed, 6 May 2020 14:04:48 +0100
Subject: [PATCH] Avoid race condition on persistent HTTP connections
Add a HTTP "Keep-Alive" header with "timeout" on the HTTP response
to avoid a race condition on persistent HTTP connections when the
HTTP client reuses a connection after the "socket.timeout" exception
triggered on the HTTPServer but before the FIN packet is produced.
When this happens, the client gets a "connection reset by peer" after
writting the request.
This commit makes a HTTP client to know about this "Keep-Alive" idle
timeout by exposing it on the HTTP "Keep-Alive" response header, so
the connection won't be reused if it was "idle" for that "timeout"
after the last request response.
---
cheroot/server.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/cheroot/server.py b/cheroot/server.py
index 08590b10..d3512254 100644
--- a/cheroot/server.py
+++ b/cheroot/server.py
@@ -1172,6 +1172,11 @@ class HTTPRequest:
if not self.close_connection:
self.outheaders.append((b'Connection', b'Keep-Alive'))
+ self.outheaders.append((
+ b'Keep-Alive',
+ "timeout={}".format(self.server.timeout).encode('ISO-8859-1'),
+ ))
+
if (not self.close_connection) and (not self.chunked_read):
# Read any remaining request body data on the socket.
# "If an origin server receives a request that does not include an
--
2.23.0