]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Only declare/set `freshConn` if `MSG_FASTOPEN` is defined 5449/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 22 Jun 2017 09:18:04 +0000 (11:18 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 22 Jun 2017 09:18:04 +0000 (11:18 +0200)
pdns/dnsdist-tcp.cc

index 95e3ac204511a13169f33c3d2062e474c5ecfc79..c894672af35ebf63bde412cc39eae29f21e19652 100644 (file)
@@ -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;
           }