From: Francesco Chemolli Date: Mon, 27 Jul 2015 16:31:57 +0000 (+0200) Subject: Rename lookup table in auth/digest/Config.cc X-Git-Tag: merge-candidate-3-v1~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f5ef79c01d444df159864a2c6fbc1533aca0aebd;p=thirdparty%2Fsquid.git Rename lookup table in auth/digest/Config.cc --- f5ef79c01d444df159864a2c6fbc1533aca0aebd diff --cc src/auth/digest/Config.cc index 5e7c053a2b,49ca98201a..46f2bf1a3b --- a/src/auth/digest/Config.cc +++ b/src/auth/digest/Config.cc @@@ -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::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 - 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: