diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-06-28 21:34:22 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-06-28 21:34:22 (GMT) |
commit | 41a5750656da116a9e8f5f49e02f37d743d04a9e (patch) | |
tree | 4d249d94431c4df46944bc93163eb3c31b794606 /Lib/socketserver.py | |
parent | 8f480e54016cee1ad30dec42eb1d768523266271 (diff) | |
download | cpython-41a5750656da116a9e8f5f49e02f37d743d04a9e.zip cpython-41a5750656da116a9e8f5f49e02f37d743d04a9e.tar.gz cpython-41a5750656da116a9e8f5f49e02f37d743d04a9e.tar.bz2 |
http://bugs.python.org/issue6192
Mergin revisions 73272 and 73546 to py3k
Diffstat (limited to 'Lib/socketserver.py')
-rw-r--r-- | Lib/socketserver.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 92adbcf..2ed50b9 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -646,8 +646,15 @@ class StreamRequestHandler(BaseRequestHandler): rbufsize = -1 wbufsize = 0 + # Disable nagle algoritm for this socket, if True. + # Use only when wbufsize != 0, to avoid small packets. + disable_nagle_algorithm = False + def setup(self): self.connection = self.request + if self.disable_nagle_algorithm: + self.connection.setsockopt(socket.IPPROTO_TCP, + socket.TCP_NODELAY, True) self.rfile = self.connection.makefile('rb', self.rbufsize) self.wfile = self.connection.makefile('wb', self.wbufsize) |