From: Hubert Kario Date: Thu, 20 Jun 2024 15:48:35 +0000 (+0200) Subject: s_client: use the full buffer for reads X-Git-Tag: openssl-3.4.0-alpha1~463 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03448ba21b5e720f59f7d349fcffd26c53323414;p=thirdparty%2Fopenssl.git s_client: use the full buffer for reads Use full allocated buffer for reads to not call into switch() over and over; also increase the size of the buffer to 16 kiB (max for TLS records). The server side already is using 16 kiB buffers. Signed-off-by: Hubert Kario Reviewed-by: Neil Horman Reviewed-by: Matt Caswell Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/24688) --- diff --git a/apps/s_client.c b/apps/s_client.c index 78a44755cb5..b52c69d0b20 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -55,7 +55,7 @@ typedef unsigned int u_int; #endif #undef BUFSIZZ -#define BUFSIZZ 1024*8 +#define BUFSIZZ 1024*16 #define S_CLIENT_IRC_READ_TIMEOUT 8 #define USER_DATA_MODE_NONE 0 @@ -3172,7 +3172,7 @@ int s_client_main(int argc, char **argv) } } #endif - k = SSL_read(con, sbuf, 1024 /* BUFSIZZ */ ); + k = SSL_read(con, sbuf, BUFSIZZ); switch (SSL_get_error(con, k)) { case SSL_ERROR_NONE: