comparison src/http/modules/ngx_http_fastcgi_module.c @ 3558:83c9a10ec029

remove the special static fastcgi_param values processing, because it is anyway very seldom case
author Igor Sysoev <igor@sysoev.ru>
date Wed, 02 Jun 2010 15:08:29 +0000
parents 62a4fd1e6e2c
children 519dcf4cb3de
comparison
equal deleted inserted replaced
3557:77188d729402 3558:83c9a10ec029
2236 } 2236 }
2237 2237
2238 src = conf->params_source->elts; 2238 src = conf->params_source->elts;
2239 for (i = 0; i < conf->params_source->nelts; i++) { 2239 for (i = 0; i < conf->params_source->nelts; i++) {
2240 2240
2241 if (ngx_http_script_variables_count(&src[i].value) == 0) { 2241 copy = ngx_array_push_n(conf->params_len,
2242 copy = ngx_array_push_n(conf->params_len, 2242 sizeof(ngx_http_script_copy_code_t));
2243 sizeof(ngx_http_script_copy_code_t)); 2243 if (copy == NULL) {
2244 if (copy == NULL) { 2244 return NGX_CONF_ERROR;
2245 return NGX_CONF_ERROR; 2245 }
2246 } 2246
2247 2247 copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
2248 copy->code = (ngx_http_script_code_pt) 2248 copy->len = src[i].key.len;
2249 ngx_http_script_copy_len_code; 2249
2250 copy->len = src[i].key.len; 2250
2251 2251 size = (sizeof(ngx_http_script_copy_code_t)
2252 2252 + src[i].key.len + sizeof(uintptr_t) - 1)
2253 copy = ngx_array_push_n(conf->params_len, 2253 & ~(sizeof(uintptr_t) - 1);
2254 sizeof(ngx_http_script_copy_code_t)); 2254
2255 if (copy == NULL) { 2255 copy = ngx_array_push_n(conf->params, size);
2256 return NGX_CONF_ERROR; 2256 if (copy == NULL) {
2257 } 2257 return NGX_CONF_ERROR;
2258 2258 }
2259 copy->code = (ngx_http_script_code_pt) 2259
2260 ngx_http_script_copy_len_code; 2260 copy->code = ngx_http_script_copy_code;
2261 copy->len = src[i].value.len; 2261 copy->len = src[i].key.len;
2262 2262
2263 2263 p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
2264 size = (sizeof(ngx_http_script_copy_code_t) 2264 ngx_memcpy(p, src[i].key.data, src[i].key.len);
2265 + src[i].key.len + src[i].value.len 2265
2266 + sizeof(uintptr_t) - 1) 2266
2267 & ~(sizeof(uintptr_t) - 1); 2267 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
2268 2268
2269 copy = ngx_array_push_n(conf->params, size); 2269 sc.cf = cf;
2270 if (copy == NULL) { 2270 sc.source = &src[i].value;
2271 return NGX_CONF_ERROR; 2271 sc.flushes = &conf->flushes;
2272 } 2272 sc.lengths = &conf->params_len;
2273 2273 sc.values = &conf->params;
2274 copy->code = ngx_http_script_copy_code; 2274
2275 copy->len = src[i].key.len + src[i].value.len; 2275 if (ngx_http_script_compile(&sc) != NGX_OK) {
2276 2276 return NGX_CONF_ERROR;
2277 p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
2278
2279 p = ngx_cpymem(p, src[i].key.data, src[i].key.len);
2280 ngx_memcpy(p, src[i].value.data, src[i].value.len);
2281
2282 } else {
2283 copy = ngx_array_push_n(conf->params_len,
2284 sizeof(ngx_http_script_copy_code_t));
2285 if (copy == NULL) {
2286 return NGX_CONF_ERROR;
2287 }
2288
2289 copy->code = (ngx_http_script_code_pt)
2290 ngx_http_script_copy_len_code;
2291 copy->len = src[i].key.len;
2292
2293
2294 size = (sizeof(ngx_http_script_copy_code_t)
2295 + src[i].key.len + sizeof(uintptr_t) - 1)
2296 & ~(sizeof(uintptr_t) - 1);
2297
2298 copy = ngx_array_push_n(conf->params, size);
2299 if (copy == NULL) {
2300 return NGX_CONF_ERROR;
2301 }
2302
2303 copy->code = ngx_http_script_copy_code;
2304 copy->len = src[i].key.len;
2305
2306 p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
2307 ngx_memcpy(p, src[i].key.data, src[i].key.len);
2308
2309
2310 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
2311
2312 sc.cf = cf;
2313 sc.source = &src[i].value;
2314 sc.flushes = &conf->flushes;
2315 sc.lengths = &conf->params_len;
2316 sc.values = &conf->params;
2317
2318 if (ngx_http_script_compile(&sc) != NGX_OK) {
2319 return NGX_CONF_ERROR;
2320 }
2321 } 2277 }
2322 2278
2323 code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t)); 2279 code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
2324 if (code == NULL) { 2280 if (code == NULL) {
2325 return NGX_CONF_ERROR; 2281 return NGX_CONF_ERROR;