Skip to content

Commit

Permalink
QUIC: Update documentation for SSL_get_event_timeout
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #20879)
  • Loading branch information
hlandau authored and t8m committed May 29, 2023
1 parent 7ea4971 commit a28ac61
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions doc/man3/SSL_get_event_timeout.pod
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,38 @@ SSL_get_event_timeout - determine when an SSL object next needs to be ticked

#include <openssl/ssl.h>

int SSL_get_event_timeout(SSL *s, struct timeval *tv);
int SSL_get_event_timeout(SSL *s, struct timeval *tv, int *is_infinite);

=head1 DESCRIPTION

SSL_get_event_timeout() determines when the SSL object next needs to perform
internal processing due to the passage of time.

Calling SSL_get_event_timeout() results in I<*tv> being written with an amount of
time left before the SSL object needs to be ticked. If the SSL object needs to
be ticked immediately, it is set to zero; if the SSL object currently does not
need to be ticked at any point in the future, I<tv->tv_sec> is set to -1,
representing infinity.
All arguments are required; I<tv> and I<is_infinite> must be non-NULL.

Upon the successful return of SSL_get_event_timeout(), one of the following
cases applies:

=over 4

=item

The SSL object has events which need to be handled immediately; I<*tv> is set to
zero and I<*is_infinite> is set to 0.

=item

The SSL object has events which need to be handled after some amount of time
(relative to the time at which SSL_get_event_timeout() was called). I<*tv> is
set to the amount of time after which L<SSL_handle_events(3)> should be called
and I<*is_infinite> is set to 0.

=item

There are currently no timer events which require handling in the future. The
value of I<*tv> is unspecified and I<*is_infinite> is set to 1.

=back

This function is currently applicable only to DTLS and QUIC connection SSL
objects. If it is called on any other kind of SSL object, it always outputs
Expand All @@ -40,6 +60,9 @@ L<SSL_handle_events(3)>.
Note that SSL_get_event_timeout() supersedes the older L<DTLSv1_get_timeout(3)>
function for all use cases.

If the call to SSL_get_event_timeout() fails, the values of I<*tv> and
I<*is_infinite> may still be changed and their values become unspecified.

=head1 RETURN VALUES

Returns 1 on success and 0 on failure.
Expand Down

0 comments on commit a28ac61

Please sign in to comment.