Mercurial > hg > nginx-ranges
comparison src/http/ngx_http_request.c @ 356:b743d290eb3b NGINX_0_6_22
nginx 0.6.22
*) Change: now all ngx_http_perl_module methods return values copied to
perl's allocated memory.
*) Bugfix: if nginx was built with ngx_http_perl_module, the perl
before 5.8.6 was used, and perl supported threads, then during
reconfiguration the master process aborted; bug appeared in
0.5.9.
Thanks to Boris Zhmurov.
*) Bugfix: the ngx_http_perl_module methods may get invalid values of
the regex captures.
*) Bugfix: a segmentation fault occurred in worker process, if the
$r->has_request_body() method was called for a request whose small
request body was already received.
*) Bugfix: large_client_header_buffers did not freed before going to
keep-alive state.
Thanks to Olexander Shtepa.
*) Bugfix: the last address was missed in the $upstream_addr variable;
bug appeared in 0.6.18.
*) Bugfix: the "fastcgi_catch_stderr" directive did return error code;
now it returns 502 code, that can be rerouted to a next server using
the "fastcgi_next_upstream invalid_header" directive.
*) Bugfix: a segmentation fault occurred in master process if the
"fastcgi_catch_stderr" directive was used; bug appeared in
0.6.10.
Thanks to Manlio Perillo.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 19 Dec 2007 00:00:00 +0300 |
parents | 583decdb82a4 |
children | 9121a0a91f47 |
comparison
equal
deleted
inserted
replaced
355:3ac45897a61c | 356:b743d290eb3b |
---|---|
230 ngx_http_log_ctx_t *ctx; | 230 ngx_http_log_ctx_t *ctx; |
231 ngx_http_connection_t *hc; | 231 ngx_http_connection_t *hc; |
232 ngx_http_core_srv_conf_t *cscf; | 232 ngx_http_core_srv_conf_t *cscf; |
233 ngx_http_core_loc_conf_t *clcf; | 233 ngx_http_core_loc_conf_t *clcf; |
234 ngx_http_core_main_conf_t *cmcf; | 234 ngx_http_core_main_conf_t *cmcf; |
235 #if (NGX_HTTP_SSL) | |
236 ngx_http_ssl_srv_conf_t *sscf; | |
237 #endif | |
238 | 235 |
239 #if (NGX_STAT_STUB) | 236 #if (NGX_STAT_STUB) |
240 ngx_atomic_fetch_add(ngx_stat_reading, -1); | 237 ngx_atomic_fetch_add(ngx_stat_reading, -1); |
241 #endif | 238 #endif |
242 | 239 |
352 | 349 |
353 rev->handler = ngx_http_process_request_line; | 350 rev->handler = ngx_http_process_request_line; |
354 | 351 |
355 #if (NGX_HTTP_SSL) | 352 #if (NGX_HTTP_SSL) |
356 | 353 |
354 { | |
355 ngx_http_ssl_srv_conf_t *sscf; | |
356 | |
357 sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); | 357 sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); |
358 if (sscf->enable) { | 358 if (sscf->enable) { |
359 | 359 |
360 if (c->ssl == NULL) { | 360 if (c->ssl == NULL) { |
361 if (ngx_ssl_create_connection(&sscf->ssl, c, NGX_SSL_BUFFER) | 361 if (ngx_ssl_create_connection(&sscf->ssl, c, NGX_SSL_BUFFER) |
367 | 367 |
368 rev->handler = ngx_http_ssl_handshake; | 368 rev->handler = ngx_http_ssl_handshake; |
369 } | 369 } |
370 | 370 |
371 r->main_filter_need_in_memory = 1; | 371 r->main_filter_need_in_memory = 1; |
372 } | |
372 } | 373 } |
373 | 374 |
374 #endif | 375 #endif |
375 | 376 |
376 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | 377 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
1396 | 1397 |
1397 | 1398 |
1398 static void | 1399 static void |
1399 ngx_http_process_request(ngx_http_request_t *r) | 1400 ngx_http_process_request(ngx_http_request_t *r) |
1400 { | 1401 { |
1401 ngx_connection_t *c; | 1402 ngx_connection_t *c; |
1402 #if (NGX_HTTP_SSL) | |
1403 long rc; | |
1404 ngx_http_ssl_srv_conf_t *sscf; | |
1405 #endif | |
1406 | 1403 |
1407 c = r->connection; | 1404 c = r->connection; |
1408 | 1405 |
1409 if (r->plain_http) { | 1406 if (r->plain_http) { |
1410 ngx_log_error(NGX_LOG_INFO, c->log, 0, | 1407 ngx_log_error(NGX_LOG_INFO, c->log, 0, |
1414 } | 1411 } |
1415 | 1412 |
1416 #if (NGX_HTTP_SSL) | 1413 #if (NGX_HTTP_SSL) |
1417 | 1414 |
1418 if (c->ssl) { | 1415 if (c->ssl) { |
1416 long rc; | |
1417 ngx_http_ssl_srv_conf_t *sscf; | |
1418 | |
1419 sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); | 1419 sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); |
1420 | 1420 |
1421 if (sscf->verify) { | 1421 if (sscf->verify) { |
1422 rc = SSL_get_verify_result(c->ssl->connection); | 1422 rc = SSL_get_verify_result(c->ssl->connection); |
1423 | 1423 |
1467 ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len, | 1467 ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len, |
1468 ngx_uint_t hash) | 1468 ngx_uint_t hash) |
1469 { | 1469 { |
1470 ngx_http_core_loc_conf_t *clcf; | 1470 ngx_http_core_loc_conf_t *clcf; |
1471 ngx_http_core_srv_conf_t *cscf; | 1471 ngx_http_core_srv_conf_t *cscf; |
1472 #if (NGX_PCRE) | |
1473 ngx_int_t n; | |
1474 ngx_uint_t i; | |
1475 ngx_str_t name; | |
1476 ngx_http_server_name_t *sn; | |
1477 #endif | |
1478 | 1472 |
1479 cscf = ngx_hash_find_combined(&r->virtual_names->names, hash, host, len); | 1473 cscf = ngx_hash_find_combined(&r->virtual_names->names, hash, host, len); |
1480 | 1474 |
1481 if (cscf) { | 1475 if (cscf) { |
1482 goto found; | 1476 goto found; |
1483 } | 1477 } |
1484 | 1478 |
1485 #if (NGX_PCRE) | 1479 #if (NGX_PCRE) |
1486 | 1480 |
1487 if (r->virtual_names->nregex) { | 1481 if (r->virtual_names->nregex) { |
1482 ngx_int_t n; | |
1483 ngx_uint_t i; | |
1484 ngx_str_t name; | |
1485 ngx_http_server_name_t *sn; | |
1488 | 1486 |
1489 name.len = len; | 1487 name.len = len; |
1490 name.data = host; | 1488 name.data = host; |
1491 | 1489 |
1492 sn = r->virtual_names->regex; | 1490 sn = r->virtual_names->regex; |
2093 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc free: %p %d", | 2091 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc free: %p %d", |
2094 hc->free, hc->nfree); | 2092 hc->free, hc->nfree); |
2095 | 2093 |
2096 if (hc->free) { | 2094 if (hc->free) { |
2097 for (i = 0; i < hc->nfree; i++) { | 2095 for (i = 0; i < hc->nfree; i++) { |
2098 ngx_pfree(c->pool, hc->free[i]); | 2096 ngx_pfree(c->pool, hc->free[i]->start); |
2099 hc->free[i] = NULL; | 2097 hc->free[i] = NULL; |
2100 } | 2098 } |
2101 | 2099 |
2102 hc->nfree = 0; | 2100 hc->nfree = 0; |
2103 } | 2101 } |
2105 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc busy: %p %d", | 2103 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc busy: %p %d", |
2106 hc->busy, hc->nbusy); | 2104 hc->busy, hc->nbusy); |
2107 | 2105 |
2108 if (hc->busy) { | 2106 if (hc->busy) { |
2109 for (i = 0; i < hc->nbusy; i++) { | 2107 for (i = 0; i < hc->nbusy; i++) { |
2110 ngx_pfree(c->pool, hc->busy[i]); | 2108 ngx_pfree(c->pool, hc->busy[i]->start); |
2111 hc->busy[i] = NULL; | 2109 hc->busy[i] = NULL; |
2112 } | 2110 } |
2113 | 2111 |
2114 hc->nbusy = 0; | 2112 hc->nbusy = 0; |
2115 } | 2113 } |