]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
proto ACL overly verbose on "Ignoring unknown protocol"
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 10 Mar 2011 12:32:42 +0000 (01:32 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 10 Mar 2011 12:32:42 +0000 (01:32 +1300)
Minor logic error in display. No actual operational effects.

src/acl/ProtocolData.cc

index 54281d69c672f161e3f7221b1902183ee466391e..7aba10769c3e2eb45ca414b46ebde41304affad1 100644 (file)
@@ -88,16 +88,19 @@ ACLProtocolData::parse()
 
     for (Tail = &values; *Tail; Tail = &((*Tail)->next));
     while ((t = strtokFile())) {
-        for (int p = AnyP::PROTO_NONE; p < AnyP::PROTO_UNKNOWN; ++p) {
+        int p = AnyP::PROTO_NONE;
+        for (; p < AnyP::PROTO_UNKNOWN; ++p) {
             if (strcasecmp(t, AnyP::ProtocolType_str[p]) == 0) {
                 CbDataList<AnyP::ProtocolType> *q = new CbDataList<AnyP::ProtocolType>(static_cast<AnyP::ProtocolType>(p));
                 *(Tail) = q;
                 Tail = &q->next;
                 break;
-            } else {
-                debugs(28, DBG_IMPORTANT, "WARNING: Ignoring unknown protocol '" << t << "' in the ACL named '" << AclMatchedName << "'");
             }
         }
+        if (p == AnyP::PROTO_UNKNOWN) {
+            debugs(28, DBG_IMPORTANT, "WARNING: Ignoring unknown protocol '" << t << "' in the ACL named '" << AclMatchedName << "'");
+            // XXX: store the text pattern of this protocol name for live comparisons
+        }
     }
 }