Skip to content

Commit

Permalink
[PR #8920/5cf5db56 backport][3.11] Re-enable keep-alive on proxies (#…
Browse files Browse the repository at this point in the history
…8939)

**This is a backport of PR #8920 as merged into master
(5cf5db5).**

Co-authored-by: Sam Bull <git@sambull.org>
  • Loading branch information
patchback[bot] and Dreamsorcerer authored Aug 29, 2024
1 parent 1dc3cd6 commit 8173932
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 @@ -62,9 +62,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 @@ -1376,11 +1376,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 8173932

Please sign in to comment.