fix the previous commit when value is static string: remove the special

static values processing, because it is anyway very seldom case
This commit is contained in:
Igor Sysoev 2010-06-01 17:30:23 +00:00
parent 1089957488
commit dc4b53fe61

View File

@ -1376,54 +1376,13 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
src = conf->params_source->elts;
for (i = 0; i < conf->params_source->nelts; i++) {
if (ngx_http_script_variables_count(&src[i].value) == 0) {
copy = ngx_array_push_n(conf->params_len,
sizeof(ngx_http_script_copy_code_t));
if (copy == NULL) {
return NGX_CONF_ERROR;
}
copy->code = (ngx_http_script_code_pt)
ngx_http_script_copy_len_code;
copy->len = src[i].key.len;
copy = ngx_array_push_n(conf->params_len,
sizeof(ngx_http_script_copy_code_t));
if (copy == NULL) {
return NGX_CONF_ERROR;
}
copy->code = (ngx_http_script_code_pt)
ngx_http_script_copy_len_code;
copy->len = src[i].value.len;
size = (sizeof(ngx_http_script_copy_code_t)
+ src[i].key.len + src[i].value.len
+ sizeof(uintptr_t) - 1) & ~(sizeof(uintptr_t) - 1);
copy = ngx_array_push_n(conf->params, size);
if (copy == NULL) {
return NGX_CONF_ERROR;
}
copy->code = ngx_http_script_copy_code;
copy->len = src[i].key.len + src[i].value.len;
p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
p = ngx_cpymem(p, src[i].key.data, src[i].key.len);
ngx_memcpy(p, src[i].value.data, src[i].value.len);
} else {
copy = ngx_array_push_n(conf->params_len,
sizeof(ngx_http_script_copy_code_t));
if (copy == NULL) {
return NGX_CONF_ERROR;
}
copy->code = (ngx_http_script_code_pt)
ngx_http_script_copy_len_code;
copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
copy->len = src[i].key.len;
@ -1454,7 +1413,6 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (ngx_http_script_compile(&sc) != NGX_OK) {
return NGX_CONF_ERROR;
}
}
code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
if (code == NULL) {