http_server: enable write-buffering for TCP sockets

When sending http data, we need to minimize the number of TCP packets.
By enabling write-buffering, we can achieve that. However, we need to
make sure that buffers will properly be flushed, not linger.

Conflicts:

	bin/service/http_server.py

bzr revid: p_christ@hol.gr-20110118125959-vk0gzx30bwykn18s
This commit is contained in:
P. Christeas 2011-01-18 14:59:59 +02:00
parent 5168d0bd09
commit 6e2fee84f8
2 changed files with 6 additions and 0 deletions

View File

@ -123,10 +123,12 @@ class HttpLogHandler:
class MultiHandler2(HttpLogHandler, MultiHTTPHandler):
_logger = logging.getLogger('http')
wbufsize = 32768
class SecureMultiHandler2(HttpLogHandler, SecureMultiHTTPHandler):
_logger = logging.getLogger('https')
wbufsize = 32768
def getcert_fnames(self):
tc = tools.config

View File

@ -481,6 +481,10 @@ class SecureMultiHTTPHandler(MultiHTTPHandler):
except Exception:
pass
def handle_one_request(self):
MultiHTTPHandler.handle_one_request(self)
self.wfile.flush()
import threading
class ConnThreadingMixIn:
"""Mix-in class to handle each _connection_ in a new thread.