[Python-checkins] r73648 - python/branches/py3k/Lib/socketserver.py

kristjan.jonsson python-checkins at python.org
Sun Jun 28 23:34:23 CEST 2009


Author: kristjan.jonsson
Date: Sun Jun 28 23:34:22 2009
New Revision: 73648

Log:
http://bugs.python.org/issue6192
Mergin revisions 73272 and 73546 to py3k

Modified:
   python/branches/py3k/Lib/socketserver.py

Modified: python/branches/py3k/Lib/socketserver.py
==============================================================================
--- python/branches/py3k/Lib/socketserver.py	(original)
+++ python/branches/py3k/Lib/socketserver.py	Sun Jun 28 23:34:22 2009
@@ -646,8 +646,15 @@
     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)
 


More information about the Python-checkins mailing list