mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix chuynked response
This commit is contained in:
parent
5bb0734532
commit
1ee01152b3
@ -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, "")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user