xref: /onnv-gate/usr/src/common/openssl/doc/ssl/SSL_pending.pod (revision 2175:b0b2f052a486)
1*2175Sjp161948=pod
2*2175Sjp161948
3*2175Sjp161948=head1 NAME
4*2175Sjp161948
5*2175Sjp161948SSL_pending - obtain number of readable bytes buffered in an SSL object
6*2175Sjp161948
7*2175Sjp161948=head1 SYNOPSIS
8*2175Sjp161948
9*2175Sjp161948 #include <openssl/ssl.h>
10*2175Sjp161948
11*2175Sjp161948 int SSL_pending(const SSL *ssl);
12*2175Sjp161948
13*2175Sjp161948=head1 DESCRIPTION
14*2175Sjp161948
15*2175Sjp161948SSL_pending() returns the number of bytes which are available inside
16*2175Sjp161948B<ssl> for immediate read.
17*2175Sjp161948
18*2175Sjp161948=head1 NOTES
19*2175Sjp161948
20*2175Sjp161948Data are received in blocks from the peer. Therefore data can be buffered
21*2175Sjp161948inside B<ssl> and are ready for immediate retrieval with
22*2175Sjp161948L<SSL_read(3)|SSL_read(3)>.
23*2175Sjp161948
24*2175Sjp161948=head1 RETURN VALUES
25*2175Sjp161948
26*2175Sjp161948The number of bytes pending is returned.
27*2175Sjp161948
28*2175Sjp161948=head1 BUGS
29*2175Sjp161948
30*2175Sjp161948SSL_pending() takes into account only bytes from the TLS/SSL record
31*2175Sjp161948that is currently being processed (if any).  If the B<SSL> object's
32*2175Sjp161948I<read_ahead> flag is set, additional protocol bytes may have been
33*2175Sjp161948read containing more TLS/SSL records; these are ignored by
34*2175Sjp161948SSL_pending().
35*2175Sjp161948
36*2175Sjp161948Up to OpenSSL 0.9.6, SSL_pending() does not check if the record type
37*2175Sjp161948of pending data is application data.
38*2175Sjp161948
39*2175Sjp161948=head1 SEE ALSO
40*2175Sjp161948
41*2175Sjp161948L<SSL_read(3)|SSL_read(3)>, L<ssl(3)|ssl(3)>
42*2175Sjp161948
43*2175Sjp161948=cut
44