Mercurial > hg > nginx
comparison src/http/modules/ngx_http_proxy_module.c @ 1714:6b81bbc36eaf stable-0.5
r1566 merge:
fix English grammar
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 12 Dec 2007 16:57:36 +0000 |
parents | 389aeafc3b84 |
children | 1e6101aca4bb |
comparison
equal
deleted
inserted
replaced
1713:389aeafc3b84 | 1714:6b81bbc36eaf |
---|---|
418 | 418 |
419 | 419 |
420 static ngx_http_variable_t ngx_http_proxy_vars[] = { | 420 static ngx_http_variable_t ngx_http_proxy_vars[] = { |
421 | 421 |
422 { ngx_string("proxy_host"), NULL, ngx_http_proxy_host_variable, 0, | 422 { ngx_string("proxy_host"), NULL, ngx_http_proxy_host_variable, 0, |
423 NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOHASH, 0 }, | 423 NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOHASH, 0 }, |
424 | 424 |
425 { ngx_string("proxy_port"), NULL, ngx_http_proxy_port_variable, 0, | 425 { ngx_string("proxy_port"), NULL, ngx_http_proxy_port_variable, 0, |
426 NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOHASH, 0 }, | 426 NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOHASH, 0 }, |
427 | 427 |
428 { ngx_string("proxy_add_x_forwarded_for"), NULL, | 428 { ngx_string("proxy_add_x_forwarded_for"), NULL, |
429 ngx_http_proxy_add_x_forwarded_for_variable, 0, NGX_HTTP_VAR_NOHASH, 0 }, | 429 ngx_http_proxy_add_x_forwarded_for_variable, 0, NGX_HTTP_VAR_NOHASH, 0 }, |
430 | 430 |
431 #if 0 | 431 #if 0 |
559 } | 559 } |
560 | 560 |
561 len += r->uri.len - loc_len + escape + sizeof("?") - 1 + r->args.len; | 561 len += r->uri.len - loc_len + escape + sizeof("?") - 1 + r->args.len; |
562 } | 562 } |
563 | 563 |
564 ngx_http_script_flush_no_cachable_variables(r, plcf->flushes); | 564 ngx_http_script_flush_no_cacheable_variables(r, plcf->flushes); |
565 | 565 |
566 if (plcf->body_set_len) { | 566 if (plcf->body_set_len) { |
567 le.ip = plcf->body_set_len->elts; | 567 le.ip = plcf->body_set_len->elts; |
568 le.request = r; | 568 le.request = r; |
569 le.flushed = 1; | 569 le.flushed = 1; |
1247 | 1247 |
1248 plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); | 1248 plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); |
1249 | 1249 |
1250 v->len = plcf->host_header.len; | 1250 v->len = plcf->host_header.len; |
1251 v->valid = 1; | 1251 v->valid = 1; |
1252 v->no_cachable = 0; | 1252 v->no_cacheable = 0; |
1253 v->not_found = 0; | 1253 v->not_found = 0; |
1254 v->data = plcf->host_header.data; | 1254 v->data = plcf->host_header.data; |
1255 | 1255 |
1256 return NGX_OK; | 1256 return NGX_OK; |
1257 } | 1257 } |
1265 | 1265 |
1266 plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); | 1266 plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); |
1267 | 1267 |
1268 v->len = plcf->port.len; | 1268 v->len = plcf->port.len; |
1269 v->valid = 1; | 1269 v->valid = 1; |
1270 v->no_cachable = 0; | 1270 v->no_cacheable = 0; |
1271 v->not_found = 0; | 1271 v->not_found = 0; |
1272 v->data = plcf->port.data; | 1272 v->data = plcf->port.data; |
1273 | 1273 |
1274 return NGX_OK; | 1274 return NGX_OK; |
1275 } | 1275 } |
1280 ngx_http_variable_value_t *v, uintptr_t data) | 1280 ngx_http_variable_value_t *v, uintptr_t data) |
1281 { | 1281 { |
1282 u_char *p; | 1282 u_char *p; |
1283 | 1283 |
1284 v->valid = 1; | 1284 v->valid = 1; |
1285 v->no_cachable = 0; | 1285 v->no_cacheable = 0; |
1286 v->not_found = 0; | 1286 v->not_found = 0; |
1287 | 1287 |
1288 if (r->headers_in.x_forwarded_for == NULL) { | 1288 if (r->headers_in.x_forwarded_for == NULL) { |
1289 v->len = r->connection->addr_text.len; | 1289 v->len = r->connection->addr_text.len; |
1290 v->data = r->connection->addr_text.data; | 1290 v->data = r->connection->addr_text.data; |
1324 v->not_found = 1; | 1324 v->not_found = 1; |
1325 return NGX_OK; | 1325 return NGX_OK; |
1326 } | 1326 } |
1327 | 1327 |
1328 v->valid = 1; | 1328 v->valid = 1; |
1329 v->no_cachable = 0; | 1329 v->no_cacheable = 0; |
1330 v->not_found = 0; | 1330 v->not_found = 0; |
1331 | 1331 |
1332 v->data = ngx_palloc(r->connection->pool, NGX_SIZE_T_LEN); | 1332 v->data = ngx_palloc(r->connection->pool, NGX_SIZE_T_LEN); |
1333 | 1333 |
1334 if (v->data == NULL) { | 1334 if (v->data == NULL) { |