From: Francesco Chemolli Date: Thu, 9 Jul 2015 09:20:27 +0000 (+0200) Subject: make dump_peer_options clearer (and address CID 740350) X-Git-Tag: merge-candidate-3-v1~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ac1880;p=thirdparty%2Fsquid.git make dump_peer_options clearer (and address CID 740350) --- diff --git a/src/neighbors.cc b/src/neighbors.cc index 9f8b05201a..6a42df0ec9 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1492,15 +1492,23 @@ dump_peer_options(StoreEntry * sentry, CachePeer * p) if (p->options.htcp) { storeAppendPrintf(sentry, " htcp"); if (p->options.htcp_oldsquid || p->options.htcp_no_clr || p->options.htcp_no_purge_clr || p->options.htcp_only_clr) { - int doneopts=0; - if (p->options.htcp_oldsquid) - storeAppendPrintf(sentry, "%soldsquid",(doneopts++>0?",":"=")); - if (p->options.htcp_no_clr) - storeAppendPrintf(sentry, "%sno-clr",(doneopts++>0?",":"=")); - if (p->options.htcp_no_purge_clr) - storeAppendPrintf(sentry, "%sno-purge-clr",(doneopts++>0?",":"=")); - if (p->options.htcp_only_clr) - storeAppendPrintf(sentry, "%sonly-clr",(doneopts++>0?",":"=")); + bool doneopts = false; + if (p->options.htcp_oldsquid) { + storeAppendPrintf(sentry, "oldsquid"); + doneopts = true; + } + if (p->options.htcp_no_clr) { + storeAppendPrintf(sentry, "%sno-clr",(doneopts?",":"=")); + doneopts = true; + } + if (p->options.htcp_no_purge_clr) { + storeAppendPrintf(sentry, "%sno-purge-clr",(doneopts?",":"=")); + doneopts = true; + } + if (p->options.htcp_only_clr) { + storeAppendPrintf(sentry, "%sonly-clr",(doneopts?",":"=")); + //doneopts = true; // uncomment if more opts are added + } } } #endif