From 1ee01152b384d2aa1a854ec46749f45022229b53 Mon Sep 17 00:00:00 2001 From: benoitc Date: Fri, 12 Mar 2010 00:52:21 +0100 Subject: [PATCH] fix chuynked response --- gunicorn/http/response.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gunicorn/http/response.py b/gunicorn/http/response.py index 26eb3cdc..498f8e58 100644 --- a/gunicorn/http/response.py +++ b/gunicorn/http/response.py @@ -27,13 +27,11 @@ class Response(object): resp_head.extend(["%s: %s\r\n" % (n, v) for n, v in self.headers]) write(self._sock, "%s\r\n" % "".join(resp_head)) - last_chunk = None for chunk in list(self.data): + if chunk == "": break write(self._sock, chunk, self.chunked) - last_chunk = chunk if self.chunked: - if last_chunk or last_chunk is None: # send last chunk write_chunk(self._sock, "")