summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wsgitools/scgi/forkpool.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/wsgitools/scgi/forkpool.py b/wsgitools/scgi/forkpool.py
index 12a82ff..252c455 100644
--- a/wsgitools/scgi/forkpool.py
+++ b/wsgitools/scgi/forkpool.py
@@ -44,10 +44,8 @@ class SocketFileWrapper:
"""
try:
while self.toread > 0:
- if self.toread > 4096:
- self._recv(4096)
- else:
- self._recv(self.toread)
+ if not self._recv(min(self.toread, 4096)):
+ return
except socket.error:
pass