Mercurial > hg-stable
comparison mercurial/hgweb/protocol.py @ 18346:6c2563b2c1c6
hgweb: use Content-Length for pushres
This prevents some unnecessary http connection close.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 15 Jan 2013 01:05:12 +0100 |
parents | f4522df38c65 |
children | e33b9b92a200 |
comparison
equal
deleted
inserted
replaced
18345:590056e0ec2f | 18346:6c2563b2c1c6 |
---|---|
80 elif isinstance(rsp, wireproto.streamres): | 80 elif isinstance(rsp, wireproto.streamres): |
81 req.respond(HTTP_OK, HGTYPE) | 81 req.respond(HTTP_OK, HGTYPE) |
82 return rsp.gen | 82 return rsp.gen |
83 elif isinstance(rsp, wireproto.pushres): | 83 elif isinstance(rsp, wireproto.pushres): |
84 val = p.restore() | 84 val = p.restore() |
85 req.respond(HTTP_OK, HGTYPE) | 85 rsp = '%d\n%s' % (rsp.res, val) |
86 return ['%d\n%s' % (rsp.res, val)] | 86 req.respond(HTTP_OK, HGTYPE, length=len(rsp)) |
87 return [rsp] | |
87 elif isinstance(rsp, wireproto.pusherr): | 88 elif isinstance(rsp, wireproto.pusherr): |
88 # drain the incoming bundle | 89 # drain the incoming bundle |
89 req.drain() | 90 req.drain() |
90 p.restore() | 91 p.restore() |
91 rsp = '0\n%s\n' % rsp.res | 92 rsp = '0\n%s\n' % rsp.res |