Skip to content

Commit

Permalink
websrv_lib: defer one socket.flush(), keep packets minimum.
Browse files Browse the repository at this point in the history
bzr revid: p_christ@hol.gr-20110118125907-t7dz40a40pj6k8gs
  • Loading branch information
xrg committed Jan 18, 2011
1 parent 06b0cdb commit 5168d0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/service/websrv_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,13 @@ def send_error(self, code, message=None):
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' ] }

Expand Down

0 comments on commit 5168d0b

Please sign in to comment.