mbedtls_ssl_check_pending() is only used within mbedTLS.
 
Symbols
loading...
Files
loading...
SummarySyntaxArgumentsRelatedReferences

Return value

0 if nothing's pending, 1 otherwise.

Notes

This is different in purpose and behaviour from \c mbedtls_ssl_get_bytes_avail in that it considers any kind of unprocessed data, not only unread application data. If \c mbedtls_ssl_get_bytes returns a non-zero value, this function will also signal pending data, but the converse does not hold. For example, in DTLS there might be further records waiting to be processed from the current underlying transport's datagram. If this function returns 1 (data pending), this does not imply that a subsequent call to \c mbedtls_ssl_read will provide any data; e.g., the unprocessed data might turn out to be an alert or a handshake message. This function is useful in the following situation: If the SSL/TLS module successfully returns from an operation - e.g. a handshake or an application record read - and you're awaiting incoming data next, you must not immediately idle on the underlying transport to have data ready, but you need to check the value of this function first. The reason is that the desired data might already be read but not yet processed. If, in contrast, a previous call to the SSL/TLS module returned MBEDTLS_ERR_SSL_WANT_READ, it is not necessary to call this function, as the latter error code entails that all internal data has been processed.

References

from examples