Skip to content

bpo-43332: Buffer proxy connection setup packets before sending.#24780

Merged
gpshead merged 3 commits into
python:masterfrom
gpshead:http_client_header_cork_issue43332
Mar 8, 2021
Merged

bpo-43332: Buffer proxy connection setup packets before sending.#24780
gpshead merged 3 commits into
python:masterfrom
gpshead:http_client_header_cork_issue43332

Conversation

@gpshead

@gpshead gpshead commented Mar 7, 2021

Copy link
Copy Markdown
Member

We now buffer the CONNECT request + tunnel HTTP headers into a single
send call. This prevents the OS from generating multiple network
packets for connection setup when not necessary, improving efficiency.

https://bugs.python.org/issue43332

We now buffer the CONNECT request + tunnel HTTP headers into a single
send call.  This prevents the OS from generating multiple network
packets for connection setup when not necessary, improving efficiency.
@gpshead gpshead added type-bug An unexpected behavior, bug, or error performance Performance or resource usage labels Mar 7, 2021
@gpshead
gpshead requested a review from 1st1 March 7, 2021 19:28
@gpshead gpshead self-assigned this Mar 7, 2021
Comment thread Lib/http/client.py
@gpshead
gpshead removed the request for review from 1st1 March 8, 2021 00:58
Comment thread Lib/test/test_httplib.py
self.assertNotIn(b'Host: proxy.com', self.conn.sock.data)

def test_tunnel_connect_single_send_connection_setup(self):
"""Regresstion test for https://bugs.python.org/issue43332."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Regresstion test for https://bugs.python.org/issue43332."""
"""Regression test for https://bugs.python.org/issue43332."""

Comment thread Lib/test/test_httplib.py

@orsenthil orsenthil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I have a review comment for the test which you can choose to address.

@gpshead
gpshead merged commit c25910a into python:master Mar 8, 2021
@gpshead
gpshead deleted the http_client_header_cork_issue43332 branch March 8, 2021 07:36
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 8, 2021
…honGH-24780)

We now buffer the CONNECT request + tunnel HTTP headers into a single
send call.  This prevents the OS from generating multiple network
packets for connection setup when not necessary, improving efficiency.
(cherry picked from commit c25910a)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
@bedevere-bot

Copy link
Copy Markdown

GH-24783 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this pull request Mar 8, 2021
…24780)

We now buffer the CONNECT request + tunnel HTTP headers into a single
send call.  This prevents the OS from generating multiple network
packets for connection setup when not necessary, improving efficiency.
(cherry picked from commit c25910a)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance or resource usage type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants