On Sun, Aug 20, 2006 at 07:46:26PM +0200, Marek Marcola wrote:
> I've forget to pay your attention on other problem that may appear
> with code like:
> 
>   do {
>     ret = SSL_read(sslobject, buf, bufsz);
>     err = SSL_get_error(sslobject, ret);
>   } while (ret <= 0 && (err == SSL_ERROR_WANT_READ));
> 
> (of course I assume that WANT* works ok now). 
> 
> The problem is that depending on variable bufsz this loop
> may iterate some times getting application data from SSL layer
> and putting this data in the same place (overwriting existing).
> For example assume that in SSL layer we have 400 bytes ready to
> read and that bufsz is 100 bytes. This loop will iterate 4 times
> (and after this you will get WANT* error) placing every
> 100 bytes in the same place.
> At the end you will get only 100 last bytes from 400 ready to read.

  So what you are saying is that even though ret <= 0 and err ==
SSL_ERROR_WANT_READ, it is still possible that data has been placed 
in buf?

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

Reply via email to