Skip to content

Commit

Permalink
Don't wait in select if we have data to write
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattcaswell committed Oct 23, 2023
1 parent ddf3a94 commit e5e57f8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/s_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e5e57f8

Please sign in to comment.