diff options
author | Helmut Grohne <helmut@subdivi.de> | 2012-03-17 20:16:12 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2012-03-17 20:16:12 +0100 |
commit | 4408cef2a6d161bc2af77412920ade8bab648dbd (patch) | |
tree | 5de863eb88e43117004730dc7f1bd56be5723305 /wsgitools/scgi/forkpool.py | |
parent | 492606108a2a5565efc39aed3b56f2e4a6f3c945 (diff) | |
download | wsgitools-4408cef2a6d161bc2af77412920ade8bab648dbd.tar.gz |
deduplicate scgi.{asynchronous,forkpool}
Diffstat (limited to 'wsgitools/scgi/forkpool.py')
-rw-r--r-- | wsgitools/scgi/forkpool.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/wsgitools/scgi/forkpool.py b/wsgitools/scgi/forkpool.py index 39c9dfd..d4e67d4 100644 --- a/wsgitools/scgi/forkpool.py +++ b/wsgitools/scgi/forkpool.py @@ -12,6 +12,8 @@ import sys import errno import signal +from wsgitools.scgi import _convert_environ + if sys.version_info[0] >= 3: def exc_info_for_raise(exc_info): return exc_info[0](exc_info[1]).with_traceback(exc_info[2]) @@ -431,21 +433,10 @@ class SCGIServer: con.close() return + _convert_environ(environ, multiprocess=True) sfw = SocketFileWrapper(con, int(environ["CONTENT_LENGTH"])) - environ.update({ - "wsgi.version": (1, 0), - "wsgi.input": sfw, - "wsgi.errors": self.error, - "wsgi.url_scheme": "http", - "wsgi.multithread": False, - "wsgi.multiprocess": True, - "wsgi.run_once": False}) - if environ.get("HTTPS", "no").lower() in ('yes', 'y', '1'): - environ["wsgi.url_scheme"] = "https" - if "HTTP_CONTENT_TYPE" in environ: - environ["CONTENT_TYPE"] = environ.pop("HTTP_CONTENT_TYPE") - if "HTTP_CONTENT_LENGTH" in environ: - del environ["HTTP_CONTENT_LENGTH"] # TODO: better way? + environ["wsgi.input"] = sfw + environ["wsgi.errors"] = self.error result = self.wsgiapp(environ, start_response) assert hasattr(result, "__iter__") |