Hello all, I've run into an issue I *think* is a bug (hence here on -dev as
opposed to -users) but I'll admit to possibly misunderstanding something
basic about usage...

Anyway, I'm on 0.9.8e and I've got an application that's doing a lot of
BIO_write's to a server via TLS.  When the write buffer is full, I get -1
from BIO_write (as expected) and BIO_should_retry returns "do retry" (as
expected), but when I go to write again a little bit later I get
SSL_R_BAD_WRITE_RETRY.  Now, the important part of this is I'm not writing
the same thing the second time... it's a different buffer, different
contents, different length.  In my application, the old buffer is stale and
the new one is more applicable so I'm not writing the same thing again even
though the previous write never got sent.  Now,
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER doesn't really help me, since the buffer
contents and length are different.  But since I'm not using
SSL_MODE_ENABLE_PARTIAL_WRITE, I'm not sure why any of this matters anyway?
Shouldn't the behavior of the BIO_write in the mode of no partial writes be
as if the BIO_write never happened if it fails?  I'm wondering why there's
leftover state causing this error?

I've looked over the code and it's not clear to me why I'm getting this
error.  In do_ssl3_write, ssl3_write_pending is only called (at the top) if
the wbuf.left is non-zero, and that's cleared upon a successful and full
BIO_write inside ssl3_write_pending.  At the bottom of do_ssl3_write, all
the variables are set for the ssl3_write_pending to pass the check at the
top, so unless BIO_write in ssl3_write_pending is responding with a partial
success, it's not clear how this can happen.

Any thoughts anyone?

As a side note, I thought I might avoid all this complexity by simply
checking BIO_ctrl_get_write_guarantee before calling the BIO_write in the
application, but alas it always returns 0.  Any idea why that is?

Thanks all, Mark.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to