summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nginx/src/http/modules/ngx_http_map_module.c
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2012-10-08 10:44:42 +0000
committerrobert <robert@openbsd.org>2012-10-08 10:44:42 +0000
commit808f7e3bb3f6a14beeff4727aba2133d4855f7bd (patch)
tree83d7503f8998812362e0421412594cf22f1dbb37 /usr.sbin/nginx/src/http/modules/ngx_http_map_module.c
parentdeivce -> device (diff)
downloadwireguard-openbsd-808f7e3bb3f6a14beeff4727aba2133d4855f7bd.tar.xz
wireguard-openbsd-808f7e3bb3f6a14beeff4727aba2133d4855f7bd.zip
update to 1.2.4
Diffstat (limited to 'usr.sbin/nginx/src/http/modules/ngx_http_map_module.c')
-rw-r--r--usr.sbin/nginx/src/http/modules/ngx_http_map_module.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/usr.sbin/nginx/src/http/modules/ngx_http_map_module.c b/usr.sbin/nginx/src/http/modules/ngx_http_map_module.c
index e8a4ab4cc18..371737b2eac 100644
--- a/usr.sbin/nginx/src/http/modules/ngx_http_map_module.c
+++ b/usr.sbin/nginx/src/http/modules/ngx_http_map_module.c
@@ -369,7 +369,7 @@ static char *
ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
{
ngx_int_t rc, index;
- ngx_str_t *value, file, name;
+ ngx_str_t *value, name;
ngx_uint_t i, key;
ngx_http_map_conf_ctx_t *ctx;
ngx_http_variable_value_t *var, **vp;
@@ -391,15 +391,7 @@ ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
}
if (ngx_strcmp(value[0].data, "include") == 0) {
- file = value[1];
-
- if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);
-
- return ngx_conf_parse(cf, &file);
+ return ngx_conf_include(cf, dummy, conf);
}
if (value[1].data[0] == '$') {
@@ -416,11 +408,12 @@ ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
for (i = 0; i < ctx->var_values.nelts; i++) {
if (index == (ngx_int_t) var[i].data) {
+ var = &var[i];
goto found;
}
}
- var = ngx_palloc(ctx->keys.pool, sizeof(ngx_http_variable_value_t));
+ var = ngx_array_push(&ctx->var_values);
if (var == NULL) {
return NGX_CONF_ERROR;
}
@@ -431,13 +424,6 @@ ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
var->len = 0;
var->data = (u_char *) index;
- vp = ngx_array_push(&ctx->var_values);
- if (vp == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *vp = var;
-
goto found;
}