42 static int ngx_libc_cdecl ngx_http_map_cmp_dns_wildcards(
const void *one,
44 static void *ngx_http_map_create_conf(
ngx_conf_t *cf);
80 ngx_http_map_create_conf,
93 &ngx_http_map_module_ctx,
94 ngx_http_map_commands,
144 "http map: \"%v\" \"%v\"", &val, v);
204 ccv.
value = &value[1];
213 if (name.
data[0] !=
'$') {
215 "invalid variable name \"%V\"", &name);
228 var->
data = (uintptr_t) map;
258 if (ngx_array_init(&ctx.regexes, cf->
pool, 2,
sizeof(ngx_http_map_regex_t))
293 hash.
name =
"map_hash";
350 if (ctx.regexes.nelts) {
351 map->
map.regex = ctx.regexes.elts;
352 map->
map.nregex = ctx.regexes.nelts;
364 ngx_http_map_cmp_dns_wildcards(
const void *one,
const void *two)
389 &&
ngx_strcmp(value[0].data,
"hostnames") == 0)
396 "invalid number of the map parameters");
400 if (
ngx_strcmp(value[0].data,
"include") == 0) {
404 if (value[1].data[0] ==
'$') {
432 var->
data = (u_char *) index;
439 for (i = 0; i < value[1].
len; i++) {
440 key =
ngx_hash(key, value[1].data[i]);
449 if (value[1].len != (
size_t) vp[i]->len) {
453 if (
ngx_strncmp(value[1].data, vp[i]->data, value[1].len) == 0) {
475 if (var->
data == NULL) {
492 if (
ngx_strcmp(value[0].data,
"default") == 0) {
496 "duplicate default map parameter");
507 if (value[0].len && value[0].data[0] ==
'~') {
509 ngx_http_map_regex_t *regex;
522 if (value[0].data[0] ==
'*') {
532 regex->regex = ngx_http_regex_compile(ctx->
cf, &rc);
533 if (regex->regex == NULL) {
544 if (value[0].len && value[0].data[0] ==
'\\') {
558 "invalid hostname or wildcard \"%V\"", &value[0]);
563 "conflicting parameter \"%V\"", &value[0]);