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
3272613SkrisI<read_ahead> flag is set, additional protocol bytes may have been
3372613Skrisread containing more TLS/SSL records; these are ignored by
3472613SkrisSSL_pending().
3572613Skris
3672613SkrisUp to OpenSSL 0.9.6, SSL_pending() does not check if the record type
3772613Skrisof pending data is application data.
3872613Skris
3972613Skris=head1 SEE ALSO
4072613Skris
4168651SkrisL<SSL_read(3)|SSL_read(3)>, L<ssl(3)|ssl(3)>
4268651Skris
4368651Skris=cut
44