From e77cf572a348f6907a4ca046a8927b3f5df5e836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Fri, 7 Apr 2017 12:53:06 +0200 Subject: [PATCH] Revert "* libwget/net.c: Silence -Wundef if TCP_FASTOPEN is undefined" This reverts commit 2c17f6fc429f4e1edf78b329ff3509d1ed22f392. --- libwget/net.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libwget/net.c b/libwget/net.c index db2a98383..971082650 100644 --- a/libwget/net.c +++ b/libwget/net.c @@ -325,7 +325,9 @@ static int G_GNUC_WGET_CONST _family_to_value(int family) void wget_tcp_set_tcp_fastopen(wget_tcp_t *tcp, int tcp_fastopen) { +#if defined(TCP_FASTOPEN) && defined(MSG_FASTOPEN) (tcp ? tcp : &_global_tcp)->tcp_fastopen = tcp_fastopen; +#endif } int wget_tcp_get_tcp_fastopen(wget_tcp_t *tcp) @@ -591,7 +593,6 @@ int wget_tcp_connect(wget_tcp_t *tcp, const char *host, const char *port) } } -#ifdef TCP_FASTOPEN if (tcp->tcp_fastopen) { rc = 0; errno = 0; @@ -601,10 +602,6 @@ int wget_tcp_connect(wget_tcp_t *tcp, const char *host, const char *port) rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen); tcp->first_send = 0; } -#else - rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen); - tcp->first_send = 0; -#endif if (rc < 0 && errno != EAGAIN @@ -727,7 +724,7 @@ wget_tcp_t *wget_tcp_accept(wget_tcp_t *parent_tcp) return NULL; } - if ((sockfd = accept(parent_tcp->sockfd, parent_tcp->bind_addrinfo->ai_addr, (socklen_t *) &parent_tcp->bind_addrinfo->ai_addrlen)) != -1) { + if ((sockfd = accept(parent_tcp->sockfd, parent_tcp->bind_addrinfo->ai_addr, &parent_tcp->bind_addrinfo->ai_addrlen)) != -1) { wget_tcp_t *tcp = xmalloc(sizeof(wget_tcp_t)); *tcp = *parent_tcp;