Skip to content

Commit

Permalink
QUIC: Rename SSL_tick etc. in s_client
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 041d48c commit a35e38a
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions apps/s_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ int s_client_main(int argc, char **argv)
int enable_ktls = 0;
#endif
int tfo = 0;
int is_infinite;
BIO_ADDR *peer_addr = NULL;
struct user_data_st user_data;

Expand Down Expand Up @@ -2909,23 +2910,12 @@ int s_client_main(int argc, char **argv)
FD_ZERO(&readfds);
FD_ZERO(&writefds);

if ((isdtls || isquic) && SSL_get_tick_timeout(con, &timeout)) {
/*
* TODO(QUIC): The need to do this seems like an unintended
* consequence of the SSL_get_tick_timeout() design. You cannot
* call select with the returned timeout if tv_sec < 0 because it
* errors out. Possibly SSL_get_tick_timeout() should return 0 if
* tv_sec < 0 to make it easier to detect this? Or alternatively
* make it work the same way that DTLSv1_get_timeout() did which
* would make SSL_get_tick_timeout() a drop in replacement
*/
if (timeout.tv_sec < 0)
timeoutp = NULL;
else
timeoutp = &timeout;
} else {
if ((isdtls || isquic)
&& SSL_get_event_timeout(con, &timeout, &is_infinite)
&& !is_infinite)
timeoutp = &timeout;
else
timeoutp = NULL;
}

if (!SSL_is_init_finished(con) && SSL_total_renegotiations(con) == 0
&& SSL_get_key_update_type(con) == SSL_KEY_UPDATE_NONE) {
Expand Down Expand Up @@ -3013,8 +3003,8 @@ int s_client_main(int argc, char **argv)
/*
* Note that for QUIC we never actually check FD_ISSET() for the
* underlying network fds. We just rely on select waking up when
* they become readable/writeable and then SSL_tick() doing the
* right thing.
* they become readable/writeable and then SSL_handle_events() doing
* the right thing.
*/
if ((!isquic && read_ssl)
|| (isquic && SSL_net_read_desired(con)))
Expand Down Expand Up @@ -3073,7 +3063,7 @@ int s_client_main(int argc, char **argv)
}

if (timeoutp != NULL) {
SSL_tick(con);
SSL_handle_events(con);
if (isdtls
&& !FD_ISSET(SSL_get_fd(con), &readfds)
&& !FD_ISSET(SSL_get_fd(con), &writefds))
Expand Down

0 comments on commit a35e38a

Please sign in to comment.