From 83ebc51520c22c92d09df2dd7e96efa6e870deac Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 3 Dec 2009 10:38:33 +0100 Subject: [PATCH] fix first line parsing and make sure master is killed when ctrl-c is pressed --- gunicorn/arbiter.py | 2 ++ gunicorn/http/request.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index d19e7457..527a8038 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -76,6 +76,8 @@ class Arbiter(object): except OSError, e: if e.errno not in [errno.EAGAIN, errno.EINTR]: raise + except KeyboardInterrupt: + sys.exit() def listen(self, addr): for i in range(5): diff --git a/gunicorn/http/request.py b/gunicorn/http/request.py index 5352e94b..bd7488ca 100644 --- a/gunicorn/http/request.py +++ b/gunicorn/http/request.py @@ -185,7 +185,7 @@ class HTTPRequest(object): self.socket.close() def first_line(self, line): - method, path, version = line.split(" ") + method, path, version = line.strip().split(" ") self.version = version.strip() self.method = method.upper() self.path = path