From 615c6a692703d3f6376bcffca2c0cff147196a0c Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 21 Jan 2010 14:15:21 +0100 Subject: [PATCH] speed gunicorn. Don't try to display requests log in info mode. --- gunicorn/http/request.py | 4 ++-- gunicorn/util.py | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/gunicorn/http/request.py b/gunicorn/http/request.py index 13fad71d..31678559 100644 --- a/gunicorn/http/request.py +++ b/gunicorn/http/request.py @@ -75,9 +75,9 @@ class HttpRequest(object): if i != -1: break - self.log.info("%s", self.parser.status) + self.log.debug("%s", self.parser.status) - self.log.info("Got headers:\n%s" % headers) + self.log.debug("Got headers:\n%s" % headers) if self.parser.headers_dict.get('Except', '').lower() == "100-continue": self.socket.send("100 Continue\n") diff --git a/gunicorn/util.py b/gunicorn/util.py index 828392f9..c3ac3789 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -32,18 +32,12 @@ def close(sock): """ socket.close() doesn't *really* close if there's another reference to it in the TCP/IP stack. (trick from twisted)""" - try: - sock.shutdown(2) - except socket.error: - pass try: sock.close() except socket.error: pass - - del sock -def read_partial(sock, length): +def read_partial(sock, length): while True: try: ret = select.select([sock.fileno()], [], [], 0)