Klaus Demo nginx / e5ae5b6
Merge of r4642: Fixed core variables dynamic access after reconfiguration. If variable was indexed in previous configuration but not in current one, the NGX_HTTP_VAR_INDEXED flag was left set and confused ngx_http_get_variable(). Patch by Yichun Zhang (agentzh), slightly modified. Maxim Dounin 10 years ago
1 changed file(s) with 9 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
20152015 ngx_http_variables_add_core_vars(ngx_conf_t *cf)
20162016 {
20172017 ngx_int_t rc;
2018 ngx_http_variable_t *v;
2018 ngx_http_variable_t *cv, *v;
20192019 ngx_http_core_main_conf_t *cmcf;
20202020
20212021 cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
20352035 return NGX_ERROR;
20362036 }
20372037
2038 for (v = ngx_http_core_variables; v->name.len; v++) {
2038 for (cv = ngx_http_core_variables; cv->name.len; cv++) {
2039 v = ngx_palloc(cf->pool, sizeof(ngx_http_variable_t));
2040 if (v == NULL) {
2041 return NGX_ERROR;
2042 }
2043
2044 *v = *cv;
2045
20392046 rc = ngx_hash_add_key(cmcf->variables_keys, &v->name, v,
20402047 NGX_HASH_READONLY_KEY);
20412048