Skip to content

Commit

Permalink
Re-enable keep-alive on proxies (#8920)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Aug 29, 2024
1 parent 9418a4a commit 5cf5db5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES/8920.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enabled keep-alive support on proxies (which was originally disabled several years ago) -- by :user:`Dreamsorcerer`.
3 changes: 0 additions & 3 deletions aiohttp/client_proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ def should_close(self) -> bool:
or bool(self._tail)
)

def force_close(self) -> None:
self._should_close = True

def close(self) -> None:
transport = self.transport
if transport is not None:
Expand Down
5 changes: 0 additions & 5 deletions aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,11 +1284,6 @@ async def _create_proxy_connection(
proxy_req, [], timeout, client_error=ClientProxyConnectionError
)

# Many HTTP proxies has buggy keepalive support. Let's not
# reuse connection but close it after processing every
# response.
proto.force_close()

auth = proxy_req.headers.pop(hdrs.AUTHORIZATION, None)
if auth is not None:
if not req.is_ssl():
Expand Down

0 comments on commit 5cf5db5

Please sign in to comment.