From e5a80943e28e1928f8977355444690c3501c5943 Mon Sep 17 00:00:00 2001 From: Sara Dickinson Date: Mon, 29 Jun 2015 11:54:31 +0100 Subject: [PATCH] Turn fast open on by default. Fix build warning. --- configure.ac | 17 ++++++++--------- src/stub.c | 3 --- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 2c096722..9bc1fb31 100644 --- a/configure.ac +++ b/configure.ac @@ -120,17 +120,16 @@ fi ]) ACX_ARG_RPATH -AC_ARG_ENABLE(tcp-fastopen, AC_HELP_STRING([--enable-tcp-fastopen], [Enable TCP Fast Open])) -case "$enable_tcp_fastopen" in - yes) - AC_CHECK_DECL([MSG_FASTOPEN], [], [AC_MSG_ERROR([TCP Fast Open is not available: please rerun without --enable-tcp-fastopen])], [AC_INCLUDES_DEFAULT +AC_ARG_ENABLE(tcp-fastopen, AC_HELP_STRING([--disable-tcp-fastopen], Disable TCP Fast Open (default=enabled if available)), + enable_tcp_fastopen="$enableval", enable_tcp_fastopen=yes) +if test "x$enable_tcp_fastopen" = xno; then + AC_MSG_WARN([TCP Fast Open is disabled]) +else + AC_CHECK_DECL([MSG_FASTOPEN], [AC_DEFINE_UNQUOTED([USE_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.])], + [AC_MSG_WARN([TCP Fast Open is not available.])], [AC_INCLUDES_DEFAULT #include ]) - AC_DEFINE_UNQUOTED([USE_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.]) - ;; - no|*) - ;; -esac +fi AC_ARG_ENABLE(broken-native-stub-dnssec, AC_HELP_STRING([--enable-broken-native-stub-dnssec], [Enable very experimental and broken native stub DNSSEC support])) case "$enable_broken_native_stub_dnssec" in diff --git a/src/stub.c b/src/stub.c index 0726f417..bbaac5e4 100644 --- a/src/stub.c +++ b/src/stub.c @@ -1274,7 +1274,6 @@ upstream_read_cb(void *userarg) getdns_upstream *upstream = (getdns_upstream *)userarg; getdns_network_req *netreq; getdns_dns_req *dnsreq; - uint64_t idle_timeout; int q; uint16_t query_id; intptr_t query_id_intptr; @@ -1317,8 +1316,6 @@ upstream_read_cb(void *userarg) /* TODO[TLS]: I don't think we should do this for TCP. We should stay * on a working connection until we hit a problem.*/ upstream->upstreams->current = 0; - /* netreq may die before setting timeout*/ - idle_timeout = netreq->owner->context->idle_timeout; /* TODO: DNSSEC */ netreq->secure = 0;