diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-01-23 16:02:57 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-01-23 16:02:57 (GMT) |
commit | 9d8a3ad02acdd7800775b4e1e205bf7c8e47162f (patch) | |
tree | 901d68e13ac436902349f95a7a24dcc56a1d69f2 /Lib/test/test_httplib.py | |
parent | d775bcabe7c73ec10598e50c01586d470374baff (diff) | |
download | cpython-9d8a3ad02acdd7800775b4e1e205bf7c8e47162f.zip cpython-9d8a3ad02acdd7800775b4e1e205bf7c8e47162f.tar.gz cpython-9d8a3ad02acdd7800775b4e1e205bf7c8e47162f.tar.bz2 |
http.client: disable Nagle's algorithm (closes #23302)
Patch by Demian Brecht.
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r-- | Lib/test/test_httplib.py | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 6261276..08efa19 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -70,6 +70,9 @@ class FakeSocket: def close(self): pass + def setsockopt(self, level, optname, value): + pass + class EPipeSocket(FakeSocket): def __init__(self, text, pipe_trigger): @@ -658,28 +661,6 @@ class BasicTest(TestCase): resp.close() self.assertTrue(resp.closed) - def test_delayed_ack_opt(self): - # Test that Nagle/delayed_ack optimistaion works correctly. - - # For small payloads, it should coalesce the body with - # headers, resulting in a single sendall() call - conn = client.HTTPConnection('example.com') - sock = FakeSocket(None) - conn.sock = sock - body = b'x' * (conn.mss - 1) - conn.request('POST', '/', body) - self.assertEqual(sock.sendall_calls, 1) - - # For large payloads, it should send the headers and - # then the body, resulting in more than one sendall() - # call - conn = client.HTTPConnection('example.com') - sock = FakeSocket(None) - conn.sock = sock - body = b'x' * conn.mss - conn.request('POST', '/', body) - self.assertGreater(sock.sendall_calls, 1) - def test_error_leak(self): # Test that the socket is not leaked if getresponse() fails conn = client.HTTPConnection('example.com') |