changeset 12704:ca6e2adc3e4d

wireproto/http: drain the incoming bundle in case of errors
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 11 Oct 2010 12:47:11 -0500
parents 40bb5853fc4b
children d734b3470138
files mercurial/hgweb/protocol.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/protocol.py	Mon Oct 11 12:45:36 2010 -0500
+++ b/mercurial/hgweb/protocol.py	Mon Oct 11 12:47:11 2010 -0500
@@ -67,6 +67,8 @@
         req.respond(HTTP_OK, HGTYPE)
         return ['%d\n%s' % (rsp.res, val)]
     elif isinstance(rsp, wireproto.pusherr):
+        # drain the incoming bundle
+        req.drain()
         sys.stdout, sys.stderr = p.oldio
         rsp = '0\n%s\n' % rsp.res
         req.respond(HTTP_OK, HGTYPE, length=len(rsp))