From 18aa937f2999743fd38920b281715bcaf956c96b Mon Sep 17 00:00:00 2001 From: Channel Cat Date: Mon, 17 Oct 2016 23:34:07 -0700 Subject: [PATCH] Fix slowdown --- sanic/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sanic/server.py b/sanic/server.py index 0a10f5fd..38bfadf1 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -122,8 +122,8 @@ class HttpProtocol(asyncio.Protocol): def write_response(self, response): try: - keep_alive = all( - [self.parser.should_keep_alive(), self.signal.stopped]) + keep_alive = self.parser.should_keep_alive() \ + and not self.signal.stopped self.transport.write( response.output( self.request.version, keep_alive, self.request_timeout))