diff options
Diffstat (limited to 'wsgitools/scgi/forkpool.py')
-rw-r--r-- | wsgitools/scgi/forkpool.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/wsgitools/scgi/forkpool.py b/wsgitools/scgi/forkpool.py index 8d56178..12a82ff 100644 --- a/wsgitools/scgi/forkpool.py +++ b/wsgitools/scgi/forkpool.py @@ -25,8 +25,11 @@ class SocketFileWrapper: internal method for receiving and counting incoming data @raise socket.error: """ + toread = min(size, self.toread) + if not toread: + return "" try: - data = self.sock.recv(min(size, self.toread)) + data = self.sock.recv(toread) except socket.error, why: if why[0] in (errno.ECONNRESET, errno.ENOTCONN, errno.ESHUTDOWN): data = "" |