aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-08-23 15:36:54 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-08-23 15:36:54 +0000
commitb85fd593e08b8f27a18fb7e2feda02f01d9db15d (patch)
tree42cb06ce67a69d1eba948ecc9733b6465e4bbf6f /src/http/ngx_http_core_module.c
parent25e571ff74c1d649d0bee724250a66852f3b062c (diff)
downloadnginx-b85fd593e08b8f27a18fb7e2feda02f01d9db15d.tar.gz
nginx-b85fd593e08b8f27a18fb7e2feda02f01d9db15d.zip
nginx-0.1.42-RELEASE importrelease-0.1.42
*) 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.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c58
1 files changed, 35 insertions, 23 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index cb7c9e8d0..852a9bbc0 100644
--- 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_request_t *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_request_t *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_request_t *r,
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);