]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved ICMP-only variables to ICMP-specific code in order to prevent
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 21 Oct 2008 03:24:36 +0000 (21:24 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 21 Oct 2008 03:24:36 +0000 (21:24 -0600)
fatal "unused variable" GCC warnings.

src/htcp.cc

index b1ab9d798e1ed9d4e2a8e57dda5aa83a4e5fde59..ffa226849e1d8fcdab407c20eec4df2639682dfe 100644 (file)
@@ -866,8 +866,6 @@ htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, IPAddr
     MemBuf mb;
     Packer p;
     ssize_t pktlen;
-    char *host;
-    char cto_buf[128];
     memset(&stuff, '\0', sizeof(stuff));
     stuff.op = HTCP_TST;
     stuff.rr = RR_RESPONSE;
@@ -909,13 +907,14 @@ htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, IPAddr
         hdr.reset();
 
 #if USE_ICMP
-        if ((host = urlHostname(spec->uri))) {
+        if (char *host = urlHostname(spec->uri)) {
            int rtt = 0;
            int hops = 0;
             int samp = 0;
             netdbHostData(host, &samp, &rtt, &hops);
 
             if (rtt || hops) {
+                char cto_buf[128];
                 snprintf(cto_buf, 128, "%s %d %f %d",
                          host, samp, 0.001 * rtt, hops);
                 hdr.putExt("Cache-to-Origin", cto_buf);