[issue12197] non-blocking SSL write in Windows sends large data but raises exception

David Siroky report at bugs.python.org
Wed Jun 8 11:24:35 CEST 2011


David Siroky <siroky at dasir.cz> added the comment:

Sorry, I attached wrong example version. It uses repeated sslsock.write() of the same buffer after catching SSL_ERROR_WANT_WRITE. It delivers the full block but this is a blocking operation.

I'm troubled with non-blocking writes. But as I dig deeper into the problem it looks like an inconsistency in OpenSSL (Linux vs. MSW). In Linux sslsock.write() always (as far as I can tell) sends some or all of the data and returns the amount. Like the plain socket.send(). In Windows it raises an exception if the data is larger then some uncertain size (mostly 16kB).

I'm working on snakeMQ asynchronous messaging library where the "packeter" layer relies on the sock.send() returning actual amount of sent bytes. This is not working in Windows if the link uses SSL.

Tested on WinXP, py2.6, py3.2.

----------
Added file: http://bugs.python.org/file22280/ssl_sock_test_fix.py

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


More information about the Python-bugs-list mailing list