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