diff options
author | Matt Caswell <matt@openssl.org> | 2023-10-23 18:11:06 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2023-10-25 09:40:48 +0100 |
commit | 95420a2500fe0d96fb44cf7d826a156433c50589 (patch) | |
tree | 7549ca74536312bd4bee06d3d3d259f471b4f2c4 /apps/s_client.c | |
parent | 1a91fda1839bc745e8359f82d19a5ef44ca36f7e (diff) |
Don't wait in select if we have data to write
In s_client, when using quic, if we have data from the user to write then we shouldn't
hang in "select" waiting for something to happen.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22480)
Diffstat (limited to 'apps/s_client.c')
-rw-r--r-- | apps/s_client.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/s_client.c b/apps/s_client.c index 5577a9e903..8a7650223c 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -2969,10 +2969,13 @@ int s_client_main(int argc, char **argv) } while (!write_ssl && cbuf_len == 0 && user_data_has_data(&user_data)); - if (cbuf_len > 0) + if (cbuf_len > 0) { read_tty = 0; - else + timeout.tv_sec = 0; + timeout.tv_usec = 0; + } else { read_tty = 1; + } } ssl_pending = read_ssl && SSL_has_pending(con); @@ -3266,6 +3269,7 @@ int s_client_main(int argc, char **argv) ret = 0; goto shut; } + if (i > 0 && !user_data_add(&user_data, i)) { ret = 0; goto shut; |