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);
/*
*
}
/* 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: