diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-07-16 21:21:11 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-07-16 21:21:11 (GMT) |
commit | 8531b1b28de5356f1154e13704d499121ea72af8 (patch) | |
tree | e77246acf5defad56ee5feb23be7b3db57e56925 /Lib/getopt.py | |
parent | ca5ed5b8753e71c15e1acbd753c4fd65cd3813a0 (diff) | |
download | cpython-8531b1b28de5356f1154e13704d499121ea72af8.zip cpython-8531b1b28de5356f1154e13704d499121ea72af8.tar.gz cpython-8531b1b28de5356f1154e13704d499121ea72af8.tar.bz2 |
Send HTTP requests with a single send() call instead of many.
The implementation now stores all the lines of the request in a buffer
and makes a single send() call when the request is finished,
specifically when endheaders() is called.
This appears to improve performance. The old code called send() for
each line. The sends are all short, so they caused bad interactions
with the Nagle algorithm and delayed acknowledgements. In simple
tests, the second packet was delayed by 100s of ms. The second send was
delayed by the Nagle algorithm, waiting for the ack. The delayed ack
strategy delays the ack in hopes of piggybacking it on a data packet,
but the server won't send any data until it receives the complete
request.
This change minimizes the problem that Nagle + delayed ack will cause
a problem, although a request large enough to be broken into two
packets will still suffer some delay. Luckily the MSS is large enough
to accomodate most single packets.
XXX Bug fix candidate?
Diffstat (limited to 'Lib/getopt.py')
0 files changed, 0 insertions, 0 deletions