DIGEST_INVALID_ATTR
};
-static const LookupTable<http_digest_attr_type>::Record
-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}
-};
-
-LookupTable<http_digest_attr_type>
-DigestFieldsLookupTable(DIGEST_INVALID_ATTR, DigestAttrs);
+static const auto &
+digestFieldsLookupTable()
+{
+ static const LookupTable<http_digest_attr_type>::Record 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}
+ };
+ static const auto table = new LookupTable<http_digest_attr_type>(DIGEST_INVALID_ATTR, DigestAttrs);
+ return *table;
+}
/*
*
}
/* find type */
- const http_digest_attr_type t = DigestFieldsLookupTable.lookup(keyName);
+ const auto t = digestFieldsLookupTable().lookup(keyName);
switch (t) {
case DIGEST_USERNAME: