From 87706a7690508fba0e0e915ee6ea214dcd44f3fe Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 22 Jun 2017 11:18:04 +0200 Subject: [PATCH] dnsdist: Only declare/set `freshConn` if `MSG_FASTOPEN` is defined --- pdns/dnsdist-tcp.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index 95e3ac2045..c894672af3 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -448,14 +448,18 @@ void* tcpClientThread(int pipefd) int dsock = -1; uint16_t downstreamFailures=0; +#ifdef MSG_FASTOPEN bool freshConn = true; +#endif /* MSG_FASTOPEN */ if(sockets.count(ds->remote) == 0) { dsock=setupTCPDownstream(ds, downstreamFailures); sockets[ds->remote]=dsock; } else { dsock=sockets[ds->remote]; +#ifdef MSG_FASTOPEN freshConn = false; +#endif /* MSG_FASTOPEN */ } ds->queries++; @@ -493,7 +497,9 @@ void* tcpClientThread(int pipefd) downstreamFailures++; dsock=setupTCPDownstream(ds, downstreamFailures); sockets[ds->remote]=dsock; +#ifdef MSG_FASTOPEN freshConn=true; +#endif /* MSG_FASTOPEN */ goto retry; } @@ -513,7 +519,9 @@ void* tcpClientThread(int pipefd) downstreamFailures++; dsock=setupTCPDownstream(ds, downstreamFailures); sockets[ds->remote]=dsock; +#ifdef MSG_FASTOPEN freshConn=true; +#endif /* MSG_FASTOPEN */ if(xfrStarted) { goto drop; } -- 2.47.2