always use TeeInput

This commit is contained in:
benoitc 2010-03-12 14:15:21 +01:00
parent 1ee01152b3
commit f53532a92e
2 changed files with 8 additions and 4 deletions

View File

@ -79,7 +79,8 @@ class Request(object):
self._sock.send("HTTP/1.1 100 Continue\r\n\r\n")
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"
else:
wsgi_input = TeeInput(self._sock, self.parser, buf2, self.conf)

View File

@ -150,6 +150,9 @@ class TeeInput(object):
def __iter__(self):
return self
def get_socket(self):
return self._sock.dup()
def _tee(self, length):
""" fetch partial body"""
buf2 = self.buf