Thanks, this did the trick... Is there any way to indicate that a BIO does not support blocking IO? The exact situation is a bit odd, writes always block, but reads are always non-blocking... This seems to work fine, but I wonder if there is a way to indicate this behaviour to the user. For example BIOs that do not support non-blocking IO return an error from BIO_C_SET_NBIO.
Cheers, Keean. On 14 March 2011 00:15, Dr. Stephen Henson <st...@openssl.org> wrote: > On Sun, Mar 13, 2011, Keean Schupke wrote: > > > I have a custom BIO that I want to be non-blocking. Currently when > calling > > SSL_connect when using this BIO, it is returning -1, but > > calling SSL_get_error after does not return SSL_ERROR_WANT_READ > > nor SSL_ERROR_WANT_WRITE. > > > > How does my custom BIO indicate that it supports non blocking IO? > > > > I tried this: > > > > long gdbio_ctrl(BIO* const b, const int cmd, const long num, void* const > > ptr) { > > DBGPRINTF("BIO CTRL %d:%ld\n", cmd, num); > > switch(cmd) { > > case BIO_C_SET_NBIO: return 1; > > default: return 0; > > } > > } > > > > but it does not seem to be enough. > > > > > > You set the appropriate flags with BIO_set_retry_read(bio) or > BIO_set_retry_write(bio) and return -1 from the BIO read or write routine. > > Steve. > -- > Dr Stephen N. Henson. OpenSSL project core developer. > Commercial tech support now available see: http://www.openssl.org > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List openssl-users@openssl.org > Automated List Manager majord...@openssl.org >