> Hi,

> On 8/16/06, David Schwartz <[EMAIL PROTECTED]> wrote:
> > [...]  The SSL engine may have already read the data and your
> > 'select' may block forever. You should only wait for 'select'
> to give you
> > read hit before calling SSL_read if your last SSL operation returned a
> > WANT_READ indication.

> According SSL_read manual [1], in non-blocking mode SSL_read() can
> return SSL_ERROR_WANT_WRITE. In this, must I put the fd in the write
> set of select? Is that right?

        Yes. That means that the SSL engine cannot give you any data from the 
other
side until it can write something to the other side (which it could not do
at that time or it would have done it). So you should add the socket to the
'select' set for writing if you are using 'select' and retry when you get a
hit.

        It is very rare that this would happen, and off-hand I can't think of 
any
circumstances (assuming you don't shrink the socket send buffer). But it
would not be good practice to assume that it will never happen.

        DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to