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.
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index cb7c9e8..852a9bb 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -586,27 +586,7 @@
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 @@
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 @@
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);