diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-22 15:09:31 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-22 15:09:31 (GMT) |
commit | a06bfd87da41d0a8810b3fd911d7b93ebdaa8ded (patch) | |
tree | f6206b79540f9fb28efd8eb7aa4ce2c4645153ea /Lib | |
parent | abdb21a3a89e0fed89e361d86990c90a998ac9ec (diff) | |
download | cpython-a06bfd87da41d0a8810b3fd911d7b93ebdaa8ded.zip cpython-a06bfd87da41d0a8810b3fd911d7b93ebdaa8ded.tar.gz cpython-a06bfd87da41d0a8810b3fd911d7b93ebdaa8ded.tar.bz2 |
Merged revisions 79287,79289 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r79287 | antoine.pitrou | 2010-03-22 15:49:10 +0100 (lun., 22 mars 2010) | 13 lines
Merged revisions 79226,79286 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79226 | antoine.pitrou | 2010-03-21 20:33:38 +0100 (dim., 21 mars 2010) | 4 lines
Issue #3890: Fix recv() and recv_into() on non-blocking SSL sockets.
........
r79286 | antoine.pitrou | 2010-03-22 15:41:48 +0100 (lun., 22 mars 2010) | 3 lines
Fix an occasional test_ftplib failure, following r79226.
........
................
r79289 | antoine.pitrou | 2010-03-22 16:07:09 +0100 (lun., 22 mars 2010) | 3 lines
Fix a blunder in r79287. This part is, obviously, poorly tested (if at all).
................
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/ssl.py | 23 |
1 files changed, 4 insertions, 19 deletions
@@ -240,16 +240,9 @@ class SSLSocket(socket): if self._sslobj: if flags != 0: raise ValueError( - "non-zero flags not allowed in calls to recv_into() on %s" % - self.__class__) - while True: - try: - return self.read(buflen) - except SSLError as x: - if x.args[0] == SSL_ERROR_WANT_READ: - continue - else: - raise x + "non-zero flags not allowed in calls to recv() on %s" % + self.__class__) + return self.read(buflen) else: return socket.recv(self, buflen, flags) @@ -264,15 +257,7 @@ class SSLSocket(socket): raise ValueError( "non-zero flags not allowed in calls to recv_into() on %s" % self.__class__) - while True: - try: - v = self.read(nbytes, buffer) - return v - except SSLError as x: - if x.args[0] == SSL_ERROR_WANT_READ: - continue - else: - raise x + return self.read(nbytes, buffer) else: return socket.recv_into(self, buffer, nbytes, flags) |