mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-02 18:51:31 +08:00
always use TeeInput
This commit is contained in:
parent
1ee01152b3
commit
f53532a92e
@ -70,8 +70,8 @@ class Request(object):
|
|||||||
buf.write(data)
|
buf.write(data)
|
||||||
buf2 = self.parser.filter_headers(headers, buf)
|
buf2 = self.parser.filter_headers(headers, buf)
|
||||||
if buf2:
|
if buf2:
|
||||||
break
|
break
|
||||||
|
|
||||||
self.log.debug("%s", self.parser.status)
|
self.log.debug("%s", self.parser.status)
|
||||||
self.log.debug("Headers:\n%s" % headers)
|
self.log.debug("Headers:\n%s" % headers)
|
||||||
|
|
||||||
@ -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)
|
||||||
|
|||||||
@ -148,7 +148,10 @@ class TeeInput(object):
|
|||||||
__next__ = next
|
__next__ = next
|
||||||
|
|
||||||
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"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user