On Thu, May 28, 2009 at 3:32 PM, Victor Duchovni
<victor.ducho...@morganstanley.com> wrote:
> NO! You call
>
>        n = SSL_write(myssl, buffer, len);
>        err = SSL_get_error(myssl, n);
>
> "err" may be SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE, in which case
> you must retry the write again later, after there is room.
>
> On success (n>=0), or with WANT_READ/WANT_WRITE, arrange to move data from
> the network bio to the peer and from the peer to the network bio. This
> activity may be asynchronous if you are using non-blocking sockets with
> select/epoll/... in an event loop. In that case you mark the socket for
> read/write interest with appropriate callbacks.

So, in the case of WANT_READ or WANT_WRITE, I interact with the
network BIO through BIO_read and BIO_write, and recv()'d data gets
dumped into the BIO via BIO_write() and data to be sent should be
retrieved via BIO_read()?

In the case I get an epoll-triggered recv() from the socket, do I dump
that data into the BIO via BIO_write, and follow that with a
SSL_read()?

Once this is all over, I'll write a little piece of example code that
could be thrown into a document somewhere - I would be surprised if
this wasn't a common bit of misunderstanding for developers.

-Aaron
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to