168651Skris=pod
268651Skris
368651Skris=head1 NAME
468651Skris
568651SkrisSSL_pending - obtain number of readable bytes buffered in an SSL object
668651Skris
768651Skris=head1 SYNOPSIS
868651Skris
968651Skris #include <openssl/ssl.h>
1068651Skris
11160814Ssimon int SSL_pending(const SSL *ssl);
1268651Skris
1368651Skris=head1 DESCRIPTION
1468651Skris
1568651SkrisSSL_pending() returns the number of bytes which are available inside
1668651SkrisB<ssl> for immediate read.
1768651Skris
1868651Skris=head1 NOTES
1968651Skris
2068651SkrisData are received in blocks from the peer. Therefore data can be buffered
2168651Skrisinside B<ssl> and are ready for immediate retrieval with
2268651SkrisL<SSL_read(3)|SSL_read(3)>.
2368651Skris
2468651Skris=head1 RETURN VALUES
2568651Skris
2668651SkrisThe number of bytes pending is returned.
2768651Skris
2872613Skris=head1 BUGS
2972613Skris
3072613SkrisSSL_pending() takes into account only bytes from the TLS/SSL record
3172613Skristhat is currently being processed (if any).  If the B<SSL> object's
32280304SjkimI<read_ahead> flag is set (see
33280304SjkimL<SSL_CTX_set_read_ahead(3)|SSL_CTX_set_read_ahead(3)>), additional protocol
34280304Sjkimbytes may have been read containing more TLS/SSL records; these are ignored by
3572613SkrisSSL_pending().
3672613Skris
3772613SkrisUp to OpenSSL 0.9.6, SSL_pending() does not check if the record type
3872613Skrisof pending data is application data.
3972613Skris
4072613Skris=head1 SEE ALSO
4172613Skris
42280304SjkimL<SSL_read(3)|SSL_read(3)>,
43280304SjkimL<SSL_CTX_set_read_ahead(3)|SSL_CTX_set_read_ahead(3)>, L<ssl(3)|ssl(3)>
4468651Skris
4568651Skris=cut
46