--- a/mercurial/hgweb/protocol.py Tue Jan 15 01:05:12 2013 +0100
+++ b/mercurial/hgweb/protocol.py Tue Jan 15 01:07:03 2013 +0100
@@ -75,24 +75,24 @@
p = webproto(req, repo.ui)
rsp = wireproto.dispatch(repo, p, cmd)
if isinstance(rsp, str):
- req.respond(HTTP_OK, HGTYPE, length=len(rsp))
- return [rsp]
+ req.respond(HTTP_OK, HGTYPE, body=rsp)
+ return []
elif isinstance(rsp, wireproto.streamres):
req.respond(HTTP_OK, HGTYPE)
return rsp.gen
elif isinstance(rsp, wireproto.pushres):
val = p.restore()
rsp = '%d\n%s' % (rsp.res, val)
- req.respond(HTTP_OK, HGTYPE, length=len(rsp))
- return [rsp]
+ req.respond(HTTP_OK, HGTYPE, body=rsp)
+ return []
elif isinstance(rsp, wireproto.pusherr):
# drain the incoming bundle
req.drain()
p.restore()
rsp = '0\n%s\n' % rsp.res
- req.respond(HTTP_OK, HGTYPE, length=len(rsp))
- return [rsp]
+ req.respond(HTTP_OK, HGTYPE, body=rsp)
+ return []
elif isinstance(rsp, wireproto.ooberror):
rsp = rsp.message
- req.respond(HTTP_OK, HGERRTYPE, length=len(rsp))
- return [rsp]
+ req.respond(HTTP_OK, HGERRTYPE, body=rsp)
+ return []