websrv_lib: defer one socket.flush(), keep packets minimum.

bzr revid: p_christ@hol.gr-20110118125907-t7dz40a40pj6k8gs
This commit is contained in:
P. Christeas 2011-01-18 14:59:07 +02:00
parent 06b0cdbfaa
commit 5168d0bd09
1 changed files with 3 additions and 2 deletions

View File

@ -182,12 +182,13 @@ class FixSendError:
self.send_header('Connection', 'close')
self.send_header('Content-Length', len(content) or 0)
self.end_headers()
if hasattr(self, '_flush'):
self._flush()
if self.command != 'HEAD' and code >= 200 and code not in (204, 304):
self.wfile.write(content)
if hasattr(self, '_flush'):
self._flush()
class HttpOptions:
_HTTP_OPTIONS = {'Allow': ['OPTIONS' ] }