comparison src/http/modules/ngx_http_proxy_module.c @ 238:a528ae0fe909 NGINX_0_4_4

nginx 0.4.4 *) Feature: the $scheme variable. *) Feature: the "expires" directive supports the "max" parameter. *) Feature: the "include" directive supports the "*" mask. Thanks to Jonathan Dance. *) Bugfix: the "return" directive always overrode the "error_page" response code redirected by the "error_page" directive. *) Bugfix: a segmentation fault occurred if zero-length body was in PUT method. *) Bugfix: the redirect was changed incorrectly if the variables were used in the "proxy_redirect" directive.
author Igor Sysoev <http://sysoev.ru>
date Mon, 02 Oct 2006 00:00:00 +0400
parents dd6c66b5b0e2
children 500a3242dff6
comparison
equal deleted inserted replaced
237:302a8e8b4ae7 238:a528ae0fe909
1395 ngx_memzero(&e, sizeof(ngx_http_script_engine_t)); 1395 ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
1396 1396
1397 e.ip = pr->replacement.vars.lengths; 1397 e.ip = pr->replacement.vars.lengths;
1398 e.request = r; 1398 e.request = r;
1399 1399
1400 for (len = prefix; *(uintptr_t *) e.ip; len += lcode(&e)) { 1400 len = prefix + h->value.len - pr->redirect.len;
1401
1402 while (*(uintptr_t *) e.ip) {
1401 lcode = *(ngx_http_script_len_code_pt *) e.ip; 1403 lcode = *(ngx_http_script_len_code_pt *) e.ip;
1404 len += lcode(&e);
1402 } 1405 }
1403 1406
1404 data = ngx_palloc(r->pool, len); 1407 data = ngx_palloc(r->pool, len);
1405 if (data == NULL) { 1408 if (data == NULL) {
1406 return NGX_ERROR; 1409 return NGX_ERROR;
1415 1418
1416 while (*(uintptr_t *) e.ip) { 1419 while (*(uintptr_t *) e.ip) {
1417 code = *(ngx_http_script_code_pt *) e.ip; 1420 code = *(ngx_http_script_code_pt *) e.ip;
1418 code(&e); 1421 code(&e);
1419 } 1422 }
1423
1424 ngx_memcpy(e.pos, h->value.data + prefix + pr->redirect.len,
1425 h->value.len - pr->redirect.len - prefix);
1420 1426
1421 h->value.len = len; 1427 h->value.len = len;
1422 h->value.data = data; 1428 h->value.data = data;
1423 1429
1424 return NGX_OK; 1430 return NGX_OK;