xref: /minix3/crypto/external/bsd/openssl/dist/doc/ssl/SSL_pending.pod (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ebfedea0SLionel Sambuc=pod
2ebfedea0SLionel Sambuc
3ebfedea0SLionel Sambuc=head1 NAME
4ebfedea0SLionel Sambuc
5ebfedea0SLionel SambucSSL_pending - obtain number of readable bytes buffered in an SSL object
6ebfedea0SLionel Sambuc
7ebfedea0SLionel Sambuc=head1 SYNOPSIS
8ebfedea0SLionel Sambuc
9ebfedea0SLionel Sambuc #include <openssl/ssl.h>
10ebfedea0SLionel Sambuc
11ebfedea0SLionel Sambuc int SSL_pending(const SSL *ssl);
12ebfedea0SLionel Sambuc
13ebfedea0SLionel Sambuc=head1 DESCRIPTION
14ebfedea0SLionel Sambuc
15ebfedea0SLionel SambucSSL_pending() returns the number of bytes which are available inside
16ebfedea0SLionel SambucB<ssl> for immediate read.
17ebfedea0SLionel Sambuc
18ebfedea0SLionel Sambuc=head1 NOTES
19ebfedea0SLionel Sambuc
20ebfedea0SLionel SambucData are received in blocks from the peer. Therefore data can be buffered
21ebfedea0SLionel Sambucinside B<ssl> and are ready for immediate retrieval with
22ebfedea0SLionel SambucL<SSL_read(3)|SSL_read(3)>.
23ebfedea0SLionel Sambuc
24ebfedea0SLionel Sambuc=head1 RETURN VALUES
25ebfedea0SLionel Sambuc
26ebfedea0SLionel SambucThe number of bytes pending is returned.
27ebfedea0SLionel Sambuc
28ebfedea0SLionel Sambuc=head1 BUGS
29ebfedea0SLionel Sambuc
30ebfedea0SLionel SambucSSL_pending() takes into account only bytes from the TLS/SSL record
31ebfedea0SLionel Sambucthat is currently being processed (if any).  If the B<SSL> object's
32*0a6a1f1dSLionel SambucI<read_ahead> flag is set (see
33*0a6a1f1dSLionel SambucL<SSL_CTX_set_read_ahead(3)|SSL_CTX_set_read_ahead(3)>), additional protocol
34*0a6a1f1dSLionel Sambucbytes may have been read containing more TLS/SSL records; these are ignored by
35ebfedea0SLionel SambucSSL_pending().
36ebfedea0SLionel Sambuc
37ebfedea0SLionel SambucUp to OpenSSL 0.9.6, SSL_pending() does not check if the record type
38ebfedea0SLionel Sambucof pending data is application data.
39ebfedea0SLionel Sambuc
40ebfedea0SLionel Sambuc=head1 SEE ALSO
41ebfedea0SLionel Sambuc
42*0a6a1f1dSLionel SambucL<SSL_read(3)|SSL_read(3)>,
43*0a6a1f1dSLionel SambucL<SSL_CTX_set_read_ahead(3)|SSL_CTX_set_read_ahead(3)>, L<ssl(3)|ssl(3)>
44ebfedea0SLionel Sambuc
45ebfedea0SLionel Sambuc=cut
46