Skip to content

Commit 3b48dad

Browse files
Dreamsorcererpatchback[bot]
authored andcommitted
Re-enable keep-alive on proxies (#8920)
(cherry picked from commit 5cf5db5)
1 parent 37b2604 commit 3b48dad

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

CHANGES/8920.misc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enabled keep-alive support on proxies (which was originally disabled several years ago) -- by :user:`Dreamsorcerer`.

aiohttp/client_proto.py

-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ def should_close(self) -> bool:
6262
or bool(self._tail)
6363
)
6464

65-
def force_close(self) -> None:
66-
self._should_close = True
67-
6865
def close(self) -> None:
6966
transport = self.transport
7067
if transport is not None:

aiohttp/connector.py

-5
Original file line numberDiff line numberDiff line change
@@ -1376,11 +1376,6 @@ async def _create_proxy_connection(
13761376
proxy_req, [], timeout, client_error=ClientProxyConnectionError
13771377
)
13781378

1379-
# Many HTTP proxies has buggy keepalive support. Let's not
1380-
# reuse connection but close it after processing every
1381-
# response.
1382-
proto.force_close()
1383-
13841379
auth = proxy_req.headers.pop(hdrs.AUTHORIZATION, None)
13851380
if auth is not None:
13861381
if not req.is_ssl():

0 commit comments

Comments
 (0)