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.
--- 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: