gtpc1m63 | Transmission Control Protocol/Internet Protocol |
The SSL_pending function returns the amount of data in the
current Secure Sockets Layer (SSL) data record that is immediately available
for reading on an SSL session.
Format
#include <openssl/ssl.h>
int SSL_pending(SSL *ssl)
- ssl
- A pointer to a token returned on the SSL_new call.
Normal Return
Returns the number of bytes that are pending, which can be zero.
Error Return
None.
Programming Considerations
- Application data for an SSL session flows in SSL data records. An
entire data record must be received from the network and processed by the SSL
code before any data in that data record can be passed to the application when
the SSL_read function is issued. If the amount of data in
the data record is greater than the buffer size specified on the
SSL_read function, only part of the data in the data record is
passed to the application. The remaining data in that data record is
pending and the amount of data that remains in the data record is the return
code for the SSL_pending function.
- If the SSL_pending function returns a return code of 0, it does
not necessarily mean that there is no data immediately available for reading
on the SSL session. A return code of 0 indicates that there is no more
data in the current SSL data record. However, more SSL data records may
have been received from the network already. If the
SSL_pending function returns a return code of 0, issue the
select function, passing the file descriptor of the socket to check
if the socket is readable. Readable means more data has been
received from the network on the socket.
If the socket is readable, it does not necessarily mean that application
data is available. The data on the socket could be SSL control
information (such as an alert) rather than application data. The
select function will also indicate that the socket is readable even
if a partial SSL data record was received from the network.
Examples
For sample SSL applications, go to http://www.ibm.com/tpf/pubs/tpfpubs.htm,
click SSL for the TPF 4.1 System: An Online User's
Guide, and click Examples from the left navigation
bar.
Related Information
- SSL_new
- SSL_read
- See TPF Transmission Control Protocol/Internet Protocol for
more information about the select function.