diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2014-06-24 17:30:01 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2014-06-24 17:30:01 +0000 |
commit | 3a1235e5321d14983501dce7124eb07cc220d214 (patch) | |
tree | 7273bbe96073e9a76a68d05ddcce16edac42dbd9 /lib/libssl | |
parent | ee312c9fb680c56c1bdeb91d62e504954c5f528b (diff) |
Actually make BIO_set_tcp_ndelay() work - TCP_NODELAY will not magically
appear by itself.
ok beck@ miod@
Diffstat (limited to 'lib/libssl')
-rw-r--r-- | lib/libssl/src/crypto/bio/b_sock.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/libssl/src/crypto/bio/b_sock.c b/lib/libssl/src/crypto/bio/b_sock.c index ec28ba2e82f..62d545a1299 100644 --- a/lib/libssl/src/crypto/bio/b_sock.c +++ b/lib/libssl/src/crypto/bio/b_sock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b_sock.c,v 1.41 2014/06/22 16:47:08 jsing Exp $ */ +/* $OpenBSD: b_sock.c,v 1.42 2014/06/24 17:30:00 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -60,6 +60,7 @@ #include <sys/socket.h> #include <netinet/in.h> +#include <netinet/tcp.h> #include <errno.h> #include <netdb.h> @@ -509,21 +510,7 @@ end: int BIO_set_tcp_ndelay(int s, int on) { - int ret = 0; -#if defined(TCP_NODELAY) && (defined(IPPROTO_TCP) || defined(SOL_TCP)) - int opt; - -#ifdef SOL_TCP - opt = SOL_TCP; -#else -#ifdef IPPROTO_TCP - opt = IPPROTO_TCP; -#endif -#endif - - ret = setsockopt(s, opt, TCP_NODELAY, (char *)&on, sizeof(on)); -#endif - return (ret == 0); + return (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) == 0); } int |