]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Rename lookup table in auth/digest/Config.cc
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 27 Jul 2015 16:31:57 +0000 (18:31 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 27 Jul 2015 16:31:57 +0000 (18:31 +0200)
1  2 
src/auth/digest/Config.cc

index 5e7c053a2b29c4579268c1556c2e9f4c74d36214,49ca98201aa79085ceed130c9fa38675455434bd..46f2bf1a3b5c272accd4f20bf5279324d1e416fd
@@@ -61,25 -60,23 +61,25 @@@ enum http_digest_attr_type 
      DIGEST_NC,
      DIGEST_CNONCE,
      DIGEST_RESPONSE,
 -    DIGEST_ENUM_END
 +    DIGEST_INVALID_ATTR
  };
  
 -static const HttpHeaderFieldAttrs DigestAttrs[DIGEST_ENUM_END] = {
 -    HttpHeaderFieldAttrs("username",  (http_hdr_type)DIGEST_USERNAME),
 -    HttpHeaderFieldAttrs("realm", (http_hdr_type)DIGEST_REALM),
 -    HttpHeaderFieldAttrs("qop", (http_hdr_type)DIGEST_QOP),
 -    HttpHeaderFieldAttrs("algorithm", (http_hdr_type)DIGEST_ALGORITHM),
 -    HttpHeaderFieldAttrs("uri", (http_hdr_type)DIGEST_URI),
 -    HttpHeaderFieldAttrs("nonce", (http_hdr_type)DIGEST_NONCE),
 -    HttpHeaderFieldAttrs("nc", (http_hdr_type)DIGEST_NC),
 -    HttpHeaderFieldAttrs("cnonce", (http_hdr_type)DIGEST_CNONCE),
 -    HttpHeaderFieldAttrs("response", (http_hdr_type)DIGEST_RESPONSE),
 +static const LookupTable<http_digest_attr_type>::Record
-   DigestAttrs_Exp[] = {
++  DigestAttrs[] = {
 +    {"username", DIGEST_USERNAME},
 +    {"realm", DIGEST_REALM},
 +    {"qop", DIGEST_QOP},
 +    {"algorithm", DIGEST_ALGORITHM},
 +    {"uri", DIGEST_URI},
 +    {"nonce", DIGEST_NONCE},
 +    {"nc", DIGEST_NC},
 +    {"cnonce", DIGEST_CNONCE},
 +    {"response", DIGEST_RESPONSE},
 +    {nullptr, DIGEST_INVALID_ATTR}
  };
  
 -class HttpHeaderFieldInfo;
 -static HttpHeaderFieldInfo *DigestFieldsInfo = NULL;
 +LookupTable<http_digest_attr_type>
- ExpDigestFieldsLookupTable(DIGEST_INVALID_ATTR, DigestAttrs_Exp);
++DigestFieldsLookupTable(DIGEST_INVALID_ATTR, DigestAttrs);
  
  /*
   *
@@@ -812,7 -815,7 +812,7 @@@ Auth::Digest::Config::decode(char cons
          }
  
          /* find type */
-         const http_digest_attr_type t = ExpDigestFieldsLookupTable.lookup(keyName);
 -        http_digest_attr_type t = (http_digest_attr_type)httpHeaderIdByName(item, nlen, DigestFieldsInfo, DIGEST_ENUM_END);
++        const http_digest_attr_type t = DigestFieldsLookupTable.lookup(keyName);
  
          switch (t) {
          case DIGEST_USERNAME: