Skip to content

Commit 5cf5db5

Browse files
Re-enable keep-alive on proxies (#8920)
1 parent 9418a4a commit 5cf5db5

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
@@ -66,9 +66,6 @@ def should_close(self) -> bool:
6666
or bool(self._tail)
6767
)
6868

69-
def force_close(self) -> None:
70-
self._should_close = True
71-
7269
def close(self) -> None:
7370
transport = self.transport
7471
if transport is not None:

aiohttp/connector.py

-5
Original file line numberDiff line numberDiff line change
@@ -1284,11 +1284,6 @@ async def _create_proxy_connection(
12841284
proxy_req, [], timeout, client_error=ClientProxyConnectionError
12851285
)
12861286

1287-
# Many HTTP proxies has buggy keepalive support. Let's not
1288-
# reuse connection but close it after processing every
1289-
# response.
1290-
proto.force_close()
1291-
12921287
auth = proxy_req.headers.pop(hdrs.AUTHORIZATION, None)
12931288
if auth is not None:
12941289
if not req.is_ssl():

0 commit comments

Comments
 (0)