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

2011-06-09 Thread David Siroky
David Siroky 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 after the first call

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

2011-06-08 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

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

2011-06-08 Thread Antoine Pitrou
Antoine Pitrou 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() (or an eq

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

2011-06-08 Thread David Siroky
David Siroky 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 pr

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

2011-06-07 Thread Antoine Pitrou
Antoine Pitrou 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. -- nosy: +pitrou ___

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

2011-05-27 Thread David Siroky
New submission from David Siroky : 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(b"a" * 20) raises ssl.SSLError: [Errno 3] _ssl.c:1126: The operation did not complete (write) There