On Wed, Dec 03, 2003, Dr. Stephen Henson wrote:

> Actually this isn't a bug. A memory BIO can behave a bit like 
> a pipe in that
> after all data has been read it can signal that more data is 
> available: in
> this case when more data is written to it.
> 
> Sometimes however when all data has been read from a BIO no 
> more data is
> available and it really is EOF. 
> 
> With a memory BIO there's no way to automatically decide this and the
> application has to decide whether end of data should signal a 
> retry or EOF.
> 
> The function BIO_set_mem_eof_return() is used to signal this: 
> so try setting
> BIO_set_mem_eof_return(bio, 0) and all should be as expected. See the
> BIO_s_mem() manual page for more details.
> 
> The reason this worked in previous versions of OpenSSL is 
> that the base64 BIO
> had a bug which didn't work properly with non blocking I/O. 
> The side effect is
> that it now has to have a correct EOF indication from the 
> relevant BIO.

Thanks for the quick reply; this makes sense.  However, from a design
point of view, might it make more sense to have this be the default
behavior for a read-write memory BIO?  At least in my code, this is
basically the only way I use memory BIOs, and it would seem to be the
more intuitive behavior overall.  If someone wants to use a memory BIO
like a pipe, it seems reasonable to require a bit of additional setup.

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

Reply via email to