diff -r 47d2664b1da4 Lib/http/client.py --- a/Lib/http/client.py Mon Dec 31 21:44:06 2012 -0600 +++ b/Lib/http/client.py Tue Jan 01 20:34:10 2013 +1100 @@ -719,6 +719,12 @@ default_port = HTTP_PORT auto_open = 1 debuglevel = 0 + # TCP Maximum Segment Size (MSS) is a TCP stack parameter. There + # is no simple and efficient platform independent mechanism for + # determining the MSS, so instead a reasonable estimate is chosen. + # The getsockopt() interface using the TCP_MAXSEG parameter may + # be a suitable approach on some operating systems. + mss = 2048 def __init__(self, host, port=None, strict=_strict_sentinel, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, source_address=None): @@ -886,8 +892,11 @@ del self._buffer[:] # If msg and message_body are sent in a single send() call, # it will avoid performance problems caused by the interaction - # between delayed ack and the Nagle algorithm. - if isinstance(message_body, bytes): + # between delayed ack and the Nagle algorithm. However, + # there is no performance gain if the message is larger + # than MSS (and there is a memory penalty for the message + # copy). + if isinstance(message_body, bytes) and len(message_body) < self.mss: msg += message_body message_body = None self.send(msg) diff -r 47d2664b1da4 Misc/ACKS --- a/Misc/ACKS Mon Dec 31 21:44:06 2012 -0600 +++ b/Misc/ACKS Tue Jan 01 20:34:10 2013 +1100 @@ -705,6 +705,7 @@ Tshepang Lekhonkhobe Marc-André Lemburg John Lenton +Benno Leslie Christopher Tur Lesniewski-Laas Alain Leufroy Mark Levinson