cpython: 3cf067049211 (original) (raw)

Mercurial > cpython

changeset 90506:3cf067049211

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. [#20951]

Antoine Pitrou solipsis@pitrou.net
date Tue, 29 Apr 2014 10:03:28 +0200
parents 817d86f627c4
children b0f6983d63df
files Doc/library/ssl.rst Lib/ssl.py Lib/test/test_ssl.py Misc/NEWS
diffstat 4 files changed, 54 insertions(+), 13 deletions(-)[+] [-] Doc/library/ssl.rst 21 Lib/ssl.py 12 Lib/test/test_ssl.py 30 Misc/NEWS 4

line wrap: on

line diff

--- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -1604,8 +1604,25 @@ the sockets in non-blocking mode and use Notes on non-blocking sockets ----------------------------- -When working with non-blocking sockets, there are several things you need -to be aware of: +SSL sockets behave slightly different than regular sockets in +non-blocking mode. When working with non-blocking sockets, there are +thus several things you need to be aware of: + +- Most :class:SSLSocket methods will raise either

--- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -664,17 +664,7 @@ class SSLSocket(socket): raise ValueError( "non-zero flags not allowed in calls to send() on %s" % self.class)

--- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -2547,6 +2547,36 @@ else: s.write(b"over\n") s.close()

+

+

+ def test_handshake_timeout(self): # Issue #5103: SSL handshake must respect the socket timeout server = socket.socket(socket.AF_INET)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -60,6 +60,10 @@ Core and Builtins Library ------- +- Issue #20951: SSLSocket.send() now raises either SSLWantReadError or