summaryrefslogtreecommitdiff
path: root/wsgitools/scgi
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools/scgi')
-rw-r--r--wsgitools/scgi/asynchronous.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/wsgitools/scgi/asynchronous.py b/wsgitools/scgi/asynchronous.py
index 51349a0..9510b4d 100644
--- a/wsgitools/scgi/asynchronous.py
+++ b/wsgitools/scgi/asynchronous.py
@@ -145,10 +145,11 @@ class SCGIConnection(asyncore.dispatcher):
assert self.state >= SCGIConnection.REQ
if len(self.outbuff) < self.BLOCK_SIZE:
for data in self.wsgihandler:
- self.outbuff += data
- if len(self.outbuff) >= self.BLOCK_SIZE:
+ if data:
self._try_send_headers()
- break
+ self.outbuff += data
+ if len(self.outbuff) >= self.BLOCK_SIZE:
+ break
if len(self.outbuff) == 0:
if hasattr(self.wsgihandler, "close"):
self.wsgihandler.close()