Commits

David Andrzejewski committed 9c825f9

Simplified SSL_fileobject.recv().

This should be a better resolution for issue #1068.

Comments (0)

Files changed (1)

cherrypy/wsgiserver/ssl_pyopenssl.py

             if time.time() - start > self.ssl_timeout:
                 raise socket.timeout("timed out")
 
-    def recv(self, *args, **kwargs):
-        buf = []
-        r = super(SSL_fileobject, self).recv
-        while True:
-            data = self._safe_call(True, r, *args, **kwargs)
-            buf.append(data)
-            p = self._sock.pending()
-            if not p:
-                return "".join(buf)
-            elif len("".join(buf)) + p >= args[0]:
-                return "".join(buf)
+    def recv(self, size):
+        return self._safe_call(True, super(SSL_fileobject, self).recv, size)
 
     def sendall(self, *args, **kwargs):
         return self._safe_call(False, super(SSL_fileobject, self).sendall,