mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
always use TeeInput
This commit is contained in:
parent
1ee01152b3
commit
f53532a92e
@ -79,7 +79,8 @@ class Request(object):
|
|||||||
self._sock.send("HTTP/1.1 100 Continue\r\n\r\n")
|
self._sock.send("HTTP/1.1 100 Continue\r\n\r\n")
|
||||||
|
|
||||||
if not self.parser.content_len and not self.parser.is_chunked:
|
if not self.parser.content_len and not self.parser.is_chunked:
|
||||||
wsgi_input = StringIO()
|
wsgi_input = TeeInput(self._sock, self.parser, StringIO(),
|
||||||
|
self.conf)
|
||||||
content_length = "0"
|
content_length = "0"
|
||||||
else:
|
else:
|
||||||
wsgi_input = TeeInput(self._sock, self.parser, buf2, self.conf)
|
wsgi_input = TeeInput(self._sock, self.parser, buf2, self.conf)
|
||||||
|
|||||||
@ -150,6 +150,9 @@ class TeeInput(object):
|
|||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
def get_socket(self):
|
||||||
|
return self._sock.dup()
|
||||||
|
|
||||||
def _tee(self, length):
|
def _tee(self, length):
|
||||||
""" fetch partial body"""
|
""" fetch partial body"""
|
||||||
buf2 = self.buf
|
buf2 = self.buf
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user