Explorar o código

Only set TCP_NODELAY if the protocol is TCP

This doesn't apply if we're doing DTLS, or using UNIX domain sockets.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6373)
Matt Caswell %!s(int64=6) %!d(string=hai) anos
pai
achega
6712ba9323
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      apps/s_socket.c

+ 1 - 1
apps/s_socket.c

@@ -147,7 +147,7 @@ int init_client(int *sock, const char *host, const char *port,
 #endif
 
         if (!BIO_connect(*sock, BIO_ADDRINFO_address(ai),
-                         type == SOCK_STREAM ? BIO_SOCK_NODELAY : 0)) {
+                         protocol == IPPROTO_TCP ? BIO_SOCK_NODELAY : 0)) {
             BIO_closesocket(*sock);
             *sock = INVALID_SOCKET;
             continue;