From 131954344872b7353a0ca8ae63f29846dc30a650 Mon Sep 17 00:00:00 2001 From: benoitc Date: Thu, 1 Mar 2012 08:02:15 +0100 Subject: [PATCH] use the cached app. --- examples/test.py | 4 ++-- gunicorn/http/wsgi.py | 2 +- gunicorn/workers/async.py | 2 +- gunicorn/workers/ggevent.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/test.py b/examples/test.py index e7f44955..cf55bf0d 100644 --- a/examples/test.py +++ b/examples/test.py @@ -14,8 +14,8 @@ def app(environ, start_response): """Simplest possible application object""" data = 'Hello, World!\n' status = '200 OK' - print("print to stdout in test app") - sys.stderr.write("stderr, print to stderr in test app\n") +# print("print to stdout in test app") +# sys.stderr.write("stderr, print to stderr in test app\n") response_headers = [ ('Content-type','text/plain'), ('Content-Length', str(len(data))), diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index 4cf833d8..571b13af 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -55,7 +55,7 @@ def create(req, sock, client, server, cfg): "REQUEST_METHOD": req.method, "QUERY_STRING": req.query, "RAW_URI": req.uri, - "SERVER_PROTOCOL": "HTTP/%s" % ".".join(map(str, req.version)), + "SERVER_PROTOCOL": "HTTP/%s" % ".".join(map(str, req.version)) } # authors should be aware that REMOTE_HOST and REMOTE_ADDR diff --git a/gunicorn/workers/async.py b/gunicorn/workers/async.py index d207e76f..d44ccc59 100644 --- a/gunicorn/workers/async.py +++ b/gunicorn/workers/async.py @@ -61,7 +61,7 @@ class AsyncWorker(base.Worker): self.log.info("Autorestarting worker after current request.") resp.force_close() self.alive = False - respiter = self.app.wsgi()(environ, resp.start_response) + respiter = self.wsgi(environ, resp.start_response) if respiter == ALREADY_HANDLED: return False try: diff --git a/gunicorn/workers/ggevent.py b/gunicorn/workers/ggevent.py index 0be159b6..4ad6ef32 100644 --- a/gunicorn/workers/ggevent.py +++ b/gunicorn/workers/ggevent.py @@ -56,7 +56,7 @@ class GeventWorker(AsyncWorker): pool = Pool(self.worker_connections) if self.server_class is not None: server = self.server_class( - self.socket, application=self.app.wsgi, spawn=pool, log=self.log, + self.socket, application=self.wsgi, spawn=pool, log=self.log, handler_class=self.wsgi_handler) else: server = StreamServer(self.socket, handle=self.handle, spawn=pool)