From: Alex Rousskov Date: Tue, 21 Oct 2008 03:24:36 +0000 (-0600) Subject: Moved ICMP-only variables to ICMP-specific code in order to prevent X-Git-Tag: SQUID_3_2_0_1~1390 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c517f84aba07ad79a82ac98a82cf82fc2aa4577c;p=thirdparty%2Fsquid.git Moved ICMP-only variables to ICMP-specific code in order to prevent fatal "unused variable" GCC warnings. --- diff --git a/src/htcp.cc b/src/htcp.cc index b1ab9d798e..ffa226849e 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -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);