I'm wanting to use SSL_pending() to determine how many bytes are
available to read.

My code is structured like this:

  1. Use select() on the file descriptor to see if it's readable.
  2. Use SSL_peek() to get 1 byte ("prime the pump").
  3. Use SSL_pending() to determine how many bytes are available.
  4. Use SSL_read() (repeatedly, if necessary) to read that many
bytes.
  5. Repeat steps 1-4 until select() or SSL_pending() return 0.

Is this the proper way to do this? It seems to work reliably for me. I
first tried it without step 2, but SSL_pending() always returned 0.

Thanks,
Reuben

--
There are ten kinds of people: those who understand binary, and those
who don't.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to