From: Remi Gacogne Date: Thu, 22 Jun 2017 09:18:04 +0000 (+0200) Subject: dnsdist: Only declare/set `freshConn` if `MSG_FASTOPEN` is defined X-Git-Tag: rec-4.1.0-alpha1~55^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5449%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Only declare/set `freshConn` if `MSG_FASTOPEN` is defined --- 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; }