Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 641:5e8fb59c18c1 release-0.3.42
nginx-0.3.42-RELEASE import
*) Feature: the "bind" option of the "listen" directive in IMAP/POP3
proxy.
*) Bugfix: if the same capture in the "rewrite" directive was used more
then once.
*) Bugfix: the $sent_http_content_type, $sent_http_content_length,
$sent_http_last_modified, $sent_http_connection,
$sent_http_keep_alive, and $sent_http_transfer_encoding variables
were not written to access log.
*) Bugfix: the $sent_http_cache_control returned value of the single
"Cache-Control" response header line.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 26 Apr 2006 09:52:47 +0000 |
parents | 715d24327080 |
children | 4946078f0a79 |
comparison
equal
deleted
inserted
replaced
640:5fd31c2fe4a8 | 641:5e8fb59c18c1 |
---|---|
199 return; | 199 return; |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 | 203 |
204 static | 204 static void |
205 void ngx_http_init_request(ngx_event_t *rev) | 205 ngx_http_init_request(ngx_event_t *rev) |
206 { | 206 { |
207 socklen_t len; | |
207 ngx_uint_t i; | 208 ngx_uint_t i; |
208 socklen_t len; | |
209 struct sockaddr_in sin; | 209 struct sockaddr_in sin; |
210 ngx_connection_t *c; | 210 ngx_connection_t *c; |
211 ngx_http_request_t *r; | 211 ngx_http_request_t *r; |
212 ngx_http_in_port_t *hip; | 212 ngx_http_in_port_t *hip; |
213 ngx_http_in_addr_t *hia; | 213 ngx_http_in_addr_t *hia; |
272 | 272 |
273 /* find the server configuration for the address:port */ | 273 /* find the server configuration for the address:port */ |
274 | 274 |
275 /* AF_INET only */ | 275 /* AF_INET only */ |
276 | 276 |
277 hip = c->servers; | 277 hip = c->listening->servers; |
278 hia = hip->addrs; | 278 hia = hip->addrs; |
279 | 279 |
280 r->port = hip->port; | 280 r->port = hip->port; |
281 r->port_text = &hip->port_text; | 281 r->port_text = &hip->port_text; |
282 | 282 |
309 } | 309 } |
310 | 310 |
311 r->in_addr = sin.sin_addr.s_addr; | 311 r->in_addr = sin.sin_addr.s_addr; |
312 } | 312 } |
313 | 313 |
314 /* the last in_port->addrs address is "*" */ | 314 /* the last address is "*" */ |
315 | 315 |
316 for ( /* void */ ; i < hip->naddrs - 1; i++) { | 316 for ( /* void */ ; i < hip->naddrs - 1; i++) { |
317 if (hia[i].addr == r->in_addr) { | 317 if (hia[i].addr == r->in_addr) { |
318 break; | 318 break; |
319 } | 319 } |
1403 | 1403 |
1404 if (rc == NGX_ERROR | 1404 if (rc == NGX_ERROR |
1405 || rc == NGX_HTTP_REQUEST_TIME_OUT | 1405 || rc == NGX_HTTP_REQUEST_TIME_OUT |
1406 || r->connection->error) | 1406 || r->connection->error) |
1407 { | 1407 { |
1408 if (rc == NGX_HTTP_CLIENT_CLOSED_REQUEST | |
1409 && r->headers_out.status == 0) | |
1410 { | |
1411 r->headers_out.status = NGX_HTTP_CLIENT_CLOSED_REQUEST; | |
1412 } | |
1413 | |
1408 if (ngx_http_post_action(r) == NGX_OK) { | 1414 if (ngx_http_post_action(r) == NGX_OK) { |
1409 return; | 1415 return; |
1410 } | 1416 } |
1411 | 1417 |
1412 ngx_http_close_request(r, 0); | 1418 ngx_http_close_request(r, 0); |