# HG changeset patch # User Mads Kiilerich # Date 1358208312 -3600 # Node ID 3fbdbeab38cc1fec9df1d1b0ed4018db5a54cb2c # Parent c0d63e1884a3fc7bbf59988beac703f9408b7aef hgweb: don't pass empty response chunks on hgweb internals will often produce empty writes - especially when returning compressed data. hgweb is no middleware application and there is thus no reason to pass them on to be processed in other layers. diff -r c0d63e1884a3 -r 3fbdbeab38cc mercurial/hgweb/request.py --- a/mercurial/hgweb/request.py Tue Jan 15 01:05:12 2013 +0100 +++ b/mercurial/hgweb/request.py Tue Jan 15 01:05:12 2013 +0100 @@ -105,11 +105,12 @@ self.headers = [] def write(self, thing): - try: - self.server_write(thing) - except socket.error, inst: - if inst[0] != errno.ECONNRESET: - raise + if thing: + try: + self.server_write(thing) + except socket.error, inst: + if inst[0] != errno.ECONNRESET: + raise def writelines(self, lines): for line in lines: