agentzh
October 13, 2011 03:12AM
Hello!

Here attaches a patch for the nginx 1.1.5 core to fix a long standing
bug in the ngx_http_named_location function.

I think we should clear out all the modules' contexts there just as in
ngx_http_internal_redirect, or we'll observe weird issues due to
left-over obsolete module contexts from the original request before
the jump. Here is a bad case in action:
http://www.ruby-forum.com/topic/2765027

Regards,
-agentzh

--- nginx-1.1.5/src/http/ngx_http_core_module.c 2011-09-27
19:14:02.000000000 +0800
+++ nginx-1.1.5-patched/src/http/ngx_http_core_module.c 2011-10-13
15:02:24.414550532 +0800
@@ -2542,6 +2542,9 @@
r->content_handler = NULL;
r->loc_conf = (*clcfp)->loc_conf;

+ /* clear the modules contexts */
+ ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
+
ngx_http_update_location_config(r);

cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] clear modules' contexts in ngx_http_named_location Attachments

agentzh 1801 October 13, 2011 03:12AM

Re: [PATCH] clear modules' contexts in ngx_http_named_location

Maxim Dounin 649 October 13, 2011 03:26PM

Re: [PATCH] clear modules' contexts in ngx_http_named_location

Maxim Dounin 818 October 15, 2011 05:44PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 286
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready