Mercurial > hg
diff mercurial/hgweb/server.py @ 6784:18c429ea3a0e
hgweb: all protocol functions have become generators
Using the write() callable supplied by the start_response() call is
frowned upon by the WSGI spec, returning an iterable over the content chunks
is the recommended way. Be aware, though: returning many small chunks will
slow down responses, because the server has to flush each chunk separately.
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Sun, 29 Jun 2008 15:23:09 +0200 |
parents | f615ece5fec3 |
children | 63b5f4c73c98 |
line wrap: on
line diff
--- a/mercurial/hgweb/server.py Sun Jun 29 13:16:25 2008 +0200 +++ b/mercurial/hgweb/server.py Sun Jun 29 15:23:09 2008 +0200 @@ -122,7 +122,8 @@ self.saved_headers = [] self.sent_headers = False self.length = None - self.server.application(env, self._start_response) + for chunk in self.server.application(env, self._start_response): + self._write(chunk) def send_headers(self): if not self.saved_status: