Mercurial > hg > nginx-quic
diff src/http/ngx_http_core_module.c @ 535:563ad09abf50 release-0.1.42
nginx-0.1.42-RELEASE import
*) Bugfix: if the request URI had a zero length after the processing in
the ngx_http_proxy_module, then the segmentation fault or bus error
occurred in the ngx_http_proxy_module.
*) Bugfix: the "limit_rate" directive did not work inside the "if"
block; the bug had appeared in 0.1.38.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 23 Aug 2005 15:36:54 +0000 |
parents | c3bd8cdabb8f |
children | 371c1cee100d |
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -586,27 +586,7 @@ ngx_http_find_location_config(ngx_http_r return NGX_HTTP_NOT_FOUND; } - r->connection->log->file = clcf->err_log->file; - if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) { - r->connection->log->log_level = clcf->err_log->log_level; - } - - if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) { - r->connection->sendfile = 1; - - } else { - r->connection->sendfile = 0; - } - - if (r->keepalive && clcf->keepalive_timeout == 0) { - r->keepalive = 0; - } - - if (!clcf->tcp_nopush) { - /* disable TCP_NOPUSH/TCP_CORK use */ - r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED; - } - + ngx_http_update_location_config(r); ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http cl:%z max:%uz", @@ -640,13 +620,43 @@ ngx_http_find_location_config(ngx_http_r return NGX_HTTP_MOVED_PERMANENTLY; } + return NGX_OK; +} + + +void +ngx_http_update_location_config(ngx_http_request_t *r) +{ + ngx_http_core_loc_conf_t *clcf; + + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + + r->connection->log->file = clcf->err_log->file; + if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) { + r->connection->log->log_level = clcf->err_log->log_level; + } + + if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) { + r->connection->sendfile = 1; + + } else { + r->connection->sendfile = 0; + } + + if (r->keepalive && clcf->keepalive_timeout == 0) { + r->keepalive = 0; + } + + if (!clcf->tcp_nopush) { + /* disable TCP_NOPUSH/TCP_CORK use */ + r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED; + } + r->limit_rate = clcf->limit_rate; if (clcf->handler) { r->content_handler = clcf->handler; } - - return NGX_OK; } @@ -1072,6 +1082,8 @@ ngx_http_internal_redirect(ngx_http_requ cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); r->loc_conf = cscf->ctx->loc_conf; + ngx_http_update_location_config(r); + r->internal = 1; ngx_http_handler(r);