Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable keep-alive on proxies #8920

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading