Jasper Li
Jasper Li

Reputation: 101

What's the difference between BIO_pending() and BIO_wpending() in openssl?

I checked the BIO pending on Openssl man page.
Failed to get the difference between *_pening and *_wpending. Could you share the difference.
Thanks.

 int BIO_pending(BIO *b);
 int BIO_wpending(BIO *b);
 size_t BIO_ctrl_pending(BIO *b);
 size_t BIO_ctrl_wpending(BIO *b);

Upvotes: 1

Views: 455

Answers (1)

Matt Caswell
Matt Caswell

Reputation: 9392

BIO_pending returns the amount of data waiting in the BIO's "read" buffer i.e. stuff that it has already read internally but has not yet been returned to the application via a BIO_read() call (or similar).

BIO_wpending returns the amount of data waiting in the BIO's "write" buffer, i.e. stuff that the application has asked the BIO to write via a call to BIO_write (or similar), but the BIO hasn't actually written yet.

Upvotes: 2

Related Questions