Hi,

The problem I am seeing does not resolve itself on subsequent calls to SSL_read -
if it fails to return -1 once, then repeated calls also return 0.  In other words,
on most occassions when the socket closes it returns -1 immediately, but sometimes
it repeatedly returns 0.

If anyone could explain how to persuade SSL to do blocking reads that would give
me a work-round.

You mention using select - I have *not* been calling select.  I presumed that:

(a) Because of blocks/internal buffering select would be unreliable (there may be
no decrypted data even if some encrypted data are available - if less than a block
is present, for example).

(b) SSL_read (and BIO in general) is non-blocking and self-contained.

Should I be using select anyway?

Cheers,
Andrew

Bodo Moeller wrote:

> > What can be regarded as odd is that SSL_read() can return 0 even if it
> > hasn't reached EOF.
>
> This can happen only under strange circumstances, I think.
> Namely, ssl2_read will return 0 if it has read an empty data block.
> Probably it should really return -1 and have things arranged so that
> SSL_get_error tells the application to select() on readability;
> or it should directly start the next read(), which will possibly
> block.





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

Reply via email to