[issue8240] ssl.SSLSocket.write may fail on non-blocking sockets

Cyril report at bugs.python.org
Wed Apr 7 13:49:44 CEST 2010


Cyril <cbay at excellency.fr> added the comment:

Here is a patch that implements SSLSocket.get_mode/set_mode, with the SSL_MODE_ENABLE_PARTIAL_WRITE and SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER constants defined in the ssl module.

The patch contains a test case and documentation. It's made against trunk 44327 and also applies nicely with --fuzz=3 on a 2.6.5.

There are no compatibility issues as no specific mode is set by default. It's up to the application to call SSLSocket.set_mode before use. I've tested my own use case with a set_mode(SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER), it works nicely.

----------
Added file: http://bugs.python.org/file16800/ssl_mode.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8240>
_______________________________________


More information about the Python-bugs-list mailing list