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

2011-06-09 Thread David Siroky
David Siroky sir...@dasir.cz added the comment: I didn't meant blocking as setblocking(True). I use select/poll but I can't use returned value from send() immediately since in Windows there are often needed more send rounds to actually know how much data was sent. E.g. in Linux I know it

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

2011-06-08 Thread David Siroky
David Siroky sir...@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

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

2011-06-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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. In normal non-blocking code you would use select()

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

2011-06-08 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12197 ___ ___

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

2011-06-07 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Which version of Python are you testing on? It works fine using 3.2 and 3.3 here, under Windows 7 64-bit. Anyway, I would suggest to batch your write in smaller chunks (say, 2048 bytes each). Also, you may try sendall() instead. --

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

2011-05-27 Thread David Siroky
New submission from David Siroky sir...@dasir.cz: Trying to send large bulk of data in MS Windows via non-blocking SSLSocket raises an exception but part of the data is delivered. E.g. ssl_socket.write(ba * 20) raises ssl.SSLError: [Errno 3] _ssl.c:1126: The operation did not complete