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