From e64c47475b863508e552b98223bbf151d77760b9 Mon Sep 17 00:00:00 2001 From: benoitc Date: Wed, 11 Aug 2010 11:31:35 +0200 Subject: [PATCH] fix issue #80 --- gunicorn/http/wsgi.py | 4 +++- gunicorn/workers/async.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index d34335e9..cb56a80f 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -62,6 +62,8 @@ def create(req, sock, client, server, cfg): if forward.find(",") >= 0: forward = forward.rsplit(",", 1)[1].strip() remote = forward.split(":") + if len(remote) < 2: + remote.append('80') if len(remote) == 1: remote.append('') else: @@ -109,7 +111,7 @@ def create(req, sock, client, server, cfg): key = 'HTTP_' + key.replace('-', '_') if key not in ('HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH'): environ[key] = value - + return resp, environ class Response(object): diff --git a/gunicorn/workers/async.py b/gunicorn/workers/async.py index fe1dd6a8..09341e00 100644 --- a/gunicorn/workers/async.py +++ b/gunicorn/workers/async.py @@ -80,6 +80,8 @@ class AsyncWorker(base.Worker): if req.should_close(): raise StopIteration() self.cfg.post_request(self, req) + except StopIteration: + raise except Exception, e: #Only send back traceback in HTTP in debug mode. if not self.debug: