diff options
| author | Jakub Stasiak <jakub@stasiak.at> | 2014-11-11 22:38:30 +0000 |
|---|---|---|
| committer | Jakub Stasiak <jakub@stasiak.at> | 2014-11-11 22:47:09 +0000 |
| commit | e843a8ace3c2f37d2e47fc0b4a4dabd126411750 (patch) | |
| tree | c37533d832dc6ff6532fb4fc9c433ba1aa63ef6f /eventlet/wsgi.py | |
| parent | 67cde41d03c0bccb12fd7d5f6d7e155d6da95e40 (diff) | |
| download | eventlet-python3-clean-clean.tar.gz | |
Python 3 compat; Improve WSGI, WS, threading and testspython3-clean-clean
This includes:
* patching more tests to pass
* removing few unit tests which I think are redundant
* repeating SSL socket reads in a loop to read all data (I suspect this is
related to the fact that writelines is used in the server code there and
Python 3 writelines calls write/send repeatedly while on Python 2 it
calls it once; on one hand there's no guarantee that single recv/read
will return all data sent by the server, on the other hand it's quite
suspicious that the number of required reads seems to be connected to
the number of sends on the other side of the connection)
* working through Python 2/Python 3 threading and thread differences; the
lock code I used is the simplest way I could make the tests pass but
will likely need to be modified in order to match the original
This commit includes 6bcb1dc and closes GH #153
Diffstat (limited to 'eventlet/wsgi.py')
| -rw-r--r-- | eventlet/wsgi.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/eventlet/wsgi.py b/eventlet/wsgi.py index a17de17..1feb734 100644 --- a/eventlet/wsgi.py +++ b/eventlet/wsgi.py @@ -69,11 +69,13 @@ class Input(object): def __init__(self, rfile, content_length, + sock, wfile=None, wfile_line=None, chunked_input=False): self.rfile = rfile + self._sock = sock if content_length is not None: content_length = int(content_length) self.content_length = content_length @@ -193,7 +195,7 @@ class Input(object): return iter(self.read, b'') def get_socket(self): - return self.rfile._sock + return self._sock def set_hundred_continue_response_headers(self, headers, capitalize_response_headers=True): @@ -564,7 +566,7 @@ class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler): wfile_line = None chunked = env.get('HTTP_TRANSFER_ENCODING', '').lower() == 'chunked' env['wsgi.input'] = env['eventlet.input'] = Input( - self.rfile, length, wfile=wfile, wfile_line=wfile_line, + self.rfile, length, self.connection, wfile=wfile, wfile_line=wfile_line, chunked_input=chunked) env['eventlet.posthooks'] = [] |
