> On 28 Jun 2016, at 17:50, Nikolaus Rath <nikol...@rath.org> wrote:
> 
> Hum. When using BIOs, does this mean that I can safely refill/read-out
> the BIO when getting SSLWantRead/SSLWantRead and then call the SSL
> function again, or do I need to keep track of the detailed io state
> again?
> 
> Best,
> -Nikolaus

If you get SSLWantRead it’s a signal that you’re waiting for more data from the 
socket: you shouldn’t expect to see SSLWantWrite in regular use with a BIO. You 
shove application data in: if you get no error, you write out as much as you 
can from the BIO. If you get WantRead, you make sure you go back to the socket 
because you need some data from it.

If you want to see what Twisted does, it’s in the TLSMemoryBIOProtocol class 
here: 
https://github.com/twisted/twisted/blob/trunk/twisted/protocols/tls.py#L216

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Cryptography-dev mailing list
Cryptography-dev@python.org
https://mail.python.org/mailman/listinfo/cryptography-dev

Reply via email to