189837Skris=pod
289837Skris
389837Skris=head1 NAME
489837Skris
589837SkrisSSL_want, SSL_want_nothing, SSL_want_read, SSL_want_write, SSL_want_x509_lookup - obtain state information TLS/SSL I/O operation
689837Skris
789837Skris=head1 SYNOPSIS
889837Skris
989837Skris #include <openssl/ssl.h>
1089837Skris
11160814Ssimon int SSL_want(const SSL *ssl);
12160814Ssimon int SSL_want_nothing(const SSL *ssl);
13160814Ssimon int SSL_want_read(const SSL *ssl);
14160814Ssimon int SSL_want_write(const SSL *ssl);
15160814Ssimon int SSL_want_x509_lookup(const SSL *ssl);
1689837Skris
1789837Skris=head1 DESCRIPTION
1889837Skris
1989837SkrisSSL_want() returns state information for the SSL object B<ssl>.
2089837Skris
2189837SkrisThe other SSL_want_*() calls are shortcuts for the possible states returned
2289837Skrisby SSL_want().
2389837Skris
2489837Skris=head1 NOTES
2589837Skris
2689837SkrisSSL_want() examines the internal state information of the SSL object. Its
2789837Skrisreturn values are similar to that of L<SSL_get_error(3)|SSL_get_error(3)>.
2889837SkrisUnlike L<SSL_get_error(3)|SSL_get_error(3)>, which also evaluates the
2989837Skriserror queue, the results are obtained by examining an internal state flag
3089837Skrisonly. The information must therefore only be used for normal operation under
3189837Skrisnon-blocking I/O. Error conditions are not handled and must be treated
3289837Skrisusing L<SSL_get_error(3)|SSL_get_error(3)>.
3389837Skris
3489837SkrisThe result returned by SSL_want() should always be consistent with
3589837Skristhe result of L<SSL_get_error(3)|SSL_get_error(3)>.
3689837Skris
3789837Skris=head1 RETURN VALUES
3889837Skris
3989837SkrisThe following return values can currently occur for SSL_want():
4089837Skris
4189837Skris=over 4
4289837Skris
4389837Skris=item SSL_NOTHING
4489837Skris
4589837SkrisThere is no data to be written or to be read.
4689837Skris
4789837Skris=item SSL_WRITING
4889837Skris
4989837SkrisThere are data in the SSL buffer that must be written to the underlying
5089837SkrisB<BIO> layer in order to complete the actual SSL_*() operation.
5189837SkrisA call to L<SSL_get_error(3)|SSL_get_error(3)> should return
5289837SkrisSSL_ERROR_WANT_WRITE.
5389837Skris
5489837Skris=item SSL_READING
5589837Skris
5689837SkrisMore data must be read from the underlying B<BIO> layer in order to
5789837Skriscomplete the actual SSL_*() operation.
5889837SkrisA call to L<SSL_get_error(3)|SSL_get_error(3)> should return
5989837SkrisSSL_ERROR_WANT_READ.
6089837Skris
6189837Skris=item SSL_X509_LOOKUP
6289837Skris
6389837SkrisThe operation did not complete because an application callback set by
6489837SkrisSSL_CTX_set_client_cert_cb() has asked to be called again.
6589837SkrisA call to L<SSL_get_error(3)|SSL_get_error(3)> should return
6689837SkrisSSL_ERROR_WANT_X509_LOOKUP.
6789837Skris
6889837Skris=back
6989837Skris
7089837SkrisSSL_want_nothing(), SSL_want_read(), SSL_want_write(), SSL_want_x509_lookup()
7189837Skrisreturn 1, when the corresponding condition is true or 0 otherwise.
7289837Skris
7389837Skris=head1 SEE ALSO
7489837Skris
7589837SkrisL<ssl(3)|ssl(3)>, L<err(3)|err(3)>, L<SSL_get_error(3)|SSL_get_error(3)>
7689837Skris
7789837Skris=cut
78