Mercurial > hg
comparison mercurial/hgweb/hgweb_mod.py @ 13571:84bd3fd63afc
hgweb_mod: respond right away if the client specified 100-continue support
Clients that send 100-continue should make sure they really support
continue intelligently. In a later patch we'll introduce a capability so
new clients don't pay a performance penalty talking to old servers.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 07 Jan 2011 15:19:21 -0600 |
parents | 61a898576888 |
children | b51bf961b3cb |
comparison
equal
deleted
inserted
replaced
13570:617a87cb7eb2 | 13571:84bd3fd63afc |
---|---|
119 raise ErrorResponse(HTTP_NOT_FOUND) | 119 raise ErrorResponse(HTTP_NOT_FOUND) |
120 if cmd in perms: | 120 if cmd in perms: |
121 self.check_perm(req, perms[cmd]) | 121 self.check_perm(req, perms[cmd]) |
122 return protocol.call(self.repo, req, cmd) | 122 return protocol.call(self.repo, req, cmd) |
123 except ErrorResponse, inst: | 123 except ErrorResponse, inst: |
124 if cmd == 'unbundle': | 124 # A client that sends unbundle without 100-continue will |
125 # break if we respond early. | |
126 if (cmd == 'unbundle' and | |
127 req.env.get('HTTP_EXPECT', | |
128 '').lower() != '100-continue'): | |
125 req.drain() | 129 req.drain() |
126 req.respond(inst, protocol.HGTYPE) | 130 req.respond(inst, protocol.HGTYPE) |
127 return '0\n%s\n' % inst.message | 131 return '0\n%s\n' % inst.message |
128 | 132 |
129 # translate user-visible url structure to internal structure | 133 # translate user-visible url structure to internal structure |