diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-05-11 14:43:47 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-05-11 14:43:47 +0000 |
commit | 3338cfdfbc5522ca96319ece6d21ddc4d1dce45d (patch) | |
tree | 1e668fefd76a974c8ffdb0db6813022a6eb64e76 /src/core/ngx_conf_file.c | |
parent | 418843dc7f2ff90ae371f41e5fea810e10e59317 (diff) | |
download | nginx-3338cfdfbc5522ca96319ece6d21ddc4d1dce45d.tar.gz nginx-3338cfdfbc5522ca96319ece6d21ddc4d1dce45d.zip |
nginx-0.3.46-RELEASE importrelease-0.3.46
*) Feature: the "proxy_hide_header", "proxy_pass_header",
"fastcgi_hide_header", and "fastcgi_pass_header" directives.
*) Change: the "proxy_pass_x_powered_by", "fastcgi_x_powered_by", and
"proxy_pass_server" directives were canceled.
*) Feature: the "X-Accel-Buffering" response header line is supported
in proxy mode.
*) Bugfix: the reconfiguration bug and memory leaks in the
ngx_http_perl_module.
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r-- | src/core/ngx_conf_file.c | 53 |
1 files changed, 44 insertions, 9 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index b895910d5..94dfe6276 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -900,38 +900,73 @@ ngx_conf_set_str_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) char * -ngx_conf_set_table_elt_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) +ngx_conf_set_str_array_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) +{ + char *p = conf; + + ngx_str_t *value, *s; + ngx_array_t **a; + ngx_conf_post_t *post; + + a = (ngx_array_t **) (p + cmd->offset); + + if (*a == NULL) { + *a = ngx_array_create(cf->pool, 4, sizeof(ngx_str_t)); + if (*a == NULL) { + return NGX_CONF_ERROR; + } + } + + s = ngx_array_push(*a); + if (s == NULL) { + return NGX_CONF_ERROR; + } + + value = cf->args->elts; + + *s = value[1]; + + if (cmd->post) { + post = cmd->post; + return post->post_handler(cf, post, s); + } + + return NGX_CONF_OK; +} + + +char * +ngx_conf_set_keyval_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { char *p = conf; ngx_str_t *value; ngx_array_t **a; - ngx_table_elt_t *elt; + ngx_keyval_t *kv; ngx_conf_post_t *post; a = (ngx_array_t **) (p + cmd->offset); if (*a == NULL) { - *a = ngx_array_create(cf->pool, 4, sizeof(ngx_table_elt_t)); + *a = ngx_array_create(cf->pool, 4, sizeof(ngx_keyval_t)); if (*a == NULL) { return NGX_CONF_ERROR; } } - elt = ngx_array_push(*a); - if (elt == NULL) { + kv = ngx_array_push(*a); + if (kv == NULL) { return NGX_CONF_ERROR; } value = cf->args->elts; - elt->hash = 0; - elt->key = value[1]; - elt->value = value[2]; + kv->key = value[1]; + kv->value = value[2]; if (cmd->post) { post = cmd->post; - return post->post_handler(cf, post, elt); + return post->post_handler(cf, post, kv); } return NGX_CONF_OK; |