Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG7066617187c1: hgweb: document continuereader
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
durin42 |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/hgweb/common.py (7 lines) |
message = _statusmessage(code) | message = _statusmessage(code) | ||||
Exception.__init__(self, pycompat.sysstr(message)) | Exception.__init__(self, pycompat.sysstr(message)) | ||||
self.code = code | self.code = code | ||||
if headers is None: | if headers is None: | ||||
headers = [] | headers = [] | ||||
self.headers = headers | self.headers = headers | ||||
class continuereader(object): | class continuereader(object): | ||||
"""File object wrapper to handle HTTP 100-continue. | |||||
This is used by servers so they automatically handle Expect: 100-continue | |||||
request headers. On first read of the request body, the 100 Continue | |||||
response is sent. This should trigger the client into actually sending | |||||
the request body. | |||||
""" | |||||
def __init__(self, f, write): | def __init__(self, f, write): | ||||
self.f = f | self.f = f | ||||
self._write = write | self._write = write | ||||
self.continued = False | self.continued = False | ||||
def read(self, amt=-1): | def read(self, amt=-1): | ||||
if not self.continued: | if not self.continued: | ||||
self.continued = True | self.continued = True |