Patchwork D2748: hgweb: remove wsgirequest.read()

login
register
mail settings
Submitter phabricator
Date March 10, 2018, 8:03 p.m.
Message ID <d7504aa65f7ab4ff9b30b00a206b80a3@localhost.localdomain>
Download mbox | patch
Permalink /patch/29261/
State Not Applicable
Headers show

Comments

phabricator - March 10, 2018, 8:03 p.m.
indygreg updated this revision to Diff 6828.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2748?vs=6754&id=6828

REVISION DETAIL
  https://phab.mercurial-scm.org/D2748

AFFECTED FILES
  mercurial/hgweb/request.py
  mercurial/wireprotoserver.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -83,7 +83,7 @@ 
         postlen = int(self._req.headers.get(b'X-HgArgs-Post', 0))
         if postlen:
             args.update(urlreq.parseqs(
-                self._wsgireq.read(postlen), keep_blank_values=True))
+                self._wsgireq.inp.read(postlen), keep_blank_values=True))
             return args
 
         argvalue = decodevaluefromheaders(self._req, b'X-HgArg')
@@ -97,7 +97,7 @@ 
         # If httppostargs is used, we need to read Content-Length
         # minus the amount that was consumed by args.
         length -= int(self._req.headers.get(b'X-HgArgs-Post', 0))
-        for s in util.filechunkiter(self._wsgireq, limit=length):
+        for s in util.filechunkiter(self._wsgireq.inp, limit=length):
             fp.write(s)
 
     @contextlib.contextmanager
diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py
--- a/mercurial/hgweb/request.py
+++ b/mercurial/hgweb/request.py
@@ -249,9 +249,6 @@ 
     def __iter__(self):
         return iter([])
 
-    def read(self, count=-1):
-        return self.inp.read(count)
-
     def drain(self):
         '''need to read all data from request, httplib is half-duplex'''
         length = int(self.env.get('CONTENT_LENGTH') or 0)