diff options
author | Andy Polyakov <appro@openssl.org> | 2018-04-05 18:59:36 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2018-04-08 11:42:30 +0200 |
commit | dcf3d83faf3542b984d5586bdb1d50c90137a29d (patch) | |
tree | 2a41c2f2705441fa99836a2aa896ed0d275de4dc /apps | |
parent | 55fd5d3fc5f7df2bbbdc11caa14a33da383cf65b (diff) |
apps/s_socket.c: disable the Nagle algorithm.
Without TCP_NODELAY alerts risk to be dropped between shutdown and close.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5887)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/s_socket.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/s_socket.c b/apps/s_socket.c index e3cfda98ae..80b63ebc4d 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -146,7 +146,7 @@ int init_client(int *sock, const char *host, const char *port, } #endif - if (!BIO_connect(*sock, BIO_ADDRINFO_address(ai), 0)) { + if (!BIO_connect(*sock, BIO_ADDRINFO_address(ai), BIO_SOCK_NODELAY)) { BIO_closesocket(*sock); *sock = INVALID_SOCKET; continue; @@ -330,6 +330,7 @@ int do_server(int *accept_sock, const char *host, const char *port, BIO_closesocket(asock); break; } + BIO_set_tcp_ndelay(sock, 1); i = (*cb)(sock, type, protocol, context); /* |