Hi,

I have found three bugs regarding read-ahead. I have found the bugs in
0.9.5a (I looked at 0.9.6-beta2 and it does not look like that they
have been corrected).

The first one is in ssl.h which makes it impossible to turn on
read-ahead with SSL_CTX_set_read_ahead().

#define SSL_CTX_set_read_ahead(ctx,m) \
        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,0,NULL)

should be:

#define SSL_CTX_set_read_ahead(ctx,m) \
        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL)

(replace '0' with 'm')


The second bug appears when calling SSL_set_read_ahead(c, 1) before
calling SSL_accept() or SSL_connect(). The read-ahead flag then gets
reinitialized with the default value for the SSL context (in
SSL_clear() which is called from SSL_accept/connect).


The third bug is that SSL_pending() sometimes does not indicate that
there are more available data when read ahead is enabled even though
plenty of more data already have been read from the socket. I believe
it is due to SSL_pending() only checking s->s3->rrec.length and not
checking if there are enough data in the read buffer for another
record. Maybe SSL_peek() should be called in SSL_pending() in order to
check that.

Regards,
Anders Gertz
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to