Commit 683fd2e8 authored by Ralf Schmitt's avatar Ralf Schmitt

pywsgi: fix HTTP/1.1 100 Continue

--HG--
extra : transplant_source : %ABb4%3F%065H%7D%2C%DC%B4L%FD%B7%FB%89%EAR.%83
parent f053bc9b
...@@ -52,6 +52,14 @@ class Input(object): ...@@ -52,6 +52,14 @@ class Input(object):
self.chunked_input = chunked_input self.chunked_input = chunked_input
self.chunk_length = -1 self.chunk_length = -1
def _discard(self):
if self.wfile is None and (self.position < (self.content_length or 0) or self.chunked_input):
# ## Read and discard body
while 1:
d = self.read(16384)
if not d:
break
def _do_read(self, reader, length=None): def _do_read(self, reader, length=None):
if self.wfile is not None: if self.wfile is not None:
## 100 Continue ## 100 Continue
...@@ -408,11 +416,7 @@ class WSGIHandler(object): ...@@ -408,11 +416,7 @@ class WSGIHandler(object):
finally: finally:
if hasattr(self.result, 'close'): if hasattr(self.result, 'close'):
self.result.close() self.result.close()
self.wsgi_input._discard()
if (self.wsgi_input.position < int(self.environ.get('CONTENT_LENGTH', 0))
or self.wsgi_input.chunked_input):
# ## Read and discard body
self.wsgi_input.read()
self.time_finish = time.time() self.time_finish = time.time()
self.log_request() self.log_request()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment