diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-04-29 08:03:28 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-04-29 08:03:28 (GMT) |
commit | b4bebdafe354f68a9b952772da109cccd73f6577 (patch) | |
tree | 939614adab3160c1c9d54ba6975b326a2cdd31b9 /Lib/ssl.py | |
parent | 727a463aa624931a89c796bfa4fe5711e2c403ff (diff) | |
download | cpython-b4bebdafe354f68a9b952772da109cccd73f6577.zip cpython-b4bebdafe354f68a9b952772da109cccd73f6577.tar.gz cpython-b4bebdafe354f68a9b952772da109cccd73f6577.tar.bz2 |
Issue #20951: SSLSocket.send() now raises either SSLWantReadError or SSLWantWriteError on a non-blocking socket if the operation would block. Previously, it would return 0.
Patch by Nikolaus Rath.
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r-- | Lib/ssl.py | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -664,17 +664,7 @@ class SSLSocket(socket): raise ValueError( "non-zero flags not allowed in calls to send() on %s" % self.__class__) - try: - v = self._sslobj.write(data) - except SSLError as x: - if x.args[0] == SSL_ERROR_WANT_READ: - return 0 - elif x.args[0] == SSL_ERROR_WANT_WRITE: - return 0 - else: - raise - else: - return v + return self._sslobj.write(data) else: return socket.send(self, data, flags) |