From mdounin at mdounin.ru Wed Feb 1 00:31:41 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 1 Feb 2012 04:31:41 +0400 Subject: Patch for nginx handling of X-Accel-Redirect URLs In-Reply-To: <8b6059000146223e8d811ef594799638@yourcmc.ru> References: <8b6059000146223e8d811ef594799638@yourcmc.ru> Message-ID: <20120201003141.GS67687@mdounin.ru> Hello! On Wed, Feb 01, 2012 at 03:51:18AM +0400, vitalif at yourcmc.ru wrote: > Hello! > > By now, nginx does not allow urlencoded X-Accel-Redirect URLs and > totally fails to access files with '?' in name with it. > The problem was also discussed at 'nginx' maillist: > http://nginx.2469901.n2.nabble.com/Bug-X-Accel-Redirect-td5510716.html > > The patch suggested there just unescaped the url in > ngx_http_parse_unsafe_uri(). As Maxim Dounin said, this is incorrect > because also unescapes the query string. > I want to suggest another solution - swap > ngx_http_parse_unsafe_uri() to ngx_http_parse_complex_uri(). The > patch is in attachment. > What can you say about it? > This is a patch for nginx 1.1.12 handling of X-Accel-Redirect URLs: > run them through ngx_http_parse_complex_uri(), not ngx_http_parse_unsafe_uri(). > It allows to handle percent-encoded URLs and complex filenames in X-Accel-Redirect > (for example, filenames which contain '?'). I don't think that swap with ngx_http_parse_complex_uri() is a good idea. It's very specialized function to parse original request uri, and in particular it modifies many private request fields which shouldn't be modified by proxy. I would rather like to see ngx_http_parse_unsafe_uri() changes done right (i.e. unescape only uri, but not query string, and preserve checks currently done). Note that among standard modules the change of ngx_http_parse_unsafe_uri() will also affect dav and ssi modules. I think that in both cases effect will be similar to one with X-Accel-Redirect, i.e. positive (though I haven't checked too deep). Maxim Dounin From mdounin at mdounin.ru Wed Feb 1 01:13:41 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 1 Feb 2012 05:13:41 +0400 Subject: rewritten redirect with relative url In-Reply-To: References: Message-ID: <20120201011340.GT67687@mdounin.ru> Hello! On Tue, Jan 31, 2012 at 03:39:03PM -0800, Dave Bailey wrote: > Hi, > > In ngx_http_upstream_rewrite_location(), r->upstream->rewrite_redirect may > replace the Location header value with a new value. This value ends up > going through ngx_http_header_filter(), and if it's a relative URL, the > header filter adds a scheme and host to it. However, if > r->upstream->rewrite_redirect declines (rc = NGX_DECLINED) to rewrite the > redirect, the value does not go through ngx_http_header_filter() even if it > is a relative URL. > > Is this intended behavior? If it is not, I attached a patch that sets > r->headers_out.location consistently. I believe the intended behaviour is: 1. If we got relative redirect from a backend and are going to pass it to a client - don't touch it. It's backend which breaks RFC, so we don't care. In the code path without upstream->rewrite_redirect set you may even see special code to protect such redirects: if (ho->value.data[0] != '/') { r->headers_out.location = ho; } /* * we do not set r->headers_out.location here to avoid the handling * the local redirects without a host name by ngx_http_header_filter() */ return NGX_OK; 2. If we are about to produce our own relative redirect - make sure it will be properly converted to absolute one by the header filter. The code looks correct here. The problem I see is that if rewrite_redirect() returns NGX_DECLINED, the r->headers_out.location won't be set and it won't be possible to clear it in case we'll need to. The same applies to relative redirects from a backend though, and requires reconsidering of the "don't set r->headers_out.location to avoid handling by ngx_http_header_filter()" policy to make mentioned clearing indeed possible. Maxim Dounin From dave at daveb.net Wed Feb 1 01:37:22 2012 From: dave at daveb.net (Dave Bailey) Date: Tue, 31 Jan 2012 17:37:22 -0800 Subject: rewritten redirect with relative url In-Reply-To: <20120201011340.GT67687@mdounin.ru> References: <20120201011340.GT67687@mdounin.ru> Message-ID: Hi, On Tue, Jan 31, 2012 at 5:13 PM, Maxim Dounin wrote: > Hello! > > On Tue, Jan 31, 2012 at 03:39:03PM -0800, Dave Bailey wrote: > > > Hi, > > > > In ngx_http_upstream_rewrite_location(), r->upstream->rewrite_redirect > may > > replace the Location header value with a new value. This value ends up > > going through ngx_http_header_filter(), and if it's a relative URL, the > > header filter adds a scheme and host to it. However, if > > r->upstream->rewrite_redirect declines (rc = NGX_DECLINED) to rewrite the > > redirect, the value does not go through ngx_http_header_filter() even if > it > > is a relative URL. > > > > Is this intended behavior? If it is not, I attached a patch that sets > > r->headers_out.location consistently. > > I believe the intended behaviour is: > > 1. If we got relative redirect from a backend and are going to pass it > to a client - don't touch it. It's backend which breaks RFC, so > we don't care. > > In the code path without upstream->rewrite_redirect set you may even see > special code to protect such redirects: > > if (ho->value.data[0] != '/') { > r->headers_out.location = ho; > } > > /* > * we do not set r->headers_out.location here to avoid the handling > * the local redirects without a host name by ngx_http_header_filter() > */ > > return NGX_OK; > > 2. If we are about to produce our own relative redirect - make > sure it will be properly converted to absolute one by the header > filter. > OK, thank you. So this is intended. The problem I am having is that the conversion to an absolute URL always uses a scheme of http:// unless the connection is an actual SSL connection. This means that if SSL is terminated at a load balancer and nginx listens on a non-SSL port, rewritten redirects are converted to absolute with a scheme of http:// even though the actual request was https://. I can work around it by having my callback emit an absolute URL with the correct scheme. But, any interest in providing a way for nginx to do the same? e.g. server { # SSL terminated elsewhere listen 444; # force https scheme on rewritten redirects converted to absolute urls scheme_https on; } > The code looks correct here. > > The problem I see is that if rewrite_redirect() returns > NGX_DECLINED, the r->headers_out.location won't be set and it > won't be possible to clear it in case we'll need to. > > The same applies to relative redirects from a backend though, and > requires reconsidering of the "don't set r->headers_out.location > to avoid handling by ngx_http_header_filter()" policy to make > mentioned clearing indeed possible. > > Maxim Dounin > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > -dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.richardson at gmail.com Wed Feb 1 03:27:37 2012 From: rick.richardson at gmail.com (Rick Richardson) Date: Tue, 31 Jan 2012 22:27:37 -0500 Subject: Lua/Redis Routing with Failover Message-ID: I have a requirement to route dynamically by domain to a set of all participating peers similar to the Dynamic Request Routing Based on Redis in Open Resty, the difference is that if one upstream peer is down, I'd like to fail over to the next one. So Redis would return a priority-sorted list of upstream peers for any given domain instead of 1. My plan is to build make an array of peer structs available to lua so that my lua script can populate the array on each upstream.init. Then a custom upstream->peers.get/free would set or reset the current chosen peer. I think that this would mean that I would have to have a custom upstream. Is there an easier way? From agentzh at gmail.com Wed Feb 1 04:25:06 2012 From: agentzh at gmail.com (agentzh) Date: Wed, 1 Feb 2012 12:25:06 +0800 Subject: Lua/Redis Routing with Failover In-Reply-To: References: Message-ID: On Wed, Feb 1, 2012 at 11:27 AM, Rick Richardson wrote: > I have a requirement to route dynamically by domain to a set of all > participating peers similar to the Dynamic Request Routing Based on > Redis in Open Resty, the difference is that if one upstream peer is > down, I'd like to fail over to the next one. So Redis would return a > priority-sorted list of upstream peers for any given domain instead of > 1. > > Well, just put multiple (redis) servers into every upstream config block, like this: upstream A { server foo.com:6379; server bar.com:6379 backup; } Then bar.com:6379 will be a backup node for foo.com:6379 when foo.com:6379is down. Best regards, -agentzh -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitalif at yourcmc.ru Wed Feb 1 11:01:44 2012 From: vitalif at yourcmc.ru (=?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQuNC70LjQv9C/0L7Qsg==?=) Date: Wed, 01 Feb 2012 15:01:44 +0400 Subject: Patch for nginx handling of X-Accel-Redirect URLs In-Reply-To: <20120201003141.GS67687@mdounin.ru> References: <8b6059000146223e8d811ef594799638@yourcmc.ru> <20120201003141.GS67687@mdounin.ru> Message-ID: <5f518c78-7223-4f42-b304-b759b04bd240@email.android.com> But this will basically duplicate ngx_http_parse_complex_uri's functionality in parse_unsafe_uri (at least part of it). Maybe just try to make it less "specific"? Why not have a single function for URI parsing? -- ?????????? ? ?????????? ???????? ????? ?-9 Mail. ???????? ?? ?????????, ??????????. Maxim Dounin ???????(?): Hello! On Wed, Feb 01, 2012 at 03:51:18AM +0400, vitalif at yourcmc.ru wrote: > Hello! > > By now, nginx does not allow urlencoded X-Accel-Redirect URLs and > totally fails to access files with '?' in name with it. > The problem was also discussed at 'nginx' maillist: > http://nginx.2469901.n2.nabble.com/Bug-X-Accel-Redirect-td5510716.html > > The patch suggested there just unescaped the url in > ngx_http_parse_unsafe_uri(). As Maxim Dounin said, this is incorrect > because also unescapes the query string. > I want to suggest another solution - swap > ngx_http_parse_unsafe_uri() to ngx_http_parse_complex_uri(). The > patch is in attachment. > What can you say about it? > This is a patch for nginx 1.1.12 handling of X-Accel-Redirect URLs: > run them through ngx_http_parse_complex_uri(), not ngx_http_parse_unsafe_uri(). > It allows to handle percent-encoded URLs and complex filenames in X-Accel-Redirect > (for example, filenames which contain '?'). I don't think that swap with ngx_http_parse_complex_uri() is a good idea. It's very specialized function to parse original request uri, and in particular it modifies many private request fields which shouldn't be modified by proxy. I would rather like to see ngx_http_parse_unsafe_uri() changes done right (i.e. unescape only uri, but not query string, and preserve checks currently done). Note that among standard modules the change of ngx_http_parse_unsafe_uri() will also affect dav and ssi modules. I think that in both cases effect will be similar to one with X-Accel-Redirect, i.e. positive (though I haven't checked too deep). Maxim Dounin _____________________________________________ nginx-devel mailing list nginx-devel at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Wed Feb 1 14:38:12 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 1 Feb 2012 18:38:12 +0400 Subject: Patch for nginx handling of X-Accel-Redirect URLs In-Reply-To: <5f518c78-7223-4f42-b304-b759b04bd240@email.android.com> References: <8b6059000146223e8d811ef594799638@yourcmc.ru> <20120201003141.GS67687@mdounin.ru> <5f518c78-7223-4f42-b304-b759b04bd240@email.android.com> Message-ID: <20120201143812.GW67687@mdounin.ru> Hello! On Wed, Feb 01, 2012 at 03:01:44PM +0400, ??????? ???????? wrote: > But this will basically duplicate ngx_http_parse_complex_uri's > functionality in parse_unsafe_uri (at least part of it). Maybe > just try to make it less "specific"? Why not have a single > function for URI parsing? The ngx_http_parse_complex_uri() function is part of a request parsing code, optimized for the specific task of parsing URI of a request in case it's complex and can't be parsed by ngx_http_parse_request_line(). It's not a generic URI parsing function and never was intended to be. Maxim Dounin > -- > ?????????? ? ?????????? ???????? ????? ?-9 Mail. ???????? ?? ?????????, ??????????. > > Maxim Dounin ???????(?): > > Hello! > > On Wed, Feb 01, 2012 at 03:51:18AM +0400, vitalif at yourcmc.ru wrote: > > > Hello! > > > > By now, nginx does not allow urlencoded X-Accel-Redirect URLs and > > totally fails to access files with '?' in name with it. > > The problem was also discussed at 'nginx' maillist: > > http://nginx.2469901.n2.nabble.com/Bug-X-Accel-Redirect-td5510716.html > > > > The patch suggested there just unescaped the url in > > ngx_http_parse_unsafe_uri(). As Maxim Dounin said, this is incorrect > > because also unescapes the query string. > > I want to suggest another solution - swap > > ngx_http_parse_unsafe_uri() to ngx_http_parse_complex_uri(). The > > patch is in attachment. > > What can you say about it? > > > This is a patch for nginx 1.1.12 handling of X-Accel-Redirect URLs: > > run them through ngx_http_parse_complex_uri(), not ngx_http_parse_unsafe_uri(). > > It allows to handle percent-encoded URLs and complex filenames in X-Accel-Redirect > > (for example, filenames which contain '?'). > > I don't think that swap with ngx_http_parse_complex_uri() is a > good idea. It's very specialized function to parse original > request uri, and in particular it modifies many private request > fields which shouldn't be modified by proxy. > > I would rather like to see ngx_http_parse_unsafe_uri() changes > done right (i.e. unescape only uri, but not query string, and > preserve checks currently done). > > Note that among standard modules the change of > ngx_http_parse_unsafe_uri() will also affect dav and ssi modules. > I think that in both cases effect will be similar to one with > X-Accel-Redirect, i.e. positive (though I haven't checked too > deep). > > Maxim Dounin > > _____________________________________________ > > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From rick.richardson at gmail.com Wed Feb 1 16:05:11 2012 From: rick.richardson at gmail.com (Rick Richardson) Date: Wed, 1 Feb 2012 11:05:11 -0500 Subject: Lua/Redis Routing with Failover Message-ID: Sorry for the confusion. I don't want failover/backup for redis servers, I want the redis request to return multiple upstreams that I can proxy to with proxy_pass. E.g. I get a request for Foo.com. I ask redis for a list of upstream servers to which I can serve Foo.com. I then feed the entire list somehow into proxy_pass. It then performs its normal htttp_upstream operation as if it had a standard list of peers in an upstream. On Jan 31, 2012 11:25 PM, "agentzh" wrote: -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.richardson at gmail.com Wed Feb 1 17:02:41 2012 From: rick.richardson at gmail.com (Rick Richardson) Date: Wed, 1 Feb 2012 12:02:41 -0500 Subject: Lua/Redis Routing with Failover In-Reply-To: References: Message-ID: So in my conf I would have: upstream myroutes { lua_redis_route; keepalive; } location / { access_by_lua ' Fetch a list of peers with failover info from redis and then populate the lua_redis_route upstream peer array with that data ' } The idea is simply that I would fetch a current list of peers from redis and plug them in to nginx's existing upstream. This would allow me to elegantly handle failure by failing over to the next peer on the list and then report that peer as 'down' back to redis. On Feb 1, 2012 11:05 AM, "Rick Richardson" wrote: > Sorry for the confusion. I don't want failover/backup for redis servers, I > want the redis request to return multiple upstreams that I can proxy to > with proxy_pass. > > E.g. I get a request for Foo.com. I ask redis for a list of upstream > servers to which I can serve Foo.com. I then feed the entire list somehow > into proxy_pass. It then performs its normal htttp_upstream operation as > if it had a standard list of peers in an upstream. > On Jan 31, 2012 11:25 PM, "agentzh" wrote: > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitalif at yourcmc.ru Wed Feb 1 22:34:06 2012 From: vitalif at yourcmc.ru (vitalif at yourcmc.ru) Date: Thu, 02 Feb 2012 02:34:06 +0400 Subject: Patch for nginx handling of X-Accel-Redirect URLs In-Reply-To: <20120201143812.GW67687@mdounin.ru> References: <8b6059000146223e8d811ef594799638@yourcmc.ru> <20120201003141.GS67687@mdounin.ru> <5f518c78-7223-4f42-b304-b759b04bd240@email.android.com> <20120201143812.GW67687@mdounin.ru> Message-ID: <800817095345e824ec87febd4674fd35@yourcmc.ru> > The ngx_http_parse_complex_uri() function is part of a request > parsing code, optimized for the specific task of parsing URI of a > request in case it's complex and can't be parsed by > ngx_http_parse_request_line(). It's not a generic URI parsing > function and never was intended to be. So, do you mean that nginx is meant to not have such "generic URI parsing function" at all? Okay - do you think it's sufficient just to change ngx_unescape_uri(&dst, &src, uri->len, 0); to ngx_unescape_uri(&dst, &src, uri->len, NGX_UNESCAPE_URI); in the previous patch? (i.e. in http://www.coderain.de/nginx/nginx-0.8.52-xred.patch) P.S: what's NGX_UNESCAPE_REDIRECT? From vitalif at yourcmc.ru Wed Feb 1 23:27:27 2012 From: vitalif at yourcmc.ru (vitalif at yourcmc.ru) Date: Thu, 02 Feb 2012 03:27:27 +0400 Subject: Patch for nginx handling of X-Accel-Redirect URLs In-Reply-To: <20120201143812.GW67687@mdounin.ru> References: <8b6059000146223e8d811ef594799638@yourcmc.ru> <20120201003141.GS67687@mdounin.ru> <5f518c78-7223-4f42-b304-b759b04bd240@email.android.com> <20120201143812.GW67687@mdounin.ru> Message-ID: <9a6b12669e6851d01405a18506920feb@yourcmc.ru> A new version of patch, unescaping in ngx_http_parse_unsafe_uri()... Note that it required removing if (ch == ?) blocks that come AFTER decoding the character (I don't understand their purpose, they seem incorrect, as escaped '?' does not mean the beginning of query string). And I still don't understand what NGX_UNESCAPE_REDIRECT is... :-) -------------- next part -------------- A non-text attachment was scrubbed... Name: patch-nginx-x-accel-uri-parsing.diff Type: text/x-c Size: 1898 bytes Desc: not available URL: From brian at akins.org Thu Feb 2 02:57:54 2012 From: brian at akins.org (Brian Akins) Date: Wed, 1 Feb 2012 21:57:54 -0500 Subject: Lua/Redis Routing with Failover In-Reply-To: References: Message-ID: You can't really change the upstream list on the fly. However you could do something like this (psuedo code) location / { set $backend "default.backend.server"; rewrite_by_lua ' res = ngx.location.capture("/redis", { method = ngx.HTTP_PUT, body = "srandmember setwithbackends\r\n" } -- parse res.body to get the value ngx.var.backend = backend_that_I_parsed ' proxy_pass $backend$uri; } from http://wiki.nginx.org/HttpRedis2Module#Lua_Interoperability location /redis { internal; redis2_raw_query $echo_request_body; redis2_pass 127.0.0.1:6379; } If redis set has hostnames in it, you'll need to have resolver enabled. If you wanted, you could wrap the proxy_pass in a capture and try the list in order until you got a good response. From agentzh at gmail.com Thu Feb 2 04:19:59 2012 From: agentzh at gmail.com (agentzh) Date: Thu, 2 Feb 2012 12:19:59 +0800 Subject: Lua/Redis Routing with Failover In-Reply-To: References: Message-ID: On Thu, Feb 2, 2012 at 12:05 AM, Rick Richardson wrote: > Sorry for the confusion. I don't want failover/backup for redis servers, I > want the redis request to return multiple upstreams that I can proxy to with > proxy_pass. > > E.g. I get a request for Foo.com. I ask redis for a list of upstream servers > to which I can serve Foo.com.? I then feed the entire list somehow into > proxy_pass.? It then performs its normal htttp_upstream operation as if it > had a standard list of peers in an upstream. > Sorry for the misunderstanding :) I think we could just patch ngx_proxy and mimic ngx_http_upstream_create_round_robin_peer to dynamically construct a peer list for the current request, just like how ngx_proxy does now for multiple A records corresponding to a single host name if the dynamic resolver is used. You can have a try ;) Maybe it makes sense to provide a generic interface for ngx_proxy to make such things easy. Best regards, -agentzh From rick.richardson at gmail.com Thu Feb 2 04:41:00 2012 From: rick.richardson at gmail.com (Rick Richardson) Date: Wed, 1 Feb 2012 23:41:00 -0500 Subject: Lua/Redis Routing with Failover In-Reply-To: References: Message-ID: Right. So I'm basically doing just that, I've made an upstream /backend { redis_route; keepalive; } upstream /redis { ... } location /servers { internal; redis2_query get $host; redis2_pass redis_cluster; } location / { ... proxy_pass backend; } I am working on a module called redis_route which is an upstream patterned after rr This executes a subrequest to /servers which returns a Redis List of uris. I then parse those URIs and put them into an array which is then accessed when the upstream->peer.get callback is called requesting a new server. I store the rest, so if that backend uri fails, upstream->peer.get will be called for the next one on the list. Does this make sense? / On Wed, Feb 1, 2012 at 11:19 PM, agentzh wrote: > On Thu, Feb 2, 2012 at 12:05 AM, Rick Richardson > wrote: >> Sorry for the confusion. I don't want failover/backup for redis servers, I >> want the redis request to return multiple upstreams that I can proxy to with >> proxy_pass. >> >> E.g. I get a request for Foo.com. I ask redis for a list of upstream servers >> to which I can serve Foo.com.? I then feed the entire list somehow into >> proxy_pass.? It then performs its normal htttp_upstream operation as if it >> had a standard list of peers in an upstream. >> > > Sorry for the misunderstanding :) > > I think we could just patch ngx_proxy and mimic > ngx_http_upstream_create_round_robin_peer to dynamically construct a > peer list for the current request, just like how ngx_proxy does now > for multiple A records corresponding to a single host name if the > dynamic resolver is used. You can have a try ;) > > Maybe it makes sense to provide a generic interface for ngx_proxy to > make such things easy. > > Best regards, > -agentzh > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From agentzh at gmail.com Thu Feb 2 08:50:22 2012 From: agentzh at gmail.com (agentzh) Date: Thu, 2 Feb 2012 16:50:22 +0800 Subject: Lua/Redis Routing with Failover In-Reply-To: References: Message-ID: On Thu, Feb 2, 2012 at 12:41 PM, Rick Richardson wrote: > Right. ?So I'm basically doing just that, ?I've made an > [...] > > I am working on a module called redis_route which is an upstream > patterned after rr > This executes a subrequest to /servers which returns a Redis List of > uris. I then parse those > URIs and put them into an array which is then accessed when the > upstream->peer.get callback is called requesting a new server. > I store the rest, so if that backend uri fails, upstream->peer.get > will be called for the next one on the list. > > Does this make sense? > Hmm, can we make the UI a bit more generic? We can surely fetch our peer list from backends other than redis, like mysql, postgresql, memcached, and etc etc etc ;) Regards, -agentzh From mdounin at mdounin.ru Thu Feb 2 11:34:57 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 2 Feb 2012 15:34:57 +0400 Subject: Patch for nginx handling of X-Accel-Redirect URLs In-Reply-To: <800817095345e824ec87febd4674fd35@yourcmc.ru> References: <8b6059000146223e8d811ef594799638@yourcmc.ru> <20120201003141.GS67687@mdounin.ru> <5f518c78-7223-4f42-b304-b759b04bd240@email.android.com> <20120201143812.GW67687@mdounin.ru> <800817095345e824ec87febd4674fd35@yourcmc.ru> Message-ID: <20120202113457.GC67687@mdounin.ru> Hello! On Thu, Feb 02, 2012 at 02:34:06AM +0400, vitalif at yourcmc.ru wrote: > >The ngx_http_parse_complex_uri() function is part of a request > >parsing code, optimized for the specific task of parsing URI of a > >request in case it's complex and can't be parsed by > >ngx_http_parse_request_line(). It's not a generic URI parsing > >function and never was intended to be. > > So, do you mean that nginx is meant to not have such "generic URI > parsing function" at all? More or less generic one is ngx_http_parse_unsafe_uri(). > Okay - do you think it's sufficient just to change > ngx_unescape_uri(&dst, &src, uri->len, 0); > to > ngx_unescape_uri(&dst, &src, uri->len, NGX_UNESCAPE_URI); > in the previous patch? (i.e. in > http://www.coderain.de/nginx/nginx-0.8.52-xred.patch) No. The NGX_UNESCAPE_URI won't be sufficient, and it's in fact does the wrong thing: it will stop unescaping on first unescaped '?', thus preventing files with two question marks from working. > P.S: what's NGX_UNESCAPE_REDIRECT? It's the flag used by "rewrite ... redirect;". It's somewhat broken and needs fixing, see tests and comments here: http://mdounin.ru/hg/nginx-tests/file/tip/rewrite_unescape.t Maxim Dounin From vitalif at yourcmc.ru Thu Feb 2 11:58:42 2012 From: vitalif at yourcmc.ru (vitalif at yourcmc.ru) Date: Thu, 02 Feb 2012 15:58:42 +0400 Subject: Patch for nginx handling of X-Accel-Redirect URLs In-Reply-To: <20120202113457.GC67687@mdounin.ru> References: <8b6059000146223e8d811ef594799638@yourcmc.ru> <20120201003141.GS67687@mdounin.ru> <5f518c78-7223-4f42-b304-b759b04bd240@email.android.com> <20120201143812.GW67687@mdounin.ru> <800817095345e824ec87febd4674fd35@yourcmc.ru> <20120202113457.GC67687@mdounin.ru> Message-ID: <15f1253d3f05ed59e3bb62bc4bfbd4e9@yourcmc.ru> > No. The NGX_UNESCAPE_URI won't be sufficient, and it's in fact > does the wrong thing: it will stop unescaping on first unescaped > '?', thus preventing files with two question marks from working. ...And why is it wrong??? As far as I know, the first UNESCAPED '?' means the beginning of query string. If you want to pass a link to file with two '??' in the name, just escape them and that's it. (Tested the last patch which I've sent, and it allows access to such files) From rick.richardson at gmail.com Thu Feb 2 12:38:45 2012 From: rick.richardson at gmail.com (Rick Richardson) Date: Thu, 2 Feb 2012 07:38:45 -0500 Subject: Lua/Redis Routing with Failover Message-ID: You're right. At this point the only redis specific thing is parsing the output of the subrequest to /backend. I could make future versions take a token or regex that will parse the output into an array. On Feb 2, 2012 3:50 AM, "agentzh" wrote: -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Thu Feb 2 16:43:23 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 2 Feb 2012 20:43:23 +0400 Subject: Patch for nginx handling of X-Accel-Redirect URLs In-Reply-To: <15f1253d3f05ed59e3bb62bc4bfbd4e9@yourcmc.ru> References: <8b6059000146223e8d811ef594799638@yourcmc.ru> <20120201003141.GS67687@mdounin.ru> <5f518c78-7223-4f42-b304-b759b04bd240@email.android.com> <20120201143812.GW67687@mdounin.ru> <800817095345e824ec87febd4674fd35@yourcmc.ru> <20120202113457.GC67687@mdounin.ru> <15f1253d3f05ed59e3bb62bc4bfbd4e9@yourcmc.ru> Message-ID: <20120202164323.GD67687@mdounin.ru> Hello! On Thu, Feb 02, 2012 at 03:58:42PM +0400, vitalif at yourcmc.ru wrote: > >No. The NGX_UNESCAPE_URI won't be sufficient, and it's in fact > >does the wrong thing: it will stop unescaping on first unescaped > >'?', thus preventing files with two question marks from working. > > ...And why is it wrong??? > As far as I know, the first UNESCAPED '?' means the beginning of > query string. > If you want to pass a link to file with two '??' in the name, just > escape them and that's it. > (Tested the last patch which I've sent, and it allows access to such > files) The "unescaped '?'" in my quote above should be read as "a question mark which was obtained via removing %xx escaping from a URI". That is, on "%3D" it will unescape it and stop. In the patch you've sent you've removed relevant code from ngx_unescape_uri(), and that's why it works for you. I'll review the patch as time permits. Maxim Dounin From devfua at qq.com Fri Feb 3 06:02:12 2012 From: devfua at qq.com (=?gbk?B?ZGV2ZnVh?=) Date: Fri, 3 Feb 2012 14:02:12 +0800 Subject: A coredump risk in core/ngx_resolver.c Message-ID: /* convert "www.example.com" to "\3www\7example\3com\0" */ len = 0; p--; *p-- = '\0'; for (s = ctx->name.data + ctx->name.len - 1; s >= ctx->name.data; s--) { if (*s != '.') { *p = *s; len++; } else { if (len == 0) { return NGX_DECLINED; } *p = (u_char) len; len = 0; } p--; } *p = (u_char) len; line 1778 if (*s != '.') { if ctx->name.data = 0x0 ctx->name.len = 0 s = 0xffffffff *s will cause segment fault? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From devfua at qq.com Fri Feb 3 05:28:25 2012 From: devfua at qq.com (=?gbk?B?ZGV2ZnVh?=) Date: Fri, 3 Feb 2012 13:28:25 +0800 Subject: A coredump risk in core/ngx_resolver.c Message-ID: /* convert "www.example.com" to "\3www\7example\3com\0" */ len = 0; p--; *p-- = '\0'; for (s = ctx->name.data + ctx->name.len - 1; s >= ctx->name.data; s--) { if (*s != '.') { *p = *s; len++; } else { if (len == 0) { return NGX_DECLINED; } *p = (u_char) len; len = 0; } p--; } *p = (u_char) len; line 1778 if (*s != '.') { if ctx->name.data = 0x0 ctx->name.len = 0 s = 0xffffffff *s will cause segment fault? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From benji at silverinsanity.com Thu Feb 2 21:17:53 2012 From: benji at silverinsanity.com (Brian Gernhardt) Date: Thu, 2 Feb 2012 16:17:53 -0500 Subject: alias/try_files bug? Message-ID: <3B35ED6C-A2BC-43CE-BC19-BD0AFC0D8C96@silverinsanity.com> My server is running Ubuntu 11.10. I've replicated this bug with both the nginx-light package (1.0.5) and nginx-1.0.10 (compiled via passenger). Here's a shortened version of my site configuration: --- 8< --- server { location /forum/ { alias /srv/www/forum/; index index.php index.html index.htm; location ~ \.php$ { # Try to stop bad PHP requests, as per wiki try_files $uri =404; fastcgi_pass php; } } } --- 8< --- This configuration returns 404 for _all_ PHP requests, even for files that exist. (There is normally a "location /" block that points to a CMS. But removing it still has gives the same error.) If I remove the try_files, the forum works. If I remove the alias and use "root /srv/www" instead, it works. Only when I use try_files and alias does it fail. This looks like a bug to me, but I'm not familiar enough with the nginx source to track it down. ~~ Brian From agentzh at gmail.com Fri Feb 3 08:24:16 2012 From: agentzh at gmail.com (agentzh) Date: Fri, 3 Feb 2012 16:24:16 +0800 Subject: [ANN] Test::Nginx 0.18 just released to CPAN In-Reply-To: References: Message-ID: Hi, folks! I've just uploaded Test::Nginx 0.18 to CPAN: ??? http://search.cpan.org/perldoc?Test::Nginx It will appear on the CPAN mirror near you in the next few hours or so. Special thanks go to all of our users :) Here's the complete change log for this release, compared to the last CPAN release, 0.17: * feature: added new section "--- no_error_log" which could be used to specify patterns of lines that do not appear in error.log at all. * feature: added MOCKEAGAIN_VERBOSE, DYLD_INSERT_LIBRARIES, TOCKEAGAIN_WRITE_TIMEOUT_PATTERN, and LD_PRELOAD to the environments that should be kept through nginx reload and restart. * doc: added Naxsi and ngx_rds_csv to the user module list in the POD documentation. * feature: now we can use the environment TEST_NGINX_USE_VALGRIND to specify the valgrind command-line options, when set to 1 or other non-zero numbers, it is effectively equivalent to the value "--tool=memcheck --leak-check=full". To use Valgrind SGCheck to run the tests, just specify the environment TEST_NGINX_USE_VALGRIND="--tool=exp-sgcheck" first. * feature: added support for environment TEST_NGINX_VERBOSE. * feature: added support for environment TEST_NGINX_USE_HUP. * feature: added support for the TEST_NGINX_POSTPONE_OUTPUT environment. * feature: now we'll retry sending the QUIT signal for at most 5 times when the nginx process is refusing to quit. after 5 trials, KILL signal will be sent. * feature: exposes the "master_off" API which turns off the nginx master process. * feature: added new section "--- ignore_response" to test bad responses. bugfix: Test::Nginx::Socket will retry 10 times if fail to connect because nginx with valgrind can be very slow to start in some systems. * feature: added new section name "--- error_log" to test error lines. requested by Piotr Sikora in the last year or so. * feature: added the TEST_NGINX_EVENT_TYPE environment to specify an event API type (like "epoll" or "select") when running the test suite. This Perl module provides a test scaffold based on IO::Socket or LWP for automated testing in Nginx C module development. This class inherits from Test::Base, thus bringing all its declarative power to the Nginx C module testing practices. Please check out the full documentation on CPAN: ? ?http://search.cpan.org/perldoc?Test::Nginx::Socket All of our Nginx modules are using Test::Nginx to drive their test suites. Please note that this module is completely different from the Test::Nginx module created by Maxim Dounin. Enjoy! -agentzh From ahh at one.com Fri Feb 3 08:50:54 2012 From: ahh at one.com (Adam Hasselbalch Hansen) Date: Fri, 03 Feb 2012 09:50:54 +0100 Subject: Manipulating the body of a PUT/POST Message-ID: <4F2B9FEE.3060601@one.com> Hi there, I am wondering if there is a way to manipulate the contents of a PUT/POST (the request body) in a similar way that filters can manipulate the body of a GET? Would it e.g. be feasible (or even possible) to do a ngx_http_read_client_request_body somewhere, mess about with the body, and then somehow (how?) shove it back into the request, before passing it on to whatever handles the actual writing (dav) or POST-processing (php, whatever) or even upstream to a proxy backend? Any thoughts appeciated! Adam From mdounin at mdounin.ru Fri Feb 3 10:04:51 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 3 Feb 2012 14:04:51 +0400 Subject: Manipulating the body of a PUT/POST In-Reply-To: <4F2B9FEE.3060601@one.com> References: <4F2B9FEE.3060601@one.com> Message-ID: <20120203100450.GH67687@mdounin.ru> Hello! On Fri, Feb 03, 2012 at 09:50:54AM +0100, Adam Hasselbalch Hansen wrote: > Hi there, > > I am wondering if there is a way to manipulate the contents of a > PUT/POST (the request body) in a similar way that filters can > manipulate the body of a GET? > > Would it e.g. be feasible (or even possible) to do a > ngx_http_read_client_request_body somewhere, mess about with the > body, and then somehow (how?) shove it back into the request, before > passing it on to whatever handles the actual writing (dav) or > POST-processing (php, whatever) or even upstream to a proxy backend? > > Any thoughts appeciated! Currently there is no easy way. Some modules (e.g. Valery Kholodkov's upload module) currently do this by reading request body by their own code. I'm working on prototyping input body filtering, it's expected to appear somewhere in 1.2.x. It will allow manipulation of request body, as well as other tasks like content inspection and so on. Maxim Dounin From ahh at one.com Fri Feb 3 10:18:52 2012 From: ahh at one.com (Adam Hasselbalch Hansen) Date: Fri, 03 Feb 2012 11:18:52 +0100 Subject: Manipulating the body of a PUT/POST In-Reply-To: <20120203100450.GH67687@mdounin.ru> References: <4F2B9FEE.3060601@one.com> <20120203100450.GH67687@mdounin.ru> Message-ID: <4F2BB48C.6070609@one.com> On 2012-02-03 11:04, Maxim Dounin wrote: >> I am wondering if there is a way to manipulate the contents of a >> PUT/POST (the request body) in a similar way that filters can >> manipulate the body of a GET? > > Currently there is no easy way. Some modules (e.g. Valery > Kholodkov's upload module) currently do this by reading request > body by their own code. > > I'm working on prototyping input body filtering, it's expected to > appear somewhere in 1.2.x. It will allow manipulation of request > body, as well as other tasks like content inspection and so on. That sounds promising! Until then, I'll have a look at the upload module, see what's going on there. Thanks for the pointer, Adam From mdounin at mdounin.ru Fri Feb 3 10:54:30 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 3 Feb 2012 14:54:30 +0400 Subject: A coredump risk in core/ngx_resolver.c In-Reply-To: References: Message-ID: <20120203105429.GK67687@mdounin.ru> Hello! On Fri, Feb 03, 2012 at 02:02:12PM +0800, devfua wrote: > /* convert "www.example.com" to "\3www\7example\3com\0" */ > > > len = 0; > p--; > *p-- = '\0'; > > > for (s = ctx->name.data + ctx->name.len - 1; s >= ctx->name.data; s--) { > if (*s != '.') { > *p = *s; > len++; > > > } else { > if (len == 0) { > return NGX_DECLINED; > } > > > *p = (u_char) len; > len = 0; > } > > > p--; > } > > > *p = (u_char) len; > > > > line 1778 > if (*s != '.') { > > > if ctx->name.data = 0x0 ctx->name.len = 0 > s = 0xffffffff > > > *s will cause segment fault? Nice catch, thanks. This is not expected to happen with current code, as ngx_resolve_name() is never called with ctx->name set to { NULL, 0 }. Though it needs fixing anyway. Care to provide a patch? Maxim Dounin From mdounin at mdounin.ru Fri Feb 3 11:49:54 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 3 Feb 2012 15:49:54 +0400 Subject: alias/try_files bug? In-Reply-To: <3B35ED6C-A2BC-43CE-BC19-BD0AFC0D8C96@silverinsanity.com> References: <3B35ED6C-A2BC-43CE-BC19-BD0AFC0D8C96@silverinsanity.com> Message-ID: <20120203114954.GL67687@mdounin.ru> Hello! On Thu, Feb 02, 2012 at 04:17:53PM -0500, Brian Gernhardt wrote: > My server is running Ubuntu 11.10. I've replicated this bug > with both the nginx-light package (1.0.5) and nginx-1.0.10 > (compiled via passenger). > > Here's a shortened version of my site configuration: > > --- 8< --- > > server { > location /forum/ { > alias /srv/www/forum/; > index index.php index.html index.htm; > > location ~ \.php$ { > # Try to stop bad PHP requests, as per wiki > try_files $uri =404; > > fastcgi_pass php; > } > } > } > > --- 8< --- > > This configuration returns 404 for _all_ PHP requests, even for > files that exist. (There is normally a "location /" block that > points to a CMS. But removing it still has gives the same > error.) > > If I remove the try_files, the forum works. If I remove the > alias and use "root /srv/www" instead, it works. Only when I > use try_files and alias does it fail. > > This looks like a bug to me, but I'm not familiar enough with > the nginx source to track it down. Yes, this is a bug in try_files, thank you for your report. Reduced test case is: # bug: request "/foo/test.gif" will try "/tmp//foo/test.gif" location /foo/ { alias /tmp/; location ~ gif { try_files $uri =405; } } I've filled a ticket for try_files + alias problems to make sure it won't be lost: http://trac.nginx.org/nginx/ticket/97 Maxim Dounin From edho at myconan.net Fri Feb 3 11:57:22 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 3 Feb 2012 18:57:22 +0700 Subject: alias/try_files bug? In-Reply-To: <20120203114954.GL67687@mdounin.ru> References: <3B35ED6C-A2BC-43CE-BC19-BD0AFC0D8C96@silverinsanity.com> <20120203114954.GL67687@mdounin.ru> Message-ID: On Fri, Feb 3, 2012 at 6:49 PM, Maxim Dounin wrote: > > I've filled a ticket for try_files + alias problems to make sure > it won't be lost: > > http://trac.nginx.org/nginx/ticket/97 > While at it, add this another case: # accessing /~edho/test.php will try # /home/edho/public_html/test.php/~edho/test.php location ~ ^/~([^/]+)/(.+\.php)$ { set $script_filename /home/$1/public_html/$2; alias $script_filename; try_files $uri =404; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $script_filename; fastcgi_pass 127.0.0.1:9000; } -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org From edho at myconan.net Fri Feb 3 12:37:44 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 3 Feb 2012 19:37:44 +0700 Subject: Map capture doesn't work? Message-ID: Taken directly from example[1]: map $uri $new { default http://www.domain.com/home/; /aa http://aa.domain.com/; /bb http://bb.domain.com/; ~^/cc/(?P.*)$ http://animebsd.net/$suffix; /john http://my.domain.com/users/john/; } server { server_name yutsuki.myconan.net; rewrite ^ $new redirect; } Accessing http://yutsuki.myconan.net/cc/whatever redirects to http://animebsd.net/$suffix ($suffix literal). Tried with: nginx version: nginx/1.1.14 built by gcc 4.4.5 (Debian 4.4.5-8) TLS SNI support enabled configure arguments: --prefix=/opt/nginx --user=www-data --group=www-data --with-http_ssl_module --conf-path=/etc/nginx/nginx.conf and (dotdeb) nginx version: nginx/1.0.11 TLS SNI support enabled configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/usr/src/nginx/source/nginx-1.0.11/debian/modules/nginx-echo --add-module=/usr/src/nginx/source/nginx-1.0.11/debian/modules/nginx-upstream-fair --add-module=/usr/src/nginx/source/nginx-1.0.11/debian/modules/nginx-syslog [1] http://wiki.nginx.org/HttpMapModule -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org From larles.gw at gmail.com Fri Feb 3 13:25:21 2012 From: larles.gw at gmail.com (Laurent) Date: Fri, 3 Feb 2012 14:25:21 +0100 Subject: Module: exit master Message-ID: Hi, I'm experiencing some troubles (and headaches) with my little nginx module. I've seen a lot of module code lately, and a ton of stuff about nginx modules but I can't manage to do what I need to. Here is my problem: I have created my own nginx module called "mymodule". Its loc_conf structure looks like that: typedef struct { void *serverConf; ngx_str_t server_file; } ngx_http_mymodule_loc_conf_t; its command structure looks like that: static ngx_command_t ngx_http_mymodule_commands[] = { { ngx_string("mymodule"), NGX_HTTP_LOC_CONF | NGX_CONF_TAKE1, ngx_http_mymodule, NGX_HTTP_LOC_CONF_OFFSET, 0, NULL }, ngx_null_command }; in the ngx_http_mymodule function I do some stuff and set the serverConf pointer in the ngx_http_mymodule_loc_conf_t. The problem is that I would like to retrieve that serverConf pointer when the thread / process is exited. But the only parameter given to ngx_module_t while exiting thread process or master is a ngx_cycle_t* and I can't find how to retrieve the ngx_http_mymodule_loc_conf_t from it in order to work on that serverConf pointer. Any help or idea would be appreciated :) Thanks in advance. -- larles From mdounin at mdounin.ru Fri Feb 3 13:33:57 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 3 Feb 2012 17:33:57 +0400 Subject: alias/try_files bug? In-Reply-To: References: <3B35ED6C-A2BC-43CE-BC19-BD0AFC0D8C96@silverinsanity.com> <20120203114954.GL67687@mdounin.ru> Message-ID: <20120203133357.GM67687@mdounin.ru> Hello! On Fri, Feb 03, 2012 at 06:57:22PM +0700, Edho Arief wrote: > On Fri, Feb 3, 2012 at 6:49 PM, Maxim Dounin wrote: > > > > I've filled a ticket for try_files + alias problems to make sure > > it won't be lost: > > > > http://trac.nginx.org/nginx/ticket/97 > > > > While at it, add this another case: > > # accessing /~edho/test.php will try > # /home/edho/public_html/test.php/~edho/test.php > location ~ ^/~([^/]+)/(.+\.php)$ { > set $script_filename /home/$1/public_html/$2; > alias $script_filename; > try_files $uri =404; > include fastcgi_params; > fastcgi_param SCRIPT_FILENAME $script_filename; > fastcgi_pass 127.0.0.1:9000; > } This is the same case as second one in the ticket. Maxim Dounin From edho at myconan.net Fri Feb 3 13:36:08 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 3 Feb 2012 20:36:08 +0700 Subject: alias/try_files bug? In-Reply-To: <20120203133357.GM67687@mdounin.ru> References: <3B35ED6C-A2BC-43CE-BC19-BD0AFC0D8C96@silverinsanity.com> <20120203114954.GL67687@mdounin.ru> <20120203133357.GM67687@mdounin.ru> Message-ID: On Fri, Feb 3, 2012 at 8:33 PM, Maxim Dounin wrote: > Hello! > > On Fri, Feb 03, 2012 at 06:57:22PM +0700, Edho Arief wrote: > >> On Fri, Feb 3, 2012 at 6:49 PM, Maxim Dounin wrote: >> > >> > I've filled a ticket for try_files + alias problems to make sure >> > it won't be lost: >> > >> > http://trac.nginx.org/nginx/ticket/97 >> > >> >> While at it, add this another case: >> >> # accessing /~edho/test.php will try >> # /home/edho/public_html/test.php/~edho/test.php >> ? location ~ ^/~([^/]+)/(.+\.php)$ { >> ? ? set $script_filename /home/$1/public_html/$2; >> ? ? alias $script_filename; >> ? ? try_files $uri =404; >> ? ? include fastcgi_params; >> ? ? fastcgi_param SCRIPT_FILENAME $script_filename; >> ? ? fastcgi_pass 127.0.0.1:9000; >> ? } > > This is the same case as second one in the ticket. > The result seems different though. Not sure why. -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org From edho at myconan.net Fri Feb 3 13:40:01 2012 From: edho at myconan.net (Edho Arief) Date: Fri, 3 Feb 2012 20:40:01 +0700 Subject: alias/try_files bug? In-Reply-To: References: <3B35ED6C-A2BC-43CE-BC19-BD0AFC0D8C96@silverinsanity.com> <20120203114954.GL67687@mdounin.ru> <20120203133357.GM67687@mdounin.ru> Message-ID: On Fri, Feb 3, 2012 at 8:36 PM, Edho Arief wrote: > On Fri, Feb 3, 2012 at 8:33 PM, Maxim Dounin wrote: >> >> This is the same case as second one in the ticket. >> > > The result seems different though. Not sure why. > Or more like the result on ticket is incorrect. trying to use file: "/test/x" "/tmp/x/test/x" -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org From mdounin at mdounin.ru Fri Feb 3 14:34:23 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 3 Feb 2012 18:34:23 +0400 Subject: Module: exit master In-Reply-To: References: Message-ID: <20120203143422.GO67687@mdounin.ru> Hello! On Fri, Feb 03, 2012 at 02:25:21PM +0100, Laurent wrote: > Hi, > > I'm experiencing some troubles (and headaches) with my little nginx module. > I've seen a lot of module code lately, and a ton of stuff about nginx > modules but I can't manage to do what I need to. > Here is my problem: > I have created my own nginx module called "mymodule". Its loc_conf > structure looks like that: > > typedef struct { > void *serverConf; > ngx_str_t server_file; > } ngx_http_mymodule_loc_conf_t; > > its command structure looks like that: > > static ngx_command_t ngx_http_mymodule_commands[] = { > { > ngx_string("mymodule"), > NGX_HTTP_LOC_CONF | NGX_CONF_TAKE1, > ngx_http_mymodule, > NGX_HTTP_LOC_CONF_OFFSET, > 0, > NULL > }, > ngx_null_command }; > > in the ngx_http_mymodule function I do some stuff and set the > serverConf pointer in the ngx_http_mymodule_loc_conf_t. > The problem is that I would like to retrieve that serverConf pointer > when the thread / process is exited. But the only parameter given to > ngx_module_t while exiting thread process or master is a ngx_cycle_t* > and I can't find how to retrieve the ngx_http_mymodule_loc_conf_t from > it in order to work on that serverConf pointer. You can't get location config from a cycle, as there are multiple locations and each has it's own config. You may get module main config via ngx_http_cycle_get_module_main_conf(). Alternatively, depending on what you are trying to do, just a pool cleanup handler on configuration pool (with arbitrary opaque data passed) may be a better solution. Maxim Dounin From appa at perusio.net Fri Feb 3 14:37:08 2012 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Fri, 03 Feb 2012 14:37:08 +0000 Subject: Map capture doesn't work? In-Reply-To: References: Message-ID: <87haz8ugob.wl%appa@perusio.net> On 3 Fev 2012 12h37 WET, edho at myconan.net wrote: > Taken directly from example[1]: > > map $uri $new { > default http://www.domain.com/home/; > > /aa http://aa.domain.com/; > /bb http://bb.domain.com/; > ~^/cc/(?P.*)$ http://animebsd.net/$suffix; > /john http://my.domain.com/users/john/; > } > > server { > server_name yutsuki.myconan.net; > rewrite ^ $new redirect; > } I tripped over this a few days back. It seems that the capture doesn't work if you had anything surrounding the variable that holds the captured pattern to the right side of the map. Right now the only thing that works is doing something like this: - ~^/cc/(?P.*)$ http://animebsd.net/$suffix; + ~^/cc/(?P.*)$ $suffix; Then add another map *just* for the host and do: return 301 $host_map://$new; --- appa From mdounin at mdounin.ru Fri Feb 3 14:52:53 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 3 Feb 2012 18:52:53 +0400 Subject: Map capture doesn't work? In-Reply-To: References: Message-ID: <20120203145253.GP67687@mdounin.ru> Hello! On Fri, Feb 03, 2012 at 07:37:44PM +0700, Edho Arief wrote: > Taken directly from example[1]: This example is incorrect. > > map $uri $new { > default http://www.domain.com/home/; > > /aa http://aa.domain.com/; > /bb http://bb.domain.com/; > ~^/cc/(?P.*)$ http://animebsd.net/$suffix; > /john http://my.domain.com/users/john/; > } > > server { > server_name yutsuki.myconan.net; > rewrite ^ $new redirect; > } > > Accessing http://yutsuki.myconan.net/cc/whatever redirects to > http://animebsd.net/$suffix ($suffix literal). Map directive currently supports *variable* (single one) as a second parameter, but not a string with variables. I.e. this will work: map $uri $new { ~^/cc/(?P.*)$ $suffix; } but the above doesn't. Maxim Dounin From dave at daveb.net Fri Feb 3 16:53:26 2012 From: dave at daveb.net (Dave Bailey) Date: Fri, 3 Feb 2012 08:53:26 -0800 Subject: error_page and module contexts Message-ID: Hi, As of nginx 1.1.6, it seems that the error_page directive can no longer be used in a way that preserves module contexts to the log phase of the request cycle. This means that if I have a log handler which expects some information that had been saved in a module context before the error_page logic is invoked, that information is no longer accessible when the log handler is actually called. Is there a way to work around this? -dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Fri Feb 3 17:52:54 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 3 Feb 2012 21:52:54 +0400 Subject: error_page and module contexts In-Reply-To: References: Message-ID: <20120203175254.GQ67687@mdounin.ru> Hello! On Fri, Feb 03, 2012 at 08:53:26AM -0800, Dave Bailey wrote: > Hi, > > As of nginx 1.1.6, it seems that the error_page directive can no longer be > used in a way that preserves module contexts to the log phase of the > request cycle. This means that if I have a log handler which expects some > information that had been saved in a module context before the error_page > logic is invoked, that information is no longer accessible when the log > handler is actually called. Is there a way to work around this? Currently the only thing which survives internal redirects (and redirection to a named location as of 1.1.6+) is variables. If you need something persistant, you may register one and store needed information there (up to a pointer to your module context, actually). Maxim Dounin From mdounin at mdounin.ru Fri Feb 3 18:04:32 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 3 Feb 2012 22:04:32 +0400 Subject: alias/try_files bug? In-Reply-To: References: <3B35ED6C-A2BC-43CE-BC19-BD0AFC0D8C96@silverinsanity.com> <20120203114954.GL67687@mdounin.ru> <20120203133357.GM67687@mdounin.ru> Message-ID: <20120203180432.GR67687@mdounin.ru> Hello! On Fri, Feb 03, 2012 at 08:40:01PM +0700, Edho Arief wrote: > On Fri, Feb 3, 2012 at 8:36 PM, Edho Arief wrote: > > On Fri, Feb 3, 2012 at 8:33 PM, Maxim Dounin wrote: > >> > >> This is the same case as second one in the ticket. > >> > > > > The result seems different though. Not sure why. > > > > Or more like the result on ticket is incorrect. > > trying to use file: "/test/x" "/tmp/x/test/x" Yep, this was a typo in comment (I didn't pay enough attention as long as it's different from the expected result). Fixed. Maxim Dounin From dave at daveb.net Fri Feb 3 18:05:46 2012 From: dave at daveb.net (Dave Bailey) Date: Fri, 3 Feb 2012 10:05:46 -0800 Subject: error_page and module contexts In-Reply-To: <20120203175254.GQ67687@mdounin.ru> References: <20120203175254.GQ67687@mdounin.ru> Message-ID: Hi, On Fri, Feb 3, 2012 at 9:52 AM, Maxim Dounin wrote: > Hello! > > On Fri, Feb 03, 2012 at 08:53:26AM -0800, Dave Bailey wrote: > > > Hi, > > > > As of nginx 1.1.6, it seems that the error_page directive can no longer > be > > used in a way that preserves module contexts to the log phase of the > > request cycle. This means that if I have a log handler which expects > some > > information that had been saved in a module context before the error_page > > logic is invoked, that information is no longer accessible when the log > > handler is actually called. Is there a way to work around this? > > Currently the only thing which survives internal redirects (and > redirection to a named location as of 1.1.6+) is variables. If > you need something persistant, you may register one and store > needed information there (up to a pointer to your module context, > actually). > Great, thank you. Looks like this will work perfectly. > Maxim Dounin > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > -dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From ja.nginx at mailnull.com Sat Feb 4 16:47:10 2012 From: ja.nginx at mailnull.com (SamB) Date: Sat, 4 Feb 2012 17:47:10 +0100 Subject: [PATCH] add xslt_stylesheet_param directive Message-ID: Hello, I've modified my patch, according to comments in http://mailman.nginx.org/pipermail/nginx-devel/2012-January/001751.html. Directive has been renamed to xslt_param, taking 2 parameters - name and value separated (similarly to set directive), therefore it's now also possible to pass ':' character as it had been requested before. I think it's better and easier to have it this way + there is no need to do that ugly parsing in runtime ;) Thanks Sam On Tue, Jan 31, 2012 at 1:00 PM, wrote: > > Message: 6 > Date: Tue, 31 Jan 2012 05:52:23 +0400 > From: Maxim Dounin > To: nginx-devel at nginx.org > Subject: Re: [PATCH] add xslt_stylesheet_param directive > Message-ID: <20120131015222.GH67687 at mdounin.ru> > Content-Type: text/plain; charset=us-ascii > > Hello! > > On Tue, Jan 24, 2012 at 11:02:13PM +0100, SamB wrote: > > > Hi, > > next try... > > > > Attached patch adds xslt_stylesheet_param directive processing. > > This is equivalent of xslt parameter passed to xslt_stylesheet, but > this > > works independently and globally. > > xslt config should be a bit simpler because 'common' xslt variables > > don't need to be repeated for each xslt_stylesheet. > > > > Comments/suggestion are welcomed. > > You may have better lock pointing to a previous incarnation of the > patch and outlining changes made. (And please post in plain text, > not html.) > > It was previously submitted here: > > http://mailman.nginx.org/pipermail/nginx-devel/2012-January/001669.html > > And previous review was here: > > http://mailman.nginx.org/pipermail/nginx-devel/2012-January/001670.html > > > > diff -ur nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c > nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c > > --- nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c > 2010-07-12 14:52:01.000000000 +0200 > > +++ nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c > 2012-01-24 22:33:24.000000000 +0100 > > @@ -48,6 +48,7 @@ > > ngx_array_t sheets; /* ngx_http_xslt_sheet_t */ > > ngx_hash_t types; > > ngx_array_t *types_keys; > > + ngx_array_t params; /* ngx_http_complex_value_t */ > > } ngx_http_xslt_filter_loc_conf_t; > > > > > > @@ -84,12 +85,16 @@ > > void *conf); > > static char *ngx_http_xslt_stylesheet(ngx_conf_t *cf, ngx_command_t > *cmd, > > void *conf); > > +static char *ngx_http_xslt_stylesheet_param(ngx_conf_t *cf, > ngx_command_t *cmd, > > + void *conf); > > static void ngx_http_xslt_cleanup_dtd(void *data); > > static void ngx_http_xslt_cleanup_stylesheet(void *data); > > static void *ngx_http_xslt_filter_create_main_conf(ngx_conf_t *cf); > > static void *ngx_http_xslt_filter_create_conf(ngx_conf_t *cf); > > +static char *ngx_http_xslt_filter_merge_params(const ngx_array_t *src, > ngx_array_t *dest); > > static char *ngx_http_xslt_filter_merge_conf(ngx_conf_t *cf, void > *parent, > > void *child); > > +static ngx_int_t ngx_http_xslt_filter_preinit(ngx_conf_t *cf); > > static ngx_int_t ngx_http_xslt_filter_init(ngx_conf_t *cf); > > static void ngx_http_xslt_filter_exit(ngx_cycle_t *cycle); > > > > @@ -116,6 +121,13 @@ > > 0, > > NULL }, > > > > + { ngx_string("xslt_stylesheet_param"), > > + > NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, > > + ngx_http_xslt_stylesheet_param, > > + NGX_HTTP_LOC_CONF_OFFSET, > > + 0, > > + NULL }, > > I tend to think that "xslt_stylesheet_param" is too long. > Something like "xslt_param" whould be better. > > > + > > { ngx_string("xslt_types"), > > > NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, > > ngx_http_types_slot, > > @@ -128,7 +140,7 @@ > > > > > > static ngx_http_module_t ngx_http_xslt_filter_module_ctx = { > > - NULL, /* preconfiguration */ > > + ngx_http_xslt_filter_preinit, /* preconfiguration */ > > The "...preinit" change is unrelated. If you want it to happen - > please submit it seprately. (I think it's noop though.) > > > ngx_http_xslt_filter_init, /* postconfiguration */ > > > > ngx_http_xslt_filter_create_main_conf, /* create main configuration > */ > > @@ -865,6 +877,46 @@ > > } > > > > > > +static char * > > +ngx_http_xslt_stylesheet_param(ngx_conf_t *cf, ngx_command_t *cmd, void > *conf) > > +{ > > + ngx_http_xslt_filter_loc_conf_t *xlcf = conf; > > + > > + ngx_http_complex_value_t *param; > > + ngx_http_compile_complex_value_t ccv; > > + ngx_str_t *value; > > + > > + value = cf->args->elts; > > + > > + /* alloc array */ > > + if (xlcf->params.elts == NULL > > + && ngx_array_init(&xlcf->params, cf->pool, 1, > sizeof(ngx_http_complex_value_t)) > > + != NGX_OK) > > + { > > + return NGX_CONF_ERROR; > > + } > > No lines longer than 80 chars, please. And alignment isn't > styl-complaint either. In this particular case, please just use > another nested if, much like in ngx_http_xslt_stylesheet(): > > if (xlcf->sheets.elts == NULL) { > if (ngx_array_init(&xlcf->sheets, cf->pool, 1, > sizeof(ngx_http_xslt_sheet_t)) > != NGX_OK) > { > return NGX_CONF_ERROR; > } > } > > > + > > + param = ngx_array_push(&xlcf->params); > > + if (param == NULL) { > > + return NGX_CONF_ERROR; > > + } > > + > > + ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); > > + > > + ccv.cf = cf; > > + ccv.value = &value[1]; > > + ccv.complex_value = param; > > + ccv.zero = 1; > > + > > + if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { > > + return NGX_CONF_ERROR; > > + } > > + > > + return NGX_CONF_OK; > > +} > > + > > + > > + > > 2 blank lines between functions, please. 3 blank lines before > ngx_http_xslt_stylesheet() is a bug, not a rule. > > Another question to consider: there was at least one request to > simplify passing XPath expressions in params by allowing ':', see > here: > > http://mailman.nginx.org/pipermail/nginx-devel/2010-July/000414.html > http://mailman.nginx.org/pipermail/nginx-devel/2010-September/000486.html > > With separate directive we may want to allow this. Not sure > though, probably it would be better to preserve compatibility with > a way how parameters in xslt_stylesheet directive are handled. > > > static void > > ngx_http_xslt_cleanup_dtd(void *data) > > { > > @@ -931,6 +983,37 @@ > > > > > > static char * > > +ngx_http_xslt_filter_merge_params(const ngx_array_t *src, ngx_array_t > *dest) > > +{ > > + ngx_uint_t i; > > + > > + /* copy params */ > > + if (src->nelts && !dest->nelts) { > > + dest->elts = src->elts; > > + dest->nelts = src->nelts; > > + } > > + /* join params */ > > + else if (src->nelts && dest->nelts) { > > + ngx_http_complex_value_t *params; > > + > > + params = src->elts; > > + for (i = 0; i < src->nelts; i++) { > > + ngx_http_complex_value_t *new; > > + > > + new = ngx_array_push(dest); > > + if (new == NULL) { > > + return NGX_CONF_ERROR; > > + } > > + > > + *new = params[i]; /* copy */ > > + } > > + } > > + > > + return NGX_CONF_OK; > > +} > > + > > + > > +static char * > > ngx_http_xslt_filter_merge_conf(ngx_conf_t *cf, void *parent, void > *child) > > { > > ngx_http_xslt_filter_loc_conf_t *prev = parent; > > @@ -940,9 +1023,26 @@ > > conf->dtd = prev->dtd; > > } > > > > + if (ngx_http_xslt_filter_merge_params(&prev->params, &conf->params) > > + != NGX_CONF_OK) { > > + return NGX_CONF_ERROR; > > + } > > As I already said in the previous review, params should follow the > same logic as other array-type directives (access_log, > proxy_set_header, fastcgi_param, error_page, ...). I.e. if you > define any directive on a particular level, previous level data > should not be inherited: > > location / { > xslt_param foo=1; > > location /bar/ { > xslt_param bar=1; > } > } > > In location /bar/ only "bar=1" parameter should be present. > > Please also note that with your code it's not possible to clear > inherited params at all. > > > + > > if (conf->sheets.nelts == 0) { > > conf->sheets = prev->sheets; > > } > > + else { > > + ngx_http_xslt_sheet_t *sheet; > > + ngx_uint_t i; > > + > > + sheet = conf->sheets.elts; > > + for (i = 0; i < conf->sheets.nelts; i++) { > > + if (ngx_http_xslt_filter_merge_params(&conf->params, > &sheet[i].params) > > + != NGX_CONF_OK) { > > + return NGX_CONF_ERROR; > > + } > > + } > > + } > > This is wrong. Consider configuration like this: > > location / { > xslt_stylesheet root.xslt; > > location /foo/ { > xslt_params foo=bar; > } > } > > With the above merge logic in location /foo/ the root.xslt > stylesheet will be used without parameters, while "foo=bar" is > clearly expected. > > I suggest to use simple array-type inheritance for params, like > > if (conf->params == NULL) { > conf->params = prev->params; > } > > and apply them separately to the stylesheet at runtime. This will > resolve both problems outlined above. > > > > > if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types, > > &prev->types_keys, &prev->types, > > @@ -957,7 +1057,7 @@ > > > > > > static ngx_int_t > > -ngx_http_xslt_filter_init(ngx_conf_t *cf) > > +ngx_http_xslt_filter_preinit(ngx_conf_t *cf) > > { > > xmlInitParser(); > > > > @@ -965,6 +1065,13 @@ > > exsltRegisterAll(); > > #endif > > > > + return NGX_OK; > > +} > > + > > + > > +static ngx_int_t > > +ngx_http_xslt_filter_init(ngx_conf_t *cf) > > +{ > > ngx_http_next_header_filter = ngx_http_top_header_filter; > > ngx_http_top_header_filter = ngx_http_xslt_header_filter; > > > > See above, this is unrelated change. > > Maxim Dounin > > > > ------------------------------ > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > > End of nginx-devel Digest, Vol 27, Issue 26 > ******************************************* > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx-1.1.13-xslt-params.patch Type: application/octet-stream Size: 5432 bytes Desc: not available URL: From mdounin at mdounin.ru Sat Feb 4 22:23:12 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sat, 4 Feb 2012 22:23:12 +0000 Subject: [nginx] svn commit: r4429 - in branches/stable-1.0/src: core http/modules/perl Message-ID: <20120204222312.6D7193F9C2F@mail.nginx.com> Author: mdounin Date: 2012-02-04 22:23:12 +0000 (Sat, 04 Feb 2012) New Revision: 4429 Log: Version bump. Modified: branches/stable-1.0/src/core/nginx.h branches/stable-1.0/src/http/modules/perl/nginx.pm Modified: branches/stable-1.0/src/core/nginx.h =================================================================== --- branches/stable-1.0/src/core/nginx.h 2012-01-30 13:52:35 UTC (rev 4428) +++ branches/stable-1.0/src/core/nginx.h 2012-02-04 22:23:12 UTC (rev 4429) @@ -8,8 +8,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1000011 -#define NGINX_VERSION "1.0.11" +#define nginx_version 1000012 +#define NGINX_VERSION "1.0.12" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" Modified: branches/stable-1.0/src/http/modules/perl/nginx.pm =================================================================== --- branches/stable-1.0/src/http/modules/perl/nginx.pm 2012-01-30 13:52:35 UTC (rev 4428) +++ branches/stable-1.0/src/http/modules/perl/nginx.pm 2012-02-04 22:23:12 UTC (rev 4429) @@ -48,7 +48,7 @@ HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '1.0.11'; +our $VERSION = '1.0.12'; require XSLoader; XSLoader::load('nginx', $VERSION); From mdounin at mdounin.ru Sat Feb 4 22:30:31 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sat, 4 Feb 2012 22:30:31 +0000 Subject: [nginx] svn commit: r4430 - in branches/stable-1.0: . src/http Message-ID: <20120204223031.AD0393F9C58@mail.nginx.com> Author: mdounin Date: 2012-02-04 22:30:30 +0000 (Sat, 04 Feb 2012) New Revision: 4430 Log: Merge of r4326: Fix for read_head with try_files and open_file_cache. The of.read_ahead wasn't set in try_files code path, causing read_ahead directive to be a nop if try_files and open_file_cache were used. Modified: branches/stable-1.0/ branches/stable-1.0/src/http/ngx_http_core_module.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4305,4307-4309,4313,4315,4321,4342-4343 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4305,4307-4309,4313,4315,4321,4326,4342-4343 Modified: branches/stable-1.0/src/http/ngx_http_core_module.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_core_module.c 2012-02-04 22:23:12 UTC (rev 4429) +++ branches/stable-1.0/src/http/ngx_http_core_module.c 2012-02-04 22:30:30 UTC (rev 4430) @@ -1289,6 +1289,7 @@ ngx_memzero(&of, sizeof(ngx_open_file_info_t)); + of.read_ahead = clcf->read_ahead; of.directio = clcf->directio; of.valid = clcf->open_file_cache_valid; of.min_uses = clcf->open_file_cache_min_uses; From mdounin at mdounin.ru Sat Feb 4 23:18:13 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sat, 4 Feb 2012 23:18:13 +0000 Subject: [nginx] svn commit: r4431 - in branches/stable-1.0: . src/event/modules Message-ID: <20120204231813.6009C3F9CBC@mail.nginx.com> Author: mdounin Date: 2012-02-04 23:18:12 +0000 (Sat, 04 Feb 2012) New Revision: 4431 Log: Merge of r4306, r4320: Protection from stale write events in epoll. Stale write event may happen if epoll_wait() reported both read and write events, and processing of the read event closed descriptor. Modified: branches/stable-1.0/ branches/stable-1.0/src/event/modules/ngx_epoll_module.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4305,4307-4309,4313,4315,4321,4326,4342-4343 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326,4342-4343 Modified: branches/stable-1.0/src/event/modules/ngx_epoll_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_epoll_module.c 2012-02-04 22:30:30 UTC (rev 4430) +++ branches/stable-1.0/src/event/modules/ngx_epoll_module.c 2012-02-04 23:18:12 UTC (rev 4431) @@ -683,6 +683,18 @@ if ((revents & EPOLLOUT) && wev->active) { + if (c->fd == -1 || wev->instance != instance) { + + /* + * the stale event from a file descriptor + * that was just closed in this iteration + */ + + ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, + "epoll: stale event %p", c); + continue; + } + if (flags & NGX_POST_THREAD_EVENTS) { wev->posted_ready = 1; From mdounin at mdounin.ru Sat Feb 4 23:28:10 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sat, 4 Feb 2012 23:28:10 +0000 Subject: [nginx] svn commit: r4432 - in branches/stable-1.0: . src/core Message-ID: <20120204232810.E102E3F9E29@mail.nginx.com> Author: mdounin Date: 2012-02-04 23:28:10 +0000 (Sat, 04 Feb 2012) New Revision: 4432 Log: Merge of r4327: Removed unused function ngx_regex_capture_count(). The function has been unused since r3326 (0.8.25). Modified: branches/stable-1.0/ branches/stable-1.0/src/core/ngx_regex.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326,4342-4343 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4342-4343 Modified: branches/stable-1.0/src/core/ngx_regex.c =================================================================== --- branches/stable-1.0/src/core/ngx_regex.c 2012-02-04 23:18:12 UTC (rev 4431) +++ branches/stable-1.0/src/core/ngx_regex.c 2012-02-04 23:28:10 UTC (rev 4432) @@ -137,23 +137,6 @@ ngx_int_t -ngx_regex_capture_count(ngx_regex_t *re) -{ - int rc, n; - - n = 0; - - rc = pcre_fullinfo(re, NULL, PCRE_INFO_CAPTURECOUNT, &n); - - if (rc < 0) { - return (ngx_int_t) rc; - } - - return (ngx_int_t) n; -} - - -ngx_int_t ngx_regex_exec_array(ngx_array_t *a, ngx_str_t *s, ngx_log_t *log) { ngx_int_t n; From potworyk at gmail.com Sun Feb 5 11:37:31 2012 From: potworyk at gmail.com (potworyk) Date: Sun, 5 Feb 2012 12:37:31 +0100 Subject: GSoC 2012 and SPDY Message-ID: Hi, I am wondering if nginx project have any plans to be mentoring organization in current GSoC (Google Summer of Code)? It would be great for project and for students like me. Personally I am currently doing research on SPDY protocol on university. I've also read that nginx has done some research in that area and as Mozilla added support for SPDY its going to be hot topic again. I have to write some code as a part of my work so I thought that I could do something for open source community particularly nginx project and implement some basic SPDY support. If you don't want SPDY, maybe there are other task for students? From al-nginx at none.at Sun Feb 5 12:05:39 2012 From: al-nginx at none.at (Aleksandar Lazic) Date: Sun, 05 Feb 2012 13:05:39 +0100 Subject: GSoC 2012 and SPDY In-Reply-To: References: Message-ID: <7ce16dfbca20578a24f27eaf0e74d949@none.at> Hi Potworyk, On 05-02-2012 12:37, potworyk wrote: > Hi, > > I am wondering if nginx project have any plans to be mentoring > organization in current GSoC (Google Summer of Code)? It would be > great for project and for students like me. > > Personally I am currently doing research on SPDY protocol on > university. I've also read that nginx has done some research in that > area and as Mozilla added support for SPDY its going to be hot topic > again. I have to write some code as a part of my work so I thought > that I could do something for open source community particularly > nginx > project and implement some basic SPDY support. Do you know the SPDY Lib? http://daniel.haxx.se/blog/2012/01/06/join-the-spdy-library-development/ Maybe it would be possible to make a ngx_http_spdy_module like the http://www.nginx.org/en/docs/http/ngx_http_xslt_module.html which depends on libxml2 and libxslt BR Aleks From mdounin at mdounin.ru Sun Feb 5 12:28:35 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 12:28:35 +0000 Subject: [nginx] svn commit: r4433 - in branches/stable-1.0: . auto Message-ID: <20120205122835.BB5463F9C55@mail.nginx.com> Author: mdounin Date: 2012-02-05 12:28:35 +0000 (Sun, 05 Feb 2012) New Revision: 4433 Log: Merge of r4377: configure on Solaris fixed. Modified: branches/stable-1.0/ branches/stable-1.0/auto/install Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4342-4343 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4342-4343,4377 Modified: branches/stable-1.0/auto/install =================================================================== --- branches/stable-1.0/auto/install 2012-02-04 23:28:10 UTC (rev 4432) +++ branches/stable-1.0/auto/install 2012-02-05 12:28:35 UTC (rev 4433) @@ -72,7 +72,7 @@ esac -if test -e man/nginx.8 ; then +if test -f man/nginx.8 ; then NGX_MAN=man/nginx.8 else NGX_MAN=docs/man/nginx.8 From mdounin at mdounin.ru Sun Feb 5 12:37:48 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 12:37:48 +0000 Subject: [nginx] svn commit: r4434 - in branches/stable-1.0: . src/http Message-ID: <20120205123748.C3A4A3F9C1A@mail.nginx.com> Author: mdounin Date: 2012-02-05 12:37:48 +0000 (Sun, 05 Feb 2012) New Revision: 4434 Log: Merge of r4335: Fixed: some of $sent_http_* variables might contain header entries which actually wasn't sent to a client. The ngx_http_variable_headers() and ngx_http_variable_unknown_header() functions did not ignore response header entries with zero "hash" field. Thanks to Yichun Zhang (agentzh). Modified: branches/stable-1.0/ branches/stable-1.0/src/http/ngx_http_variables.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4342-4343,4377 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335,4342-4343,4377 Modified: branches/stable-1.0/src/http/ngx_http_variables.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_variables.c 2012-02-05 12:28:35 UTC (rev 4433) +++ branches/stable-1.0/src/http/ngx_http_variables.c 2012-02-05 12:37:48 UTC (rev 4434) @@ -640,8 +640,8 @@ ngx_http_variable_headers(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) { - ssize_t len; - u_char *p; + size_t len; + u_char *p, *end; ngx_uint_t i, n; ngx_array_t *a; ngx_table_elt_t **h; @@ -649,18 +649,30 @@ a = (ngx_array_t *) ((char *) r + data); n = a->nelts; + h = a->elts; - if (n == 0) { + len = 0; + + for (i = 0; i < n; i++) { + + if (h[i]->hash == 0) { + continue; + } + + len += h[i]->value.len + sizeof("; ") - 1; + } + + if (len == 0) { v->not_found = 1; return NGX_OK; } + len -= sizeof("; ") - 1; + v->valid = 1; v->no_cacheable = 0; v->not_found = 0; - h = a->elts; - if (n == 1) { v->len = (*h)->value.len; v->data = (*h)->value.data; @@ -668,12 +680,6 @@ return NGX_OK; } - len = - (ssize_t) (sizeof("; ") - 1); - - for (i = 0; i < n; i++) { - len += h[i]->value.len + sizeof("; ") - 1; - } - p = ngx_pnalloc(r->pool, len); if (p == NULL) { return NGX_ERROR; @@ -682,10 +688,17 @@ v->len = len; v->data = p; + end = p + len; + for (i = 0; /* void */ ; i++) { + + if (h[i]->hash == 0) { + continue; + } + p = ngx_copy(p, h[i]->value.data, h[i]->value.len); - if (i == n - 1) { + if (p == end) { break; } @@ -738,6 +751,10 @@ i = 0; } + if (header[i].hash == 0) { + continue; + } + for (n = 0; n + prefix < var->len && n < header[i].key.len; n++) { ch = header[i].key.data[n]; From mdounin at mdounin.ru Sun Feb 5 12:42:36 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 12:42:36 +0000 Subject: [nginx] svn commit: r4435 - in branches/stable-1.0: . src/os/unix Message-ID: <20120205124237.A06FC3F9C96@mail.nginx.com> Author: mdounin Date: 2012-02-05 12:42:36 +0000 (Sun, 05 Feb 2012) New Revision: 4435 Log: Merge r4336: Microoptimization of sendfile(2) usage under FreeBSD. FreeBSD kernel checks headers/trailers pointer against NULL, not corresponding count. Passing NULL if there are no headers/trailers helps to avoid unneeded work in kernel, as well as unexpected 0 bytes GIO in traces. Modified: branches/stable-1.0/ branches/stable-1.0/src/os/unix/ngx_freebsd_sendfile_chain.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335,4342-4343,4377 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4342-4343,4377 Modified: branches/stable-1.0/src/os/unix/ngx_freebsd_sendfile_chain.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_freebsd_sendfile_chain.c 2012-02-05 12:37:48 UTC (rev 4434) +++ branches/stable-1.0/src/os/unix/ngx_freebsd_sendfile_chain.c 2012-02-05 12:42:36 UTC (rev 4435) @@ -246,9 +246,14 @@ } } - hdtr.headers = (struct iovec *) header.elts; + /* + * sendfile() does unneeded work if sf_hdtr's count is 0, + * but corresponding pointer is not NULL + */ + + hdtr.headers = header.nelts ? (struct iovec *) header.elts: NULL; hdtr.hdr_cnt = header.nelts; - hdtr.trailers = (struct iovec *) trailer.elts; + hdtr.trailers = trailer.nelts ? (struct iovec *) trailer.elts: NULL; hdtr.trl_cnt = trailer.nelts; /* From mdounin at mdounin.ru Sun Feb 5 12:46:22 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 12:46:22 +0000 Subject: [nginx] svn commit: r4436 - in branches/stable-1.0: . src/http Message-ID: <20120205124622.847F53F9C29@mail.nginx.com> Author: mdounin Date: 2012-02-05 12:46:20 +0000 (Sun, 05 Feb 2012) New Revision: 4436 Log: Merge of r4338: Renamed some constants to improve readability, no functional changes. Modified: branches/stable-1.0/ branches/stable-1.0/src/http/ngx_http_header_filter_module.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4342-4343,4377 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338,4342-4343,4377 Modified: branches/stable-1.0/src/http/ngx_http_header_filter_module.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_header_filter_module.c 2012-02-05 12:42:36 UTC (rev 4435) +++ branches/stable-1.0/src/http/ngx_http_header_filter_module.c 2012-02-05 12:46:20 UTC (rev 4436) @@ -61,8 +61,8 @@ /* ngx_null_string, */ /* "207 Multi-Status" */ -#define NGX_HTTP_LAST_LEVEL_200 207 -#define NGX_HTTP_LEVEL_200 (NGX_HTTP_LAST_LEVEL_200 - 200) +#define NGX_HTTP_LAST_2XX 207 +#define NGX_HTTP_OFF_3XX (NGX_HTTP_LAST_2XX - 200) /* ngx_null_string, */ /* "300 Multiple Choices" */ @@ -75,8 +75,8 @@ /* ngx_null_string, */ /* "306 unused" */ /* ngx_null_string, */ /* "307 Temporary Redirect" */ -#define NGX_HTTP_LAST_LEVEL_300 305 -#define NGX_HTTP_LEVEL_300 (NGX_HTTP_LAST_LEVEL_300 - 301) +#define NGX_HTTP_LAST_3XX 305 +#define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX) ngx_string("400 Bad Request"), ngx_string("401 Unauthorized"), @@ -108,8 +108,8 @@ /* ngx_null_string, */ /* "423 Locked" */ /* ngx_null_string, */ /* "424 Failed Dependency" */ -#define NGX_HTTP_LAST_LEVEL_400 417 -#define NGX_HTTP_LEVEL_400 (NGX_HTTP_LAST_LEVEL_400 - 400) +#define NGX_HTTP_LAST_4XX 417 +#define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX) ngx_string("500 Internal Server Error"), ngx_string("501 Method Not Implemented"), @@ -124,7 +124,7 @@ /* ngx_null_string, */ /* "509 unused" */ /* ngx_null_string, */ /* "510 Not Extended" */ -#define NGX_HTTP_LAST_LEVEL_500 508 +#define NGX_HTTP_LAST_5XX 508 }; @@ -216,7 +216,7 @@ status = r->headers_out.status; if (status >= NGX_HTTP_OK - && status < NGX_HTTP_LAST_LEVEL_200) + && status < NGX_HTTP_LAST_2XX) { /* 2XX */ @@ -234,7 +234,7 @@ len += ngx_http_status_lines[status].len; } else if (status >= NGX_HTTP_MOVED_PERMANENTLY - && status < NGX_HTTP_LAST_LEVEL_300) + && status < NGX_HTTP_LAST_3XX) { /* 3XX */ @@ -242,29 +242,26 @@ r->header_only = 1; } - status = status - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_LEVEL_200; + status = status - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_OFF_3XX; status_line = &ngx_http_status_lines[status]; len += ngx_http_status_lines[status].len; } else if (status >= NGX_HTTP_BAD_REQUEST - && status < NGX_HTTP_LAST_LEVEL_400) + && status < NGX_HTTP_LAST_4XX) { /* 4XX */ status = status - NGX_HTTP_BAD_REQUEST - + NGX_HTTP_LEVEL_200 - + NGX_HTTP_LEVEL_300; + + NGX_HTTP_OFF_4XX; status_line = &ngx_http_status_lines[status]; len += ngx_http_status_lines[status].len; } else if (status >= NGX_HTTP_INTERNAL_SERVER_ERROR - && status < NGX_HTTP_LAST_LEVEL_500) + && status < NGX_HTTP_LAST_5XX) { /* 5XX */ status = status - NGX_HTTP_INTERNAL_SERVER_ERROR - + NGX_HTTP_LEVEL_200 - + NGX_HTTP_LEVEL_300 - + NGX_HTTP_LEVEL_400; + + NGX_HTTP_OFF_5XX; status_line = &ngx_http_status_lines[status]; len += ngx_http_status_lines[status].len; From mdounin at mdounin.ru Sun Feb 5 13:34:08 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 13:34:08 +0000 Subject: [nginx] svn commit: r4437 - in branches/stable-1.0: . src/http Message-ID: <20120205133408.9FEC23F9C22@mail.nginx.com> Author: mdounin Date: 2012-02-05 13:34:08 +0000 (Sun, 05 Feb 2012) New Revision: 4437 Log: Merge of r4339, r4340, r4341: Cache fixes: *) Obsolete code removed. The ngx_http_cache() and ngx_http_no_cache_set_slot() functions were replaced in 0.8.46 and no longer used since then. *) Handling of cache files with long headers. There are two possible situations which can lead to this: response was cached with bigger proxy_buffer_size value (and nginx was restared since then, i.e. shared memory zone content was lost), or due to the race in the cache update code (see [1]) we've end up with fcn->body_start from a different response stored in shared memory zone. *) Only complain on long locked entries. There have been multiple reports of cases where a real locked entry was removed, resulting in a segmentation fault later in a worker which locked the entry. It looks like default inactive timeout isn't enough in real life. For now just ignore such locked entries, and move them to the top of the inactive queue to allow processing of other entries. [1] http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001287.html Modified: branches/stable-1.0/ branches/stable-1.0/src/http/ngx_http_file_cache.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338,4342-4343,4377 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4377 Modified: branches/stable-1.0/src/http/ngx_http_file_cache.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_file_cache.c 2012-02-05 12:46:20 UTC (rev 4436) +++ branches/stable-1.0/src/http/ngx_http_file_cache.c 2012-02-05 13:34:08 UTC (rev 4437) @@ -387,6 +387,13 @@ return NGX_DECLINED; } + if (h->body_start > c->body_start) { + ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0, + "cache file \"%s\" has too long header", + c->file.name.data); + return NGX_DECLINED; + } + c->buf->last += n; c->valid_sec = h->valid_sec; @@ -1107,12 +1114,12 @@ /* * abnormally exited workers may leave locked cache entries, * and although it may be safe to remove them completely, - * we prefer to remove them from inactive queue and rbtree - * only, and to allow other leaks + * we prefer to just move them to the top of the inactive queue */ ngx_queue_remove(q); - ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node); + fcn->expire = ngx_time() + cache->inactive; + ngx_queue_insert_head(&cache->sh->queue, &fcn->queue); ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, "ignore long locked inactive cache entry %*s, count:%d", @@ -1710,69 +1717,3 @@ return NGX_CONF_OK; } - - -ngx_int_t -ngx_http_cache(ngx_http_request_t *r, ngx_array_t *no_cache) -{ - ngx_str_t val; - ngx_uint_t i; - ngx_http_complex_value_t *cv; - - cv = no_cache->elts; - - for (i = 0; i < no_cache->nelts; i++) { - if (ngx_http_complex_value(r, &cv[i], &val) != NGX_OK) { - return NGX_ERROR; - } - - if (val.len && val.data[0] != '0') { - return NGX_DECLINED; - } - } - - return NGX_OK; -} - - -char * -ngx_http_no_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_uint_t i; - ngx_array_t **a; - ngx_http_complex_value_t *cv; - ngx_http_compile_complex_value_t ccv; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a == NGX_CONF_UNSET_PTR) { - *a = ngx_array_create(cf->pool, 1, sizeof(ngx_http_complex_value_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - value = cf->args->elts; - - for (i = 1; i < cf->args->nelts; i++) { - cv = ngx_array_push(*a); - if (cv == NULL) { - return NGX_CONF_ERROR; - } - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[i]; - ccv.complex_value = cv; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - } - - return NGX_CONF_OK; -} From mdounin at mdounin.ru Sun Feb 5 13:53:51 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 13:53:51 +0000 Subject: [nginx] svn commit: r4438 - in branches/stable-1.0: . src/http/modules Message-ID: <20120205135351.DB9103F9C36@mail.nginx.com> Author: mdounin Date: 2012-02-05 13:53:50 +0000 (Sun, 05 Feb 2012) New Revision: 4438 Log: Merge of r4372, r4373, r4374: SCGI fixes: *) Fixed incorrect use of r->http_version in scgi module. The r->http_version is a version of client's request, and modules must not set it unless they are really willing to downgrade protocol version used for a response (i.e. to HTTP/0.9 if no response headers are available). In neither case r->http_version may be upgraded. The former code downgraded response from HTTP/1.1 to HTTP/1.0 for no reason, causing various problems (see ticket #66). It was also possible that HTTP/0.9 requests were upgraded to HTTP/1.0. *) Removed duplicate function declaration. *) Removed error if there is no Status header. The SCGI specification doesn't specify format of the response, and assuming CGI specs should be used there is no reason to complain. RFC 3875 explicitly states that "A Status header field is optional, and status 200 'OK' is assumed if it is omitted". Modified: branches/stable-1.0/ branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4377 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4374,4377 Modified: branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c 2012-02-05 13:34:08 UTC (rev 4437) +++ branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c 2012-02-05 13:53:50 UTC (rev 4438) @@ -36,7 +36,6 @@ static ngx_int_t ngx_http_scgi_reinit_request(ngx_http_request_t *r); static ngx_int_t ngx_http_scgi_process_status_line(ngx_http_request_t *r); static ngx_int_t ngx_http_scgi_process_header(ngx_http_request_t *r); -static ngx_int_t ngx_http_scgi_process_header(ngx_http_request_t *r); static void ngx_http_scgi_abort_request(ngx_http_request_t *r); static void ngx_http_scgi_finalize_request(ngx_http_request_t *r, ngx_int_t rc); @@ -824,11 +823,7 @@ } if (rc == NGX_ERROR) { - - r->http_version = NGX_HTTP_VERSION_9; - u->process_header = ngx_http_scgi_process_header; - return ngx_http_scgi_process_header(r); } @@ -928,12 +923,12 @@ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http scgi header done"); - if (r->http_version > NGX_HTTP_VERSION_9) { + u = r->upstream; + + if (u->headers_in.status_n) { return NGX_OK; } - u = r->upstream; - if (u->headers_in.status) { status_line = &u->headers_in.status->value; @@ -945,20 +940,15 @@ return NGX_HTTP_UPSTREAM_INVALID_HEADER; } - r->http_version = NGX_HTTP_VERSION_10; u->headers_in.status_n = status; u->headers_in.status_line = *status_line; } else if (u->headers_in.location) { - r->http_version = NGX_HTTP_VERSION_10; u->headers_in.status_n = 302; ngx_str_set(&u->headers_in.status_line, "302 Moved Temporarily"); } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "upstream sent neither valid HTTP/1.0 header " - "nor \"Status\" header line"); u->headers_in.status_n = 200; ngx_str_set(&u->headers_in.status_line, "200 OK"); } From mdounin at mdounin.ru Sun Feb 5 14:09:47 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 14:09:47 +0000 Subject: [nginx] svn commit: r4439 - in branches/stable-1.0: . src/http/modules Message-ID: <20120205140947.211F63F9DF3@mail.nginx.com> Author: mdounin Date: 2012-02-05 14:09:46 +0000 (Sun, 05 Feb 2012) New Revision: 4439 Log: Merge of r4375, r4382: SSI changes: *) The "if" command did not work inside the "block" command and produced parsing errors. *) Added regex captures support in the expression of the "if" command. Modified: branches/stable-1.0/ branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.h Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4374,4377 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4382 Modified: branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.c 2012-02-05 13:53:50 UTC (rev 4438) +++ branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.c 2012-02-05 14:09:46 UTC (rev 4439) @@ -78,6 +78,8 @@ ngx_str_t *name, ngx_uint_t key); static ngx_int_t ngx_http_ssi_evaluate_string(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx, ngx_str_t *text, ngx_uint_t flags); +static ngx_int_t ngx_http_ssi_regex_match(ngx_http_request_t *r, + ngx_str_t *pattern, ngx_str_t *str); static ngx_int_t ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx, ngx_str_t **params); @@ -624,16 +626,6 @@ continue; } - if (cmd->conditional - && (ctx->conditional == 0 - || ctx->conditional > cmd->conditional)) - { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "invalid context of SSI command: \"%V\"", - &ctx->command); - goto ssi_error; - } - if (!ctx->output && !cmd->block) { if (ctx->block) { @@ -709,6 +701,16 @@ } } + if (cmd->conditional + && (ctx->conditional == 0 + || ctx->conditional > cmd->conditional)) + { + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "invalid context of SSI command: \"%V\"", + &ctx->command); + goto ssi_error; + } + if (ctx->params.nelts > NGX_HTTP_SSI_MAX_PARAMS) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "too many SSI command paramters: \"%V\"", @@ -1531,6 +1533,30 @@ ctx = ngx_http_get_module_ctx(r->main, ngx_http_ssi_filter_module); +#if (NGX_PCRE) + { + ngx_str_t *value; + + if (key >= '0' && key <= '9') { + i = key - '0'; + + if (i < ctx->ncaptures) { + value = ngx_palloc(r->pool, sizeof(ngx_str_t)); + if (value == NULL) { + return NULL; + } + + i *= 2; + + value->data = ctx->captures_data + ctx->captures[i]; + value->len = ctx->captures[i + 1] - ctx->captures[i]; + + return value; + } + } + } +#endif + if (ctx->variables == NULL) { return NULL; } @@ -1820,6 +1846,115 @@ static ngx_int_t +ngx_http_ssi_regex_match(ngx_http_request_t *r, ngx_str_t *pattern, + ngx_str_t *str) +{ +#if (NGX_PCRE) + int rc, *captures; + u_char *p, errstr[NGX_MAX_CONF_ERRSTR]; + size_t size; + ngx_int_t key; + ngx_str_t *vv, name, value; + ngx_uint_t i, n; + ngx_http_ssi_ctx_t *ctx; + ngx_http_ssi_var_t *var; + ngx_regex_compile_t rgc; + + ngx_memzero(&rgc, sizeof(ngx_regex_compile_t)); + + rgc.pattern = *pattern; + rgc.pool = r->pool; + rgc.err.len = NGX_MAX_CONF_ERRSTR; + rgc.err.data = errstr; + + if (ngx_regex_compile(&rgc) != NGX_OK) { + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "%V", &rgc.err); + return NGX_HTTP_SSI_ERROR; + } + + n = (rgc.captures + 1) * 3; + + captures = ngx_palloc(r->pool, n * sizeof(int)); + if (captures == NULL) { + return NGX_ERROR; + } + + rc = ngx_regex_exec(rgc.regex, str, captures, n); + + if (rc < NGX_REGEX_NO_MATCHED) { + ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, + ngx_regex_exec_n " failed: %i on \"%V\" using \"%V\"", + rc, str, pattern); + return NGX_HTTP_SSI_ERROR; + } + + if (rc == NGX_REGEX_NO_MATCHED) { + return NGX_DECLINED; + } + + ctx = ngx_http_get_module_ctx(r->main, ngx_http_ssi_filter_module); + + ctx->ncaptures = rc; + ctx->captures = captures; + ctx->captures_data = str->data; + + if (rgc.named_captures > 0) { + + if (ctx->variables == NULL) { + ctx->variables = ngx_list_create(r->pool, 4, + sizeof(ngx_http_ssi_var_t)); + if (ctx->variables == NULL) { + return NGX_ERROR; + } + } + + size = rgc.name_size; + p = rgc.names; + + for (i = 0; i < (ngx_uint_t) rgc.named_captures; i++, p += size) { + + name.data = &p[2]; + name.len = ngx_strlen(name.data); + + n = 2 * ((p[0] << 8) + p[1]); + + value.data = &str->data[captures[n]]; + value.len = captures[n + 1] - captures[n]; + + key = ngx_hash_strlow(name.data, name.data, name.len); + + vv = ngx_http_ssi_get_variable(r, &name, key); + + if (vv) { + *vv = value; + continue; + } + + var = ngx_list_push(ctx->variables); + if (var == NULL) { + return NGX_ERROR; + } + + var->name = name; + var->key = key; + var->value = value; + } + } + + return NGX_OK; + +#else + + ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, + "the using of the regex \"%V\" in SSI requires PCRE library", + pattern); + return NGX_HTTP_SSI_ERROR; + +#endif +} + + +static ngx_int_t ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx, ngx_str_t **params) { @@ -2451,39 +2586,17 @@ } } else { -#if (NGX_PCRE) - ngx_regex_compile_t rgc; - u_char errstr[NGX_MAX_CONF_ERRSTR]; - right.data[right.len] = '\0'; - ngx_memzero(&rgc, sizeof(ngx_regex_compile_t)); + rc = ngx_http_ssi_regex_match(r, &right, &left); - rgc.pattern = right; - rgc.pool = r->pool; - rgc.err.len = NGX_MAX_CONF_ERRSTR; - rgc.err.data = errstr; - - if (ngx_regex_compile(&rgc) != NGX_OK) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "%V", &rgc.err); - return NGX_HTTP_SSI_ERROR; + if (rc == NGX_OK) { + rc = 0; + } else if (rc == NGX_DECLINED) { + rc = -1; + } else { + return rc; } - - rc = ngx_regex_exec(rgc.regex, &left, NULL, 0); - - if (rc < NGX_REGEX_NO_MATCHED) { - ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, - ngx_regex_exec_n " failed: %i on \"%V\" using \"%V\"", - rc, &left, &right); - return NGX_HTTP_SSI_ERROR; - } -#else - ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, - "the using of the regex \"%V\" in SSI " - "requires PCRE library", &right); - - return NGX_HTTP_SSI_ERROR; -#endif } if ((rc == 0 && !negative) || (rc != 0 && negative)) { Modified: branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.h =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.h 2012-02-05 13:53:50 UTC (rev 4438) +++ branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.h 2012-02-05 14:09:46 UTC (rev 4439) @@ -64,6 +64,12 @@ ngx_list_t *variables; ngx_array_t *blocks; +#if (NGX_PCRE) + ngx_uint_t ncaptures; + int *captures; + u_char *captures_data; +#endif + unsigned conditional:2; unsigned encoding:2; unsigned block:1; From mdounin at mdounin.ru Sun Feb 5 15:34:20 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 15:34:20 +0000 Subject: [nginx] svn commit: r4440 - in branches/stable-1.0: . docs/xml/nginx Message-ID: <20120205153420.875B33F9D63@mail.nginx.com> Author: mdounin Date: 2012-02-05 15:34:20 +0000 (Sun, 05 Feb 2012) New Revision: 4440 Log: Merge of r4379: duplicate words removed. Modified: branches/stable-1.0/ branches/stable-1.0/docs/xml/nginx/changes.xml Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4382 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4382 Modified: branches/stable-1.0/docs/xml/nginx/changes.xml =================================================================== --- branches/stable-1.0/docs/xml/nginx/changes.xml 2012-02-05 14:09:46 UTC (rev 4439) +++ branches/stable-1.0/docs/xml/nginx/changes.xml 2012-02-05 15:34:20 UTC (rev 4440) @@ -14431,7 +14431,7 @@ ???? ? ????????? proxy_pass ???????????? URI, ?? ?????? ????????????? ???? 80. -if the URI part is omitted in "proxy_pass" directive, the the 80 port was +if the URI part is omitted in "proxy_pass" directive, the 80 port was always used. @@ -15220,7 +15220,7 @@ the segmentation fault may occurred if there were errors while working with proxied or FastCGI server; -in the proxied mode the the bug had appeared in 0.1.29. +in the proxied mode the bug had appeared in 0.1.29. @@ -15237,7 +15237,7 @@ the segmentation fault occurred or the worker process may got caught in an endless loop if the proxied or FastCGI server sent the "Cache-Control" header line and the "expires" directive was used; -in the proxied mode the the bug had appeared in 0.1.29. +in the proxied mode the bug had appeared in 0.1.29. @@ -15474,7 +15474,7 @@ ????????? limit_rate ?????????????? ? ?????? ?????? ? FastCGI. -the "limit_rate" directive is supported in in proxy and FastCGI mode. +the "limit_rate" directive is supported in proxy and FastCGI mode. @@ -15981,7 +15981,7 @@ if the length of the response part received at once from proxied or FastCGI server was equal to 500, then nginx returns the 500 response code; -in proxy mode the the bug had appeared in 0.1.29 only. +in proxy mode the bug had appeared in 0.1.29 only. @@ -16801,7 +16801,7 @@ ?? ????? ?????? ???? ??????? ??????? ? SSL ?????????? ??? ????????? ???????. -the timeout may occur while reading of the the client request body +the timeout may occur while reading of the client request body via SSL connections. From mdounin at mdounin.ru Sun Feb 5 15:47:58 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 15:47:58 +0000 Subject: [nginx] svn commit: r4441 - in branches/stable-1.0: . src/http/modules Message-ID: <20120205154758.859B03F9D03@mail.nginx.com> Author: mdounin Date: 2012-02-05 15:47:58 +0000 (Sun, 05 Feb 2012) New Revision: 4441 Log: Merge of r4381, r4400: Fixed limit_conn_log_level/limit_req_log_level inheritance. The directives did not work if there were no limit_conn/limit_req specified on the same level. The code for limit_conn is different in 1.0.x, conflict resolved manually. Modified: branches/stable-1.0/ branches/stable-1.0/src/http/modules/ngx_http_limit_req_module.c branches/stable-1.0/src/http/modules/ngx_http_limit_zone_module.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4382 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4382,4400 Modified: branches/stable-1.0/src/http/modules/ngx_http_limit_req_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_limit_req_module.c 2012-02-05 15:34:20 UTC (rev 4440) +++ branches/stable-1.0/src/http/modules/ngx_http_limit_req_module.c 2012-02-05 15:47:58 UTC (rev 4441) @@ -569,7 +569,9 @@ ngx_http_limit_req_conf_t *conf = child; if (conf->shm_zone == NULL) { - *conf = *prev; + conf->shm_zone = prev->shm_zone; + conf->burst = prev->burst; + conf->nodelay = prev->nodelay; } ngx_conf_merge_uint_value(conf->limit_log_level, prev->limit_log_level, Modified: branches/stable-1.0/src/http/modules/ngx_http_limit_zone_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_limit_zone_module.c 2012-02-05 15:34:20 UTC (rev 4440) +++ branches/stable-1.0/src/http/modules/ngx_http_limit_zone_module.c 2012-02-05 15:47:58 UTC (rev 4441) @@ -421,7 +421,8 @@ ngx_http_limit_zone_conf_t *conf = child; if (conf->shm_zone == NULL) { - *conf = *prev; + conf->shm_zone = prev->shm_zone; + conf->conn = prev->conn; } ngx_conf_merge_uint_value(conf->log_level, prev->log_level, NGX_LOG_ERR); From mdounin at mdounin.ru Sun Feb 5 15:51:21 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 15:51:21 +0000 Subject: [nginx] svn commit: r4442 - in branches/stable-1.0: . src/http/modules Message-ID: <20120205155121.2D78A3F9C1A@mail.nginx.com> Author: mdounin Date: 2012-02-05 15:51:20 +0000 (Sun, 05 Feb 2012) New Revision: 4442 Log: Merge of r4383, r4403: MP4 fixes: *) Fixed mp4 if first entry in stsc was skipped (ticket #72). If first entry in stsc atom was skipped, and seek was to chunk boundary, than first_chunk in the generated stsc table wasn't set to 1. *) Fixed handling of mp4 above 2G and 32bit offsets (ticket #84). Modified: branches/stable-1.0/ branches/stable-1.0/src/http/modules/ngx_http_mp4_module.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4382,4400 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4383,4400,4403 Modified: branches/stable-1.0/src/http/modules/ngx_http_mp4_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_mp4_module.c 2012-02-05 15:47:58 UTC (rev 4441) +++ branches/stable-1.0/src/http/modules/ngx_http_mp4_module.c 2012-02-05 15:51:20 UTC (rev 4442) @@ -165,10 +165,10 @@ ((u_char *) (p))[7] = n4 #define ngx_mp4_get_32value(p) \ - ( (((u_char *) (p))[0] << 24) \ - + (((u_char *) (p))[1] << 16) \ - + (((u_char *) (p))[2] << 8) \ - + (((u_char *) (p))[3]) ) + ( ((uint32_t) ((u_char *) (p))[0] << 24) \ + + ( ((u_char *) (p))[1] << 16) \ + + ( ((u_char *) (p))[2] << 8) \ + + ( ((u_char *) (p))[3]) ) #define ngx_mp4_set_32value(p, n) \ ((u_char *) (p))[0] = (u_char) ((n) >> 24); \ @@ -2382,6 +2382,8 @@ data->pos = (u_char *) entry; atom_size = sizeof(ngx_mp4_stsc_atom_t) + (data->last - data->pos); + ngx_mp4_set_32value(entry->chunk, 1); + if (trak->chunk_samples) { first = &trak->stsc_chunk_entry; From mdounin at mdounin.ru Sun Feb 5 16:12:55 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 16:12:55 +0000 Subject: [nginx] svn commit: r4443 - in branches/stable-1.0: . src/http Message-ID: <20120205161256.29ACF3F9D0A@mail.nginx.com> Author: mdounin Date: 2012-02-05 16:12:55 +0000 (Sun, 05 Feb 2012) New Revision: 4443 Log: Merge of r4384, r4385: Fixes for limit_rate: *) Fixed throughput problems with large limit_rate. Previous attempt to fix this was in r1658 (0.6.18), though that one wasn't enough (it was a noop). *) Fixed interaction of limit_rate and sendfile_max_chunk. It's possible that configured limit_rate will permit more bytes per single operation than sendfile_max_chunk. To protect disk from takeover by a single client it is necessary to apply sendfile_max_chunk as a limit regardless of configured limit_rate. See here for report (in Russian): http://mailman.nginx.org/pipermail/nginx-ru/2010-March/032806.html Modified: branches/stable-1.0/ branches/stable-1.0/src/http/ngx_http_write_filter_module.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4383,4400,4403 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4400,4403 Modified: branches/stable-1.0/src/http/ngx_http_write_filter_module.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_write_filter_module.c 2012-02-05 15:51:20 UTC (rev 4442) +++ branches/stable-1.0/src/http/ngx_http_write_filter_module.c 2012-02-05 16:12:55 UTC (rev 4443) @@ -223,11 +223,14 @@ return NGX_AGAIN; } - } else if (clcf->sendfile_max_chunk) { - limit = clcf->sendfile_max_chunk; + if (clcf->sendfile_max_chunk + && (off_t) clcf->sendfile_max_chunk < limit) + { + limit = clcf->sendfile_max_chunk; + } } else { - limit = 0; + limit = clcf->sendfile_max_chunk; } sent = c->sent; @@ -262,17 +265,18 @@ } } - delay = (ngx_msec_t) ((nsent - sent) * 1000 / r->limit_rate + 1); + delay = (ngx_msec_t) ((nsent - sent) * 1000 / r->limit_rate); if (delay > 0) { + limit = 0; c->write->delayed = 1; ngx_add_timer(c->write, delay); } + } - } else if (c->write->ready - && clcf->sendfile_max_chunk - && (size_t) (c->sent - sent) - >= clcf->sendfile_max_chunk - 2 * ngx_pagesize) + if (limit + && c->write->ready + && c->sent - sent >= limit - (off_t) (2 * ngx_pagesize)) { c->write->delayed = 1; ngx_add_timer(c->write, 1); From mdounin at mdounin.ru Sun Feb 5 19:03:21 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 19:03:21 +0000 Subject: [nginx] svn commit: r4444 - in branches/stable-1.0: . misc Message-ID: <20120205190321.DCF483F9CA1@mail.nginx.com> Author: mdounin Date: 2012-02-05 19:03:21 +0000 (Sun, 05 Feb 2012) New Revision: 4444 Log: Merge of r4393: zlib license file include fixed. Modified: branches/stable-1.0/ branches/stable-1.0/misc/GNUmakefile Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4400,4403 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4400,4403 Modified: branches/stable-1.0/misc/GNUmakefile =================================================================== --- branches/stable-1.0/misc/GNUmakefile 2012-02-05 16:12:55 UTC (rev 4443) +++ branches/stable-1.0/misc/GNUmakefile 2012-02-05 19:03:21 UTC (rev 4444) @@ -112,7 +112,7 @@ cp -p $(OBJS)/lib/$(PCRE)/LICENCE \ $(TEMP)/$(NGINX)/docs/PCRE.LICENCE - perl -ne 'print if /^ \(C\) 1995-2004/ .. /^ jloup\@gzip.org/' \ + perl -ne 'print if /^ \(C\) 1995-20/ .. /^ jloup\@gzip.org/' \ $(OBJS)/lib/$(ZLIB)/README \ > $(TEMP)/$(NGINX)/docs/zlib.LICENSE From mdounin at mdounin.ru Sun Feb 5 19:05:06 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 19:05:06 +0000 Subject: [nginx] svn commit: r4445 - in branches/stable-1.0: . auto/cc Message-ID: <20120205190506.C0E423F9CA1@mail.nginx.com> Author: mdounin Date: 2012-02-05 19:05:06 +0000 (Sun, 05 Feb 2012) New Revision: 4445 Log: Merge of r4396: Some questionable optomizations flags for icc were removed in order to simplify support of its future versions. Modified: branches/stable-1.0/ branches/stable-1.0/auto/cc/icc Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4400,4403 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4400,4403 Modified: branches/stable-1.0/auto/cc/icc =================================================================== --- branches/stable-1.0/auto/cc/icc 2012-02-05 19:03:21 UTC (rev 4444) +++ branches/stable-1.0/auto/cc/icc 2012-02-05 19:05:06 UTC (rev 4445) @@ -2,7 +2,7 @@ # Copyright (C) Igor Sysoev -# Intel C++ compiler 7.1, 8.0, 8.1, 9.0 +# Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1 NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \ | sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'` @@ -15,32 +15,7 @@ # optimizations CFLAGS="$CFLAGS -O" -# inline the functions declared with __inline -#CFLAGS="$CFLAGS -Ob1" -# inline any function, at the compiler's discretion -CFLAGS="$CFLAGS -Ob2" -# multi-file IP optimizations -case "$NGX_ICC_VER" in - 9.*) - IPO="-ipo" - ;; - - # 8.1.38 under FreeBSD can not link -ipo - 8.1) - IPO="-ip" - ;; - - *) - IPO="-ipo -ipo_obj" - ;; -esac - -# single-file IP optimizations -#IPO="-ip" - -CFLAGS="$CFLAGS $IPO" -CORE_LINK="$CORE_LINK $IPO" CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file" @@ -64,15 +39,15 @@ CFLAGS="$CFLAGS $CPU_OPT" if [ ".$PCRE_OPT" = "." ]; then - PCRE_OPT="-O $IPO $CPU_OPT" + PCRE_OPT="-O $CPU_OPT" fi if [ ".$MD5_OPT" = "." ]; then - MD5_OPT="-O $IPO $CPU_OPT" + MD5_OPT="-O $CPU_OPT" fi if [ ".$ZLIB_OPT" = "." ]; then - ZLIB_OPT="-O $IPO $CPU_OPT" + ZLIB_OPT="-O $CPU_OPT" fi From mdounin at mdounin.ru Sun Feb 5 19:06:52 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 19:06:52 +0000 Subject: [nginx] svn commit: r4446 - in branches/stable-1.0: . src/core Message-ID: <20120205190652.963F43F9CA1@mail.nginx.com> Author: mdounin Date: 2012-02-05 19:06:52 +0000 (Sun, 05 Feb 2012) New Revision: 4446 Log: Merge of r4398: Changed ngx_log_debugN() macros to verify the number of arguments when built with debugging. Modified: branches/stable-1.0/ branches/stable-1.0/src/core/ngx_log.h Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4400,4403 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400,4403 Modified: branches/stable-1.0/src/core/ngx_log.h =================================================================== --- branches/stable-1.0/src/core/ngx_log.h 2012-02-05 19:05:06 UTC (rev 4445) +++ branches/stable-1.0/src/core/ngx_log.h 2012-02-05 19:06:52 UTC (rev 4446) @@ -121,17 +121,40 @@ #if (NGX_HAVE_VARIADIC_MACROS) -#define ngx_log_debug0 ngx_log_debug -#define ngx_log_debug1 ngx_log_debug -#define ngx_log_debug2 ngx_log_debug -#define ngx_log_debug3 ngx_log_debug -#define ngx_log_debug4 ngx_log_debug -#define ngx_log_debug5 ngx_log_debug -#define ngx_log_debug6 ngx_log_debug -#define ngx_log_debug7 ngx_log_debug -#define ngx_log_debug8 ngx_log_debug +#define ngx_log_debug0(level, log, err, fmt) \ + ngx_log_debug(level, log, err, fmt) +#define ngx_log_debug1(level, log, err, fmt, arg1) \ + ngx_log_debug(level, log, err, fmt, arg1) +#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \ + ngx_log_debug(level, log, err, fmt, arg1, arg2) + +#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \ + ngx_log_debug(level, log, err, fmt, arg1, arg2, arg3) + +#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \ + ngx_log_debug(level, log, err, fmt, arg1, arg2, arg3, arg4) + +#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \ + ngx_log_debug(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) + +#define ngx_log_debug6(level, log, err, fmt, \ + arg1, arg2, arg3, arg4, arg5, arg6) \ + ngx_log_debug(level, log, err, fmt, \ + arg1, arg2, arg3, arg4, arg5, arg6) + +#define ngx_log_debug7(level, log, err, fmt, \ + arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ + ngx_log_debug(level, log, err, fmt, \ + arg1, arg2, arg3, arg4, arg5, arg6, arg7) + +#define ngx_log_debug8(level, log, err, fmt, \ + arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ + ngx_log_debug(level, log, err, fmt, \ + arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) + + #else /* NO VARIADIC MACROS */ #define ngx_log_debug0(level, log, err, fmt) \ From mdounin at mdounin.ru Sun Feb 5 19:15:10 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 19:15:10 +0000 Subject: [nginx] svn commit: r4447 - in branches/stable-1.0: . src/event src/http/modules src/mail Message-ID: <20120205191510.3CAEF3F9C58@mail.nginx.com> Author: mdounin Date: 2012-02-05 19:15:09 +0000 (Sun, 05 Feb 2012) New Revision: 4447 Log: Merge of r4401, r4415: SSL changes: *) Added support for TLSv1.1, TLSv1.2 in ssl_protocols directive. Support for TLSv1.1 and TLSv1.2 protocols was introduced in OpenSSL 1.0.1 (-beta1 was recently released). This change makes it possible to disable these protocols and/or enable them without other protocols. *) Removed ENGINE_load_builtin_engines() call. It's already called by OPENSSL_config(). Calling it again causes some openssl engines (notably GOST) to corrupt memory, as they don't expect to be created more than once. Modified: branches/stable-1.0/ branches/stable-1.0/src/event/ngx_event_openssl.c branches/stable-1.0/src/event/ngx_event_openssl.h branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c branches/stable-1.0/src/http/modules/ngx_http_ssl_module.c branches/stable-1.0/src/mail/ngx_mail_ssl_module.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400,4403 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4401,4403,4415 Modified: branches/stable-1.0/src/event/ngx_event_openssl.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_openssl.c 2012-02-05 19:06:52 UTC (rev 4446) +++ branches/stable-1.0/src/event/ngx_event_openssl.c 2012-02-05 19:15:09 UTC (rev 4447) @@ -78,18 +78,6 @@ }; -static long ngx_ssl_protocols[] = { - SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1, - SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1, - SSL_OP_NO_SSLv2|SSL_OP_NO_TLSv1, - SSL_OP_NO_TLSv1, - SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3, - SSL_OP_NO_SSLv3, - SSL_OP_NO_SSLv2, - 0, -}; - - int ngx_ssl_connection_index; int ngx_ssl_server_conf_index; int ngx_ssl_session_cache_index; @@ -103,8 +91,6 @@ SSL_library_init(); SSL_load_error_strings(); - ENGINE_load_builtin_engines(); - OpenSSL_add_all_algorithms(); ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL); @@ -171,9 +157,25 @@ SSL_CTX_set_options(ssl->ctx, SSL_OP_SINGLE_DH_USE); - if (ngx_ssl_protocols[protocols >> 1] != 0) { - SSL_CTX_set_options(ssl->ctx, ngx_ssl_protocols[protocols >> 1]); + if (!(protocols & NGX_SSL_SSLv2)) { + SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_SSLv2); } + if (!(protocols & NGX_SSL_SSLv3)) { + SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_SSLv3); + } + if (!(protocols & NGX_SSL_TLSv1)) { + SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_TLSv1); + } +#ifdef SSL_OP_NO_TLSv1_1 + if (!(protocols & NGX_SSL_TLSv1_1)) { + SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_TLSv1_1); + } +#endif +#ifdef SSL_OP_NO_TLSv1_2 + if (!(protocols & NGX_SSL_TLSv1_2)) { + SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_TLSv1_2); + } +#endif #ifdef SSL_OP_NO_COMPRESSION SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_COMPRESSION); Modified: branches/stable-1.0/src/event/ngx_event_openssl.h =================================================================== --- branches/stable-1.0/src/event/ngx_event_openssl.h 2012-02-05 19:06:52 UTC (rev 4446) +++ branches/stable-1.0/src/event/ngx_event_openssl.h 2012-02-05 19:15:09 UTC (rev 4447) @@ -81,9 +81,11 @@ -#define NGX_SSL_SSLv2 2 -#define NGX_SSL_SSLv3 4 -#define NGX_SSL_TLSv1 8 +#define NGX_SSL_SSLv2 0x0002 +#define NGX_SSL_SSLv3 0x0004 +#define NGX_SSL_TLSv1 0x0008 +#define NGX_SSL_TLSv1_1 0x0010 +#define NGX_SSL_TLSv1_2 0x0020 #define NGX_SSL_BUFFER 1 Modified: branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c 2012-02-05 19:06:52 UTC (rev 4446) +++ branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c 2012-02-05 19:15:09 UTC (rev 4447) @@ -2766,7 +2766,9 @@ plcf->upstream.ssl->log = cf->log; if (ngx_ssl_create(plcf->upstream.ssl, - NGX_SSL_SSLv2|NGX_SSL_SSLv3|NGX_SSL_TLSv1, NULL) + NGX_SSL_SSLv2|NGX_SSL_SSLv3|NGX_SSL_TLSv1 + |NGX_SSL_TLSv1_1|NGX_SSL_TLSv1_2, + NULL) != NGX_OK) { return NGX_ERROR; Modified: branches/stable-1.0/src/http/modules/ngx_http_ssl_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_ssl_module.c 2012-02-05 19:06:52 UTC (rev 4446) +++ branches/stable-1.0/src/http/modules/ngx_http_ssl_module.c 2012-02-05 19:15:09 UTC (rev 4447) @@ -37,6 +37,8 @@ { ngx_string("SSLv2"), NGX_SSL_SSLv2 }, { ngx_string("SSLv3"), NGX_SSL_SSLv3 }, { ngx_string("TLSv1"), NGX_SSL_TLSv1 }, + { ngx_string("TLSv1.1"), NGX_SSL_TLSv1_1 }, + { ngx_string("TLSv1.2"), NGX_SSL_TLSv1_2 }, { ngx_null_string, 0 } }; @@ -364,7 +366,8 @@ prev->prefer_server_ciphers, 0); ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols, - (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3|NGX_SSL_TLSv1)); + (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3|NGX_SSL_TLSv1 + |NGX_SSL_TLSv1_1|NGX_SSL_TLSv1_2)); ngx_conf_merge_uint_value(conf->verify, prev->verify, 0); ngx_conf_merge_uint_value(conf->verify_depth, prev->verify_depth, 1); Modified: branches/stable-1.0/src/mail/ngx_mail_ssl_module.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_ssl_module.c 2012-02-05 19:06:52 UTC (rev 4446) +++ branches/stable-1.0/src/mail/ngx_mail_ssl_module.c 2012-02-05 19:15:09 UTC (rev 4447) @@ -37,6 +37,8 @@ { ngx_string("SSLv2"), NGX_SSL_SSLv2 }, { ngx_string("SSLv3"), NGX_SSL_SSLv3 }, { ngx_string("TLSv1"), NGX_SSL_TLSv1 }, + { ngx_string("TLSv1.1"), NGX_SSL_TLSv1_1 }, + { ngx_string("TLSv1.2"), NGX_SSL_TLSv1_2 }, { ngx_null_string, 0 } }; @@ -206,7 +208,8 @@ prev->prefer_server_ciphers, 0); ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols, - (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3|NGX_SSL_TLSv1)); + (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3|NGX_SSL_TLSv1 + |NGX_SSL_TLSv1_1|NGX_SSL_TLSv1_2)); ngx_conf_merge_str_value(conf->certificate, prev->certificate, ""); ngx_conf_merge_str_value(conf->certificate_key, prev->certificate_key, ""); From mdounin at mdounin.ru Sun Feb 5 19:23:44 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 19:23:44 +0000 Subject: [nginx] svn commit: r4448 - in branches/stable-1.0: . src/http/modules Message-ID: <20120205192345.5B6F13F9CF6@mail.nginx.com> Author: mdounin Date: 2012-02-05 19:23:44 +0000 (Sun, 05 Feb 2012) New Revision: 4448 Log: Merge of r4402: Fixed proxy_cache_use_stale in "no live upstreams" case. Modified: branches/stable-1.0/ branches/stable-1.0/src/http/modules/ngx_http_fastcgi_module.c branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c branches/stable-1.0/src/http/modules/ngx_http_uwsgi_module.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4401,4403,4415 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4403,4415 Modified: branches/stable-1.0/src/http/modules/ngx_http_fastcgi_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_fastcgi_module.c 2012-02-05 19:15:09 UTC (rev 4447) +++ branches/stable-1.0/src/http/modules/ngx_http_fastcgi_module.c 2012-02-05 19:23:44 UTC (rev 4448) @@ -2214,6 +2214,10 @@ |NGX_HTTP_UPSTREAM_FT_OFF; } + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) { + conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE; + } + if (conf->upstream.cache_methods == 0) { conf->upstream.cache_methods = prev->upstream.cache_methods; } Modified: branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c 2012-02-05 19:15:09 UTC (rev 4447) +++ branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c 2012-02-05 19:23:44 UTC (rev 4448) @@ -1903,17 +1903,21 @@ (NGX_CONF_BITMASK_SET |NGX_HTTP_UPSTREAM_FT_OFF)); + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) { + conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET + |NGX_HTTP_UPSTREAM_FT_OFF; + } + + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) { + conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE; + } + if (conf->upstream.cache_methods == 0) { conf->upstream.cache_methods = prev->upstream.cache_methods; } conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD; - if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) { - conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET - |NGX_HTTP_UPSTREAM_FT_OFF; - } - ngx_conf_merge_ptr_value(conf->upstream.cache_bypass, prev->upstream.cache_bypass, NULL); Modified: branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c 2012-02-05 19:15:09 UTC (rev 4447) +++ branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c 2012-02-05 19:23:44 UTC (rev 4448) @@ -1237,6 +1237,10 @@ |NGX_HTTP_UPSTREAM_FT_OFF; } + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) { + conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE; + } + if (conf->upstream.cache_methods == 0) { conf->upstream.cache_methods = prev->upstream.cache_methods; } Modified: branches/stable-1.0/src/http/modules/ngx_http_uwsgi_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_uwsgi_module.c 2012-02-05 19:15:09 UTC (rev 4447) +++ branches/stable-1.0/src/http/modules/ngx_http_uwsgi_module.c 2012-02-05 19:23:44 UTC (rev 4448) @@ -1298,6 +1298,10 @@ |NGX_HTTP_UPSTREAM_FT_OFF; } + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) { + conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE; + } + if (conf->upstream.cache_methods == 0) { conf->upstream.cache_methods = prev->upstream.cache_methods; } From mdounin at mdounin.ru Sun Feb 5 19:25:24 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 19:25:24 +0000 Subject: [nginx] svn commit: r4449 - in branches/stable-1.0: . src/os/unix Message-ID: <20120205192524.A13463F9CF6@mail.nginx.com> Author: mdounin Date: 2012-02-05 19:25:24 +0000 (Sun, 05 Feb 2012) New Revision: 4449 Log: Merge of r4404: Fixed sched_setaffinity(2) to correctly pass size. Second argument (cpusetsize) is size in bytes, not in bits. Previously used constant 32 resulted in reading of uninitialized memory and caused EINVAL to be returned on some Linux kernels. Modified: branches/stable-1.0/ branches/stable-1.0/src/os/unix/ngx_process_cycle.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4403,4415 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4404,4415 Modified: branches/stable-1.0/src/os/unix/ngx_process_cycle.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_process_cycle.c 2012-02-05 19:23:44 UTC (rev 4448) +++ branches/stable-1.0/src/os/unix/ngx_process_cycle.c 2012-02-05 19:25:24 UTC (rev 4449) @@ -914,7 +914,10 @@ ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "sched_setaffinity(0x%08Xl)", cpu_affinity); - if (sched_setaffinity(0, 32, (cpu_set_t *) &cpu_affinity) == -1) { + if (sched_setaffinity(0, sizeof(cpu_affinity), + (cpu_set_t *) &cpu_affinity) + == -1) + { ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, "sched_setaffinity(0x%08Xl) failed", cpu_affinity); } From mdounin at mdounin.ru Sun Feb 5 19:27:18 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 19:27:18 +0000 Subject: [nginx] svn commit: r4450 - in branches/stable-1.0: . src/core Message-ID: <20120205192718.5DD833F9C3C@mail.nginx.com> Author: mdounin Date: 2012-02-05 19:27:18 +0000 (Sun, 05 Feb 2012) New Revision: 4450 Log: Merge of r4405: Fixed division by zero exception in ngx_hash_init(). The ngx_hash_init() function did not expect call with zero elements count, which caused FPE error on configs with an empty "types" block in http context and "types_hash_max_size" > 10000. Modified: branches/stable-1.0/ branches/stable-1.0/src/core/ngx_hash.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4404,4415 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4405,4415 Modified: branches/stable-1.0/src/core/ngx_hash.c =================================================================== --- branches/stable-1.0/src/core/ngx_hash.c 2012-02-05 19:25:24 UTC (rev 4449) +++ branches/stable-1.0/src/core/ngx_hash.c 2012-02-05 19:27:18 UTC (rev 4450) @@ -277,7 +277,7 @@ start = nelts / (bucket_size / (2 * sizeof(void *))); start = start ? start : 1; - if (hinit->max_size > 10000 && hinit->max_size / nelts < 100) { + if (hinit->max_size > 10000 && nelts && hinit->max_size / nelts < 100) { start = hinit->max_size - 1000; } From mdounin at mdounin.ru Sun Feb 5 20:03:01 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 20:03:01 +0000 Subject: [nginx] svn commit: r4451 - in branches/stable-1.0: . auto auto/cc auto/lib auto/lib/geoip auto/lib/google-perftools auto/lib/libatomic auto/lib/libgd auto/lib/libxslt auto/lib/md5 auto/lib/openssl auto/lib/pcre auto/lib/perl auto/lib/sha1 auto/lib/zlib auto/os auto/types docs/man docs/text src/core src/event src/event/modules src/http src/http/modules src/http/modules/perl src/mail src/misc src/mysql src/os/unix src/os/win32 Message-ID: <20120205200303.CCA433F9C6E@mail.nginx.com> Author: mdounin Date: 2012-02-05 20:02:59 +0000 (Sun, 05 Feb 2012) New Revision: 4451 Log: Merge of r4406, r4413: copyrights updated. Modified: branches/stable-1.0/ branches/stable-1.0/auto/cc/acc branches/stable-1.0/auto/cc/bcc branches/stable-1.0/auto/cc/ccc branches/stable-1.0/auto/cc/conf branches/stable-1.0/auto/cc/gcc branches/stable-1.0/auto/cc/icc branches/stable-1.0/auto/cc/msvc branches/stable-1.0/auto/cc/name branches/stable-1.0/auto/cc/owc branches/stable-1.0/auto/cc/sunc branches/stable-1.0/auto/configure branches/stable-1.0/auto/define branches/stable-1.0/auto/endianess branches/stable-1.0/auto/feature branches/stable-1.0/auto/have branches/stable-1.0/auto/have_headers branches/stable-1.0/auto/headers branches/stable-1.0/auto/include branches/stable-1.0/auto/init branches/stable-1.0/auto/install branches/stable-1.0/auto/lib/conf branches/stable-1.0/auto/lib/geoip/conf branches/stable-1.0/auto/lib/google-perftools/conf branches/stable-1.0/auto/lib/libatomic/conf branches/stable-1.0/auto/lib/libatomic/make branches/stable-1.0/auto/lib/libgd/conf branches/stable-1.0/auto/lib/libxslt/conf branches/stable-1.0/auto/lib/make branches/stable-1.0/auto/lib/md5/conf branches/stable-1.0/auto/lib/md5/make branches/stable-1.0/auto/lib/md5/makefile.bcc branches/stable-1.0/auto/lib/md5/makefile.msvc branches/stable-1.0/auto/lib/md5/makefile.owc branches/stable-1.0/auto/lib/openssl/conf branches/stable-1.0/auto/lib/openssl/make branches/stable-1.0/auto/lib/openssl/makefile.bcc branches/stable-1.0/auto/lib/openssl/makefile.msvc branches/stable-1.0/auto/lib/pcre/conf branches/stable-1.0/auto/lib/pcre/make branches/stable-1.0/auto/lib/pcre/makefile.bcc branches/stable-1.0/auto/lib/pcre/makefile.msvc branches/stable-1.0/auto/lib/pcre/makefile.owc branches/stable-1.0/auto/lib/perl/conf branches/stable-1.0/auto/lib/perl/make branches/stable-1.0/auto/lib/sha1/conf branches/stable-1.0/auto/lib/sha1/make branches/stable-1.0/auto/lib/sha1/makefile.bcc branches/stable-1.0/auto/lib/sha1/makefile.msvc branches/stable-1.0/auto/lib/sha1/makefile.owc branches/stable-1.0/auto/lib/test branches/stable-1.0/auto/lib/zlib/conf branches/stable-1.0/auto/lib/zlib/make branches/stable-1.0/auto/lib/zlib/makefile.bcc branches/stable-1.0/auto/lib/zlib/makefile.msvc branches/stable-1.0/auto/lib/zlib/makefile.owc branches/stable-1.0/auto/make branches/stable-1.0/auto/modules branches/stable-1.0/auto/nohave branches/stable-1.0/auto/options branches/stable-1.0/auto/os/conf branches/stable-1.0/auto/os/darwin branches/stable-1.0/auto/os/freebsd branches/stable-1.0/auto/os/linux branches/stable-1.0/auto/os/solaris branches/stable-1.0/auto/os/win32 branches/stable-1.0/auto/sources branches/stable-1.0/auto/stubs branches/stable-1.0/auto/summary branches/stable-1.0/auto/types/sizeof branches/stable-1.0/auto/types/typedef branches/stable-1.0/auto/types/uintptr_t branches/stable-1.0/auto/types/value branches/stable-1.0/auto/unix branches/stable-1.0/docs/man/nginx.8 branches/stable-1.0/docs/text/LICENSE branches/stable-1.0/src/core/nginx.c branches/stable-1.0/src/core/nginx.h branches/stable-1.0/src/core/ngx_array.c branches/stable-1.0/src/core/ngx_array.h branches/stable-1.0/src/core/ngx_buf.c branches/stable-1.0/src/core/ngx_buf.h branches/stable-1.0/src/core/ngx_conf_file.c branches/stable-1.0/src/core/ngx_conf_file.h branches/stable-1.0/src/core/ngx_config.h branches/stable-1.0/src/core/ngx_connection.c branches/stable-1.0/src/core/ngx_connection.h branches/stable-1.0/src/core/ngx_core.h branches/stable-1.0/src/core/ngx_cpuinfo.c branches/stable-1.0/src/core/ngx_crc.h branches/stable-1.0/src/core/ngx_crc32.c branches/stable-1.0/src/core/ngx_crc32.h branches/stable-1.0/src/core/ngx_crypt.h branches/stable-1.0/src/core/ngx_cycle.c branches/stable-1.0/src/core/ngx_cycle.h branches/stable-1.0/src/core/ngx_file.c branches/stable-1.0/src/core/ngx_file.h branches/stable-1.0/src/core/ngx_hash.c branches/stable-1.0/src/core/ngx_hash.h branches/stable-1.0/src/core/ngx_inet.c branches/stable-1.0/src/core/ngx_inet.h branches/stable-1.0/src/core/ngx_list.c branches/stable-1.0/src/core/ngx_list.h branches/stable-1.0/src/core/ngx_log.c branches/stable-1.0/src/core/ngx_log.h branches/stable-1.0/src/core/ngx_md5.h branches/stable-1.0/src/core/ngx_murmurhash.h branches/stable-1.0/src/core/ngx_open_file_cache.c branches/stable-1.0/src/core/ngx_open_file_cache.h branches/stable-1.0/src/core/ngx_output_chain.c branches/stable-1.0/src/core/ngx_palloc.c branches/stable-1.0/src/core/ngx_palloc.h branches/stable-1.0/src/core/ngx_parse.c branches/stable-1.0/src/core/ngx_parse.h branches/stable-1.0/src/core/ngx_queue.c branches/stable-1.0/src/core/ngx_queue.h branches/stable-1.0/src/core/ngx_radix_tree.c branches/stable-1.0/src/core/ngx_radix_tree.h branches/stable-1.0/src/core/ngx_rbtree.c branches/stable-1.0/src/core/ngx_rbtree.h branches/stable-1.0/src/core/ngx_regex.c branches/stable-1.0/src/core/ngx_regex.h branches/stable-1.0/src/core/ngx_resolver.c branches/stable-1.0/src/core/ngx_resolver.h branches/stable-1.0/src/core/ngx_sha1.h branches/stable-1.0/src/core/ngx_shmtx.c branches/stable-1.0/src/core/ngx_shmtx.h branches/stable-1.0/src/core/ngx_slab.c branches/stable-1.0/src/core/ngx_slab.h branches/stable-1.0/src/core/ngx_spinlock.c branches/stable-1.0/src/core/ngx_string.c branches/stable-1.0/src/core/ngx_string.h branches/stable-1.0/src/core/ngx_times.c branches/stable-1.0/src/core/ngx_times.h branches/stable-1.0/src/event/modules/ngx_aio_module.c branches/stable-1.0/src/event/modules/ngx_devpoll_module.c branches/stable-1.0/src/event/modules/ngx_epoll_module.c branches/stable-1.0/src/event/modules/ngx_eventport_module.c branches/stable-1.0/src/event/modules/ngx_iocp_module.c branches/stable-1.0/src/event/modules/ngx_iocp_module.h branches/stable-1.0/src/event/modules/ngx_kqueue_module.c branches/stable-1.0/src/event/modules/ngx_poll_module.c branches/stable-1.0/src/event/modules/ngx_rtsig_module.c branches/stable-1.0/src/event/modules/ngx_select_module.c branches/stable-1.0/src/event/modules/ngx_win32_select_module.c branches/stable-1.0/src/event/ngx_event.c branches/stable-1.0/src/event/ngx_event.h branches/stable-1.0/src/event/ngx_event_accept.c branches/stable-1.0/src/event/ngx_event_acceptex.c branches/stable-1.0/src/event/ngx_event_busy_lock.c branches/stable-1.0/src/event/ngx_event_busy_lock.h branches/stable-1.0/src/event/ngx_event_connect.c branches/stable-1.0/src/event/ngx_event_connect.h branches/stable-1.0/src/event/ngx_event_connectex.c branches/stable-1.0/src/event/ngx_event_mutex.c branches/stable-1.0/src/event/ngx_event_openssl.c branches/stable-1.0/src/event/ngx_event_openssl.h branches/stable-1.0/src/event/ngx_event_pipe.c branches/stable-1.0/src/event/ngx_event_pipe.h branches/stable-1.0/src/event/ngx_event_posted.c branches/stable-1.0/src/event/ngx_event_posted.h branches/stable-1.0/src/event/ngx_event_timer.c branches/stable-1.0/src/event/ngx_event_timer.h branches/stable-1.0/src/http/modules/ngx_http_access_module.c branches/stable-1.0/src/http/modules/ngx_http_addition_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_auth_basic_module.c branches/stable-1.0/src/http/modules/ngx_http_autoindex_module.c branches/stable-1.0/src/http/modules/ngx_http_browser_module.c branches/stable-1.0/src/http/modules/ngx_http_charset_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_chunked_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_dav_module.c branches/stable-1.0/src/http/modules/ngx_http_degradation_module.c branches/stable-1.0/src/http/modules/ngx_http_empty_gif_module.c branches/stable-1.0/src/http/modules/ngx_http_fastcgi_module.c branches/stable-1.0/src/http/modules/ngx_http_flv_module.c branches/stable-1.0/src/http/modules/ngx_http_geo_module.c branches/stable-1.0/src/http/modules/ngx_http_geoip_module.c branches/stable-1.0/src/http/modules/ngx_http_gzip_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_gzip_static_module.c branches/stable-1.0/src/http/modules/ngx_http_headers_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_image_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_index_module.c branches/stable-1.0/src/http/modules/ngx_http_limit_req_module.c branches/stable-1.0/src/http/modules/ngx_http_limit_zone_module.c branches/stable-1.0/src/http/modules/ngx_http_log_module.c branches/stable-1.0/src/http/modules/ngx_http_map_module.c branches/stable-1.0/src/http/modules/ngx_http_memcached_module.c branches/stable-1.0/src/http/modules/ngx_http_mp4_module.c branches/stable-1.0/src/http/modules/ngx_http_not_modified_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c branches/stable-1.0/src/http/modules/ngx_http_random_index_module.c branches/stable-1.0/src/http/modules/ngx_http_range_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_realip_module.c branches/stable-1.0/src/http/modules/ngx_http_referer_module.c branches/stable-1.0/src/http/modules/ngx_http_rewrite_module.c branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c branches/stable-1.0/src/http/modules/ngx_http_secure_link_module.c branches/stable-1.0/src/http/modules/ngx_http_split_clients_module.c branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.h branches/stable-1.0/src/http/modules/ngx_http_ssl_module.c branches/stable-1.0/src/http/modules/ngx_http_ssl_module.h branches/stable-1.0/src/http/modules/ngx_http_static_module.c branches/stable-1.0/src/http/modules/ngx_http_stub_status_module.c branches/stable-1.0/src/http/modules/ngx_http_sub_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_upstream_ip_hash_module.c branches/stable-1.0/src/http/modules/ngx_http_userid_filter_module.c branches/stable-1.0/src/http/modules/ngx_http_uwsgi_module.c branches/stable-1.0/src/http/modules/ngx_http_xslt_filter_module.c branches/stable-1.0/src/http/modules/perl/Makefile.PL branches/stable-1.0/src/http/modules/perl/nginx.xs branches/stable-1.0/src/http/modules/perl/ngx_http_perl_module.c branches/stable-1.0/src/http/modules/perl/ngx_http_perl_module.h branches/stable-1.0/src/http/ngx_http.c branches/stable-1.0/src/http/ngx_http.h branches/stable-1.0/src/http/ngx_http_busy_lock.c branches/stable-1.0/src/http/ngx_http_busy_lock.h branches/stable-1.0/src/http/ngx_http_cache.h branches/stable-1.0/src/http/ngx_http_config.h branches/stable-1.0/src/http/ngx_http_copy_filter_module.c branches/stable-1.0/src/http/ngx_http_core_module.c branches/stable-1.0/src/http/ngx_http_core_module.h branches/stable-1.0/src/http/ngx_http_file_cache.c branches/stable-1.0/src/http/ngx_http_header_filter_module.c branches/stable-1.0/src/http/ngx_http_parse.c branches/stable-1.0/src/http/ngx_http_parse_time.c branches/stable-1.0/src/http/ngx_http_postpone_filter_module.c branches/stable-1.0/src/http/ngx_http_request.c branches/stable-1.0/src/http/ngx_http_request.h branches/stable-1.0/src/http/ngx_http_request_body.c branches/stable-1.0/src/http/ngx_http_script.c branches/stable-1.0/src/http/ngx_http_script.h branches/stable-1.0/src/http/ngx_http_special_response.c branches/stable-1.0/src/http/ngx_http_upstream.c branches/stable-1.0/src/http/ngx_http_upstream.h branches/stable-1.0/src/http/ngx_http_upstream_round_robin.c branches/stable-1.0/src/http/ngx_http_upstream_round_robin.h branches/stable-1.0/src/http/ngx_http_variables.c branches/stable-1.0/src/http/ngx_http_variables.h branches/stable-1.0/src/http/ngx_http_write_filter_module.c branches/stable-1.0/src/mail/ngx_mail.c branches/stable-1.0/src/mail/ngx_mail.h branches/stable-1.0/src/mail/ngx_mail_auth_http_module.c branches/stable-1.0/src/mail/ngx_mail_core_module.c branches/stable-1.0/src/mail/ngx_mail_handler.c branches/stable-1.0/src/mail/ngx_mail_imap_handler.c branches/stable-1.0/src/mail/ngx_mail_imap_module.c branches/stable-1.0/src/mail/ngx_mail_imap_module.h branches/stable-1.0/src/mail/ngx_mail_parse.c branches/stable-1.0/src/mail/ngx_mail_pop3_handler.c branches/stable-1.0/src/mail/ngx_mail_pop3_module.c branches/stable-1.0/src/mail/ngx_mail_pop3_module.h branches/stable-1.0/src/mail/ngx_mail_proxy_module.c branches/stable-1.0/src/mail/ngx_mail_smtp_handler.c branches/stable-1.0/src/mail/ngx_mail_smtp_module.c branches/stable-1.0/src/mail/ngx_mail_smtp_module.h branches/stable-1.0/src/mail/ngx_mail_ssl_module.c branches/stable-1.0/src/mail/ngx_mail_ssl_module.h branches/stable-1.0/src/misc/ngx_google_perftools_module.c branches/stable-1.0/src/mysql/ngx_http_mysql_test.c branches/stable-1.0/src/mysql/ngx_mysql.c branches/stable-1.0/src/mysql/ngx_mysql.h branches/stable-1.0/src/os/unix/ngx_aio_read.c branches/stable-1.0/src/os/unix/ngx_aio_read_chain.c branches/stable-1.0/src/os/unix/ngx_aio_write.c branches/stable-1.0/src/os/unix/ngx_aio_write_chain.c branches/stable-1.0/src/os/unix/ngx_alloc.c branches/stable-1.0/src/os/unix/ngx_alloc.h branches/stable-1.0/src/os/unix/ngx_atomic.h branches/stable-1.0/src/os/unix/ngx_channel.c branches/stable-1.0/src/os/unix/ngx_channel.h branches/stable-1.0/src/os/unix/ngx_daemon.c branches/stable-1.0/src/os/unix/ngx_darwin.h branches/stable-1.0/src/os/unix/ngx_darwin_config.h branches/stable-1.0/src/os/unix/ngx_darwin_init.c branches/stable-1.0/src/os/unix/ngx_darwin_sendfile_chain.c branches/stable-1.0/src/os/unix/ngx_errno.c branches/stable-1.0/src/os/unix/ngx_errno.h branches/stable-1.0/src/os/unix/ngx_file_aio_read.c branches/stable-1.0/src/os/unix/ngx_files.c branches/stable-1.0/src/os/unix/ngx_files.h branches/stable-1.0/src/os/unix/ngx_freebsd.h branches/stable-1.0/src/os/unix/ngx_freebsd_config.h branches/stable-1.0/src/os/unix/ngx_freebsd_init.c branches/stable-1.0/src/os/unix/ngx_freebsd_rfork_thread.c branches/stable-1.0/src/os/unix/ngx_freebsd_rfork_thread.h branches/stable-1.0/src/os/unix/ngx_freebsd_sendfile_chain.c branches/stable-1.0/src/os/unix/ngx_gcc_atomic_amd64.h branches/stable-1.0/src/os/unix/ngx_gcc_atomic_ppc.h branches/stable-1.0/src/os/unix/ngx_gcc_atomic_sparc64.h branches/stable-1.0/src/os/unix/ngx_gcc_atomic_x86.h branches/stable-1.0/src/os/unix/ngx_linux.h branches/stable-1.0/src/os/unix/ngx_linux_aio_read.c branches/stable-1.0/src/os/unix/ngx_linux_config.h branches/stable-1.0/src/os/unix/ngx_linux_init.c branches/stable-1.0/src/os/unix/ngx_linux_sendfile_chain.c branches/stable-1.0/src/os/unix/ngx_os.h branches/stable-1.0/src/os/unix/ngx_posix_config.h branches/stable-1.0/src/os/unix/ngx_posix_init.c branches/stable-1.0/src/os/unix/ngx_process.c branches/stable-1.0/src/os/unix/ngx_process.h branches/stable-1.0/src/os/unix/ngx_process_cycle.c branches/stable-1.0/src/os/unix/ngx_process_cycle.h branches/stable-1.0/src/os/unix/ngx_pthread_thread.c branches/stable-1.0/src/os/unix/ngx_readv_chain.c branches/stable-1.0/src/os/unix/ngx_recv.c branches/stable-1.0/src/os/unix/ngx_send.c branches/stable-1.0/src/os/unix/ngx_setproctitle.c branches/stable-1.0/src/os/unix/ngx_setproctitle.h branches/stable-1.0/src/os/unix/ngx_shmem.c branches/stable-1.0/src/os/unix/ngx_shmem.h branches/stable-1.0/src/os/unix/ngx_socket.c branches/stable-1.0/src/os/unix/ngx_socket.h branches/stable-1.0/src/os/unix/ngx_solaris.h branches/stable-1.0/src/os/unix/ngx_solaris_config.h branches/stable-1.0/src/os/unix/ngx_solaris_init.c branches/stable-1.0/src/os/unix/ngx_solaris_sendfilev_chain.c branches/stable-1.0/src/os/unix/ngx_sunpro_amd64.il branches/stable-1.0/src/os/unix/ngx_sunpro_atomic_sparc64.h branches/stable-1.0/src/os/unix/ngx_sunpro_sparc64.il branches/stable-1.0/src/os/unix/ngx_sunpro_x86.il branches/stable-1.0/src/os/unix/ngx_thread.h branches/stable-1.0/src/os/unix/ngx_time.c branches/stable-1.0/src/os/unix/ngx_time.h branches/stable-1.0/src/os/unix/ngx_udp_recv.c branches/stable-1.0/src/os/unix/ngx_user.c branches/stable-1.0/src/os/unix/ngx_user.h branches/stable-1.0/src/os/unix/ngx_writev_chain.c branches/stable-1.0/src/os/unix/rfork_thread.S branches/stable-1.0/src/os/win32/nginx.rc branches/stable-1.0/src/os/win32/ngx_alloc.c branches/stable-1.0/src/os/win32/ngx_alloc.h branches/stable-1.0/src/os/win32/ngx_atomic.h branches/stable-1.0/src/os/win32/ngx_errno.c branches/stable-1.0/src/os/win32/ngx_errno.h branches/stable-1.0/src/os/win32/ngx_event_log.c branches/stable-1.0/src/os/win32/ngx_files.c branches/stable-1.0/src/os/win32/ngx_files.h branches/stable-1.0/src/os/win32/ngx_os.h branches/stable-1.0/src/os/win32/ngx_process.c branches/stable-1.0/src/os/win32/ngx_process.h branches/stable-1.0/src/os/win32/ngx_process_cycle.c branches/stable-1.0/src/os/win32/ngx_process_cycle.h branches/stable-1.0/src/os/win32/ngx_service.c branches/stable-1.0/src/os/win32/ngx_shmem.c branches/stable-1.0/src/os/win32/ngx_shmem.h branches/stable-1.0/src/os/win32/ngx_socket.c branches/stable-1.0/src/os/win32/ngx_socket.h branches/stable-1.0/src/os/win32/ngx_stat.c branches/stable-1.0/src/os/win32/ngx_thread.c branches/stable-1.0/src/os/win32/ngx_thread.h branches/stable-1.0/src/os/win32/ngx_time.c branches/stable-1.0/src/os/win32/ngx_time.h branches/stable-1.0/src/os/win32/ngx_udp_wsarecv.c branches/stable-1.0/src/os/win32/ngx_user.c branches/stable-1.0/src/os/win32/ngx_user.h branches/stable-1.0/src/os/win32/ngx_win32_config.h branches/stable-1.0/src/os/win32/ngx_win32_init.c branches/stable-1.0/src/os/win32/ngx_wsarecv.c branches/stable-1.0/src/os/win32/ngx_wsarecv_chain.c branches/stable-1.0/src/os/win32/ngx_wsasend.c branches/stable-1.0/src/os/win32/ngx_wsasend_chain.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4405,4415 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4406,4413,4415 Modified: branches/stable-1.0/auto/cc/acc =================================================================== --- branches/stable-1.0/auto/cc/acc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/acc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. # aCC: HP ANSI C++ B3910B A.03.55.02 Modified: branches/stable-1.0/auto/cc/bcc =================================================================== --- branches/stable-1.0/auto/cc/bcc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/bcc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. # Borland C++ 5.5 Modified: branches/stable-1.0/auto/cc/ccc =================================================================== --- branches/stable-1.0/auto/cc/ccc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/ccc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. # Compaq C V6.5-207 Modified: branches/stable-1.0/auto/cc/conf =================================================================== --- branches/stable-1.0/auto/cc/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. LINK="\$(CC)" Modified: branches/stable-1.0/auto/cc/gcc =================================================================== --- branches/stable-1.0/auto/cc/gcc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/gcc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. # gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2 Modified: branches/stable-1.0/auto/cc/icc =================================================================== --- branches/stable-1.0/auto/cc/icc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/icc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. # Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1 Modified: branches/stable-1.0/auto/cc/msvc =================================================================== --- branches/stable-1.0/auto/cc/msvc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/msvc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. # MSVC 6.0 SP2 Modified: branches/stable-1.0/auto/cc/name =================================================================== --- branches/stable-1.0/auto/cc/name 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/name 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ "$NGX_PLATFORM" != win32 ]; then Modified: branches/stable-1.0/auto/cc/owc =================================================================== --- branches/stable-1.0/auto/cc/owc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/owc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. # Open Watcom C 1.0, 1.2, 1.3 Modified: branches/stable-1.0/auto/cc/sunc =================================================================== --- branches/stable-1.0/auto/cc/sunc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/cc/sunc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. # Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10 Modified: branches/stable-1.0/auto/configure =================================================================== --- branches/stable-1.0/auto/configure 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/configure 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ #!/bin/sh # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. . auto/options Modified: branches/stable-1.0/auto/define =================================================================== --- branches/stable-1.0/auto/define 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/define 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. cat << END >> $NGX_AUTO_CONFIG_H Modified: branches/stable-1.0/auto/endianess =================================================================== --- branches/stable-1.0/auto/endianess 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/endianess 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo $ngx_n "checking for system endianess ...$ngx_c" Modified: branches/stable-1.0/auto/feature =================================================================== --- branches/stable-1.0/auto/feature 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/feature 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo $ngx_n "checking for $ngx_feature ...$ngx_c" Modified: branches/stable-1.0/auto/have =================================================================== --- branches/stable-1.0/auto/have 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/have 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. cat << END >> $NGX_AUTO_CONFIG_H Modified: branches/stable-1.0/auto/have_headers =================================================================== --- branches/stable-1.0/auto/have_headers 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/have_headers 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. cat << END >> $NGX_AUTO_HEADERS_H Modified: branches/stable-1.0/auto/headers =================================================================== --- branches/stable-1.0/auto/headers 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/headers 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. ngx_include="unistd.h"; . auto/include Modified: branches/stable-1.0/auto/include =================================================================== --- branches/stable-1.0/auto/include 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/include 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo $ngx_n "checking for $ngx_include ...$ngx_c" Modified: branches/stable-1.0/auto/init =================================================================== --- branches/stable-1.0/auto/init 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/init 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. NGX_MAKEFILE=$NGX_OBJS/Makefile Modified: branches/stable-1.0/auto/install =================================================================== --- branches/stable-1.0/auto/install 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/install 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $USE_PERL = YES ]; then Modified: branches/stable-1.0/auto/lib/conf =================================================================== --- branches/stable-1.0/auto/lib/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $USE_PCRE = YES -o $PCRE != NONE ]; then Modified: branches/stable-1.0/auto/lib/geoip/conf =================================================================== --- branches/stable-1.0/auto/lib/geoip/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/geoip/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. ngx_feature="GeoIP library" Modified: branches/stable-1.0/auto/lib/google-perftools/conf =================================================================== --- branches/stable-1.0/auto/lib/google-perftools/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/google-perftools/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. ngx_feature="Google perftools" Modified: branches/stable-1.0/auto/lib/libatomic/conf =================================================================== --- branches/stable-1.0/auto/lib/libatomic/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/libatomic/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $NGX_LIBATOMIC != YES ]; then Modified: branches/stable-1.0/auto/lib/libatomic/make =================================================================== --- branches/stable-1.0/auto/lib/libatomic/make 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/libatomic/make 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. cat << END >> $NGX_MAKEFILE Modified: branches/stable-1.0/auto/lib/libgd/conf =================================================================== --- branches/stable-1.0/auto/lib/libgd/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/libgd/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. ngx_feature="GD library" Modified: branches/stable-1.0/auto/lib/libxslt/conf =================================================================== --- branches/stable-1.0/auto/lib/libxslt/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/libxslt/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. ngx_feature="libxslt" Modified: branches/stable-1.0/auto/lib/make =================================================================== --- branches/stable-1.0/auto/lib/make 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/make 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $PCRE != NONE -a $PCRE != NO -a $PCRE != YES ]; then Modified: branches/stable-1.0/auto/lib/md5/conf =================================================================== --- branches/stable-1.0/auto/lib/md5/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/md5/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $MD5 != NONE ]; then Modified: branches/stable-1.0/auto/lib/md5/make =================================================================== --- branches/stable-1.0/auto/lib/md5/make 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/md5/make 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. case "$NGX_CC_NAME" in Modified: branches/stable-1.0/auto/lib/md5/makefile.bcc =================================================================== --- branches/stable-1.0/auto/lib/md5/makefile.bcc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/md5/makefile.bcc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN Modified: branches/stable-1.0/auto/lib/md5/makefile.msvc =================================================================== --- branches/stable-1.0/auto/lib/md5/makefile.msvc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/md5/makefile.msvc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN Modified: branches/stable-1.0/auto/lib/md5/makefile.owc =================================================================== --- branches/stable-1.0/auto/lib/md5/makefile.owc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/md5/makefile.owc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT) Modified: branches/stable-1.0/auto/lib/openssl/conf =================================================================== --- branches/stable-1.0/auto/lib/openssl/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/openssl/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $OPENSSL != NONE ]; then Modified: branches/stable-1.0/auto/lib/openssl/make =================================================================== --- branches/stable-1.0/auto/lib/openssl/make 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/openssl/make 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. case "$CC" in Modified: branches/stable-1.0/auto/lib/openssl/makefile.bcc =================================================================== --- branches/stable-1.0/auto/lib/openssl/makefile.bcc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/openssl/makefile.bcc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. all: Modified: branches/stable-1.0/auto/lib/openssl/makefile.msvc =================================================================== --- branches/stable-1.0/auto/lib/openssl/makefile.msvc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/openssl/makefile.msvc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. all: Modified: branches/stable-1.0/auto/lib/pcre/conf =================================================================== --- branches/stable-1.0/auto/lib/pcre/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/pcre/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $PCRE != NONE ]; then Modified: branches/stable-1.0/auto/lib/pcre/make =================================================================== --- branches/stable-1.0/auto/lib/pcre/make 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/pcre/make 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. case "$NGX_CC_NAME" in Modified: branches/stable-1.0/auto/lib/pcre/makefile.bcc =================================================================== --- branches/stable-1.0/auto/lib/pcre/makefile.bcc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/pcre/makefile.bcc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -q -O2 -tWM -w-8004 $(CPU_OPT) Modified: branches/stable-1.0/auto/lib/pcre/makefile.msvc =================================================================== --- branches/stable-1.0/auto/lib/pcre/makefile.msvc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/pcre/makefile.msvc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) Modified: branches/stable-1.0/auto/lib/pcre/makefile.owc =================================================================== --- branches/stable-1.0/auto/lib/pcre/makefile.owc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/pcre/makefile.owc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -c -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT) Modified: branches/stable-1.0/auto/lib/perl/conf =================================================================== --- branches/stable-1.0/auto/lib/perl/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/perl/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo "checking for perl" Modified: branches/stable-1.0/auto/lib/perl/make =================================================================== --- branches/stable-1.0/auto/lib/perl/make 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/perl/make 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. cat << END >> $NGX_MAKEFILE Modified: branches/stable-1.0/auto/lib/sha1/conf =================================================================== --- branches/stable-1.0/auto/lib/sha1/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/sha1/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $SHA1 != NONE ]; then Modified: branches/stable-1.0/auto/lib/sha1/make =================================================================== --- branches/stable-1.0/auto/lib/sha1/make 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/sha1/make 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. case "$NGX_CC_NAME" in Modified: branches/stable-1.0/auto/lib/sha1/makefile.bcc =================================================================== --- branches/stable-1.0/auto/lib/sha1/makefile.bcc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/sha1/makefile.bcc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN Modified: branches/stable-1.0/auto/lib/sha1/makefile.msvc =================================================================== --- branches/stable-1.0/auto/lib/sha1/makefile.msvc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/sha1/makefile.msvc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN Modified: branches/stable-1.0/auto/lib/sha1/makefile.owc =================================================================== --- branches/stable-1.0/auto/lib/sha1/makefile.owc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/sha1/makefile.owc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT) Modified: branches/stable-1.0/auto/lib/test =================================================================== --- branches/stable-1.0/auto/lib/test 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/test 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo $ngx_n "checking for $ngx_lib ...$ngx_c" Modified: branches/stable-1.0/auto/lib/zlib/conf =================================================================== --- branches/stable-1.0/auto/lib/zlib/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/zlib/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $ZLIB != NONE ]; then Modified: branches/stable-1.0/auto/lib/zlib/make =================================================================== --- branches/stable-1.0/auto/lib/zlib/make 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/zlib/make 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. case "$NGX_CC_NAME" in Modified: branches/stable-1.0/auto/lib/zlib/makefile.bcc =================================================================== --- branches/stable-1.0/auto/lib/zlib/makefile.bcc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/zlib/makefile.bcc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -q -O2 -tWM -w-8004 -w-8012 $(CPU_OPT) Modified: branches/stable-1.0/auto/lib/zlib/makefile.msvc =================================================================== --- branches/stable-1.0/auto/lib/zlib/makefile.msvc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/zlib/makefile.msvc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) Modified: branches/stable-1.0/auto/lib/zlib/makefile.owc =================================================================== --- branches/stable-1.0/auto/lib/zlib/makefile.owc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/lib/zlib/makefile.owc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CFLAGS = -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT) Modified: branches/stable-1.0/auto/make =================================================================== --- branches/stable-1.0/auto/make 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/make 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo "creating $NGX_MAKEFILE" Modified: branches/stable-1.0/auto/modules =================================================================== --- branches/stable-1.0/auto/modules 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/modules 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. if [ $EVENT_SELECT = NO -a $EVENT_FOUND = NO ]; then Modified: branches/stable-1.0/auto/nohave =================================================================== --- branches/stable-1.0/auto/nohave 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/nohave 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. cat << END >> $NGX_AUTO_CONFIG_H Modified: branches/stable-1.0/auto/options =================================================================== --- branches/stable-1.0/auto/options 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/options 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. help=no Modified: branches/stable-1.0/auto/os/conf =================================================================== --- branches/stable-1.0/auto/os/conf 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/os/conf 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo "checking for $NGX_SYSTEM specific features" Modified: branches/stable-1.0/auto/os/darwin =================================================================== --- branches/stable-1.0/auto/os/darwin 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/os/darwin 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. have=NGX_DARWIN . auto/have_headers Modified: branches/stable-1.0/auto/os/freebsd =================================================================== --- branches/stable-1.0/auto/os/freebsd 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/os/freebsd 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. have=NGX_FREEBSD . auto/have_headers Modified: branches/stable-1.0/auto/os/linux =================================================================== --- branches/stable-1.0/auto/os/linux 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/os/linux 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. have=NGX_LINUX . auto/have_headers Modified: branches/stable-1.0/auto/os/solaris =================================================================== --- branches/stable-1.0/auto/os/solaris 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/os/solaris 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. have=NGX_SOLARIS . auto/have_headers Modified: branches/stable-1.0/auto/os/win32 =================================================================== --- branches/stable-1.0/auto/os/win32 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/os/win32 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. have=NGX_WIN32 . auto/have_headers Modified: branches/stable-1.0/auto/sources =================================================================== --- branches/stable-1.0/auto/sources 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/sources 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. CORE_MODULES="ngx_core_module ngx_errlog_module ngx_conf_module" Modified: branches/stable-1.0/auto/stubs =================================================================== --- branches/stable-1.0/auto/stubs 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/stubs 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. have=NGX_SUPPRESS_WARN . auto/have Modified: branches/stable-1.0/auto/summary =================================================================== --- branches/stable-1.0/auto/summary 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/summary 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. ### STUB Modified: branches/stable-1.0/auto/types/sizeof =================================================================== --- branches/stable-1.0/auto/types/sizeof 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/types/sizeof 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo $ngx_n "checking for $ngx_type size ...$ngx_c" Modified: branches/stable-1.0/auto/types/typedef =================================================================== --- branches/stable-1.0/auto/types/typedef 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/types/typedef 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo $ngx_n "checking for $ngx_type ...$ngx_c" Modified: branches/stable-1.0/auto/types/uintptr_t =================================================================== --- branches/stable-1.0/auto/types/uintptr_t 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/types/uintptr_t 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. echo $ngx_n "checking for uintptr_t ...$ngx_c" Modified: branches/stable-1.0/auto/types/value =================================================================== --- branches/stable-1.0/auto/types/value 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/types/value 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. cat << END >> $NGX_AUTO_CONFIG_H Modified: branches/stable-1.0/auto/unix =================================================================== --- branches/stable-1.0/auto/unix 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/auto/unix 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. NGX_USER=${NGX_USER:-nobody} Modified: branches/stable-1.0/docs/man/nginx.8 =================================================================== --- branches/stable-1.0/docs/man/nginx.8 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/docs/man/nginx.8 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ .\" .\" Copyright (c) 2010 Sergey A. Osokin +.\" Copyright (c) 2011,2012 Nginx, Inc. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: branches/stable-1.0/docs/text/LICENSE =================================================================== --- branches/stable-1.0/docs/text/LICENSE 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/docs/text/LICENSE 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ /* - * Copyright (C) 2002-2011 Igor Sysoev + * Copyright (C) 2002-2012 Igor Sysoev + * Copyright (C) 2011,2012 Nginx, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: branches/stable-1.0/src/core/nginx.c =================================================================== --- branches/stable-1.0/src/core/nginx.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/nginx.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/nginx.h =================================================================== --- branches/stable-1.0/src/core/nginx.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/nginx.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_array.c =================================================================== --- branches/stable-1.0/src/core/ngx_array.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_array.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_array.h =================================================================== --- branches/stable-1.0/src/core/ngx_array.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_array.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_buf.c =================================================================== --- branches/stable-1.0/src/core/ngx_buf.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_buf.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_buf.h =================================================================== --- branches/stable-1.0/src/core/ngx_buf.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_buf.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_conf_file.c =================================================================== --- branches/stable-1.0/src/core/ngx_conf_file.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_conf_file.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_conf_file.h =================================================================== --- branches/stable-1.0/src/core/ngx_conf_file.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_conf_file.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_config.h =================================================================== --- branches/stable-1.0/src/core/ngx_config.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_config.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_connection.c =================================================================== --- branches/stable-1.0/src/core/ngx_connection.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_connection.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_connection.h =================================================================== --- branches/stable-1.0/src/core/ngx_connection.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_connection.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_core.h =================================================================== --- branches/stable-1.0/src/core/ngx_core.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_core.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_cpuinfo.c =================================================================== --- branches/stable-1.0/src/core/ngx_cpuinfo.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_cpuinfo.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_crc.h =================================================================== --- branches/stable-1.0/src/core/ngx_crc.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_crc.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_crc32.c =================================================================== --- branches/stable-1.0/src/core/ngx_crc32.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_crc32.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_crc32.h =================================================================== --- branches/stable-1.0/src/core/ngx_crc32.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_crc32.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_crypt.h =================================================================== --- branches/stable-1.0/src/core/ngx_crypt.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_crypt.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_cycle.c =================================================================== --- branches/stable-1.0/src/core/ngx_cycle.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_cycle.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_cycle.h =================================================================== --- branches/stable-1.0/src/core/ngx_cycle.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_cycle.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_file.c =================================================================== --- branches/stable-1.0/src/core/ngx_file.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_file.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_file.h =================================================================== --- branches/stable-1.0/src/core/ngx_file.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_file.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_hash.c =================================================================== --- branches/stable-1.0/src/core/ngx_hash.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_hash.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_hash.h =================================================================== --- branches/stable-1.0/src/core/ngx_hash.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_hash.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_inet.c =================================================================== --- branches/stable-1.0/src/core/ngx_inet.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_inet.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_inet.h =================================================================== --- branches/stable-1.0/src/core/ngx_inet.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_inet.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_list.c =================================================================== --- branches/stable-1.0/src/core/ngx_list.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_list.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_list.h =================================================================== --- branches/stable-1.0/src/core/ngx_list.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_list.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_log.c =================================================================== --- branches/stable-1.0/src/core/ngx_log.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_log.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_log.h =================================================================== --- branches/stable-1.0/src/core/ngx_log.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_log.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_md5.h =================================================================== --- branches/stable-1.0/src/core/ngx_md5.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_md5.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_murmurhash.h =================================================================== --- branches/stable-1.0/src/core/ngx_murmurhash.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_murmurhash.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_open_file_cache.c =================================================================== --- branches/stable-1.0/src/core/ngx_open_file_cache.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_open_file_cache.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_open_file_cache.h =================================================================== --- branches/stable-1.0/src/core/ngx_open_file_cache.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_open_file_cache.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_output_chain.c =================================================================== --- branches/stable-1.0/src/core/ngx_output_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_output_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_palloc.c =================================================================== --- branches/stable-1.0/src/core/ngx_palloc.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_palloc.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_palloc.h =================================================================== --- branches/stable-1.0/src/core/ngx_palloc.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_palloc.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_parse.c =================================================================== --- branches/stable-1.0/src/core/ngx_parse.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_parse.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_parse.h =================================================================== --- branches/stable-1.0/src/core/ngx_parse.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_parse.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_queue.c =================================================================== --- branches/stable-1.0/src/core/ngx_queue.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_queue.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_queue.h =================================================================== --- branches/stable-1.0/src/core/ngx_queue.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_queue.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_radix_tree.c =================================================================== --- branches/stable-1.0/src/core/ngx_radix_tree.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_radix_tree.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_radix_tree.h =================================================================== --- branches/stable-1.0/src/core/ngx_radix_tree.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_radix_tree.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_rbtree.c =================================================================== --- branches/stable-1.0/src/core/ngx_rbtree.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_rbtree.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_rbtree.h =================================================================== --- branches/stable-1.0/src/core/ngx_rbtree.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_rbtree.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_regex.c =================================================================== --- branches/stable-1.0/src/core/ngx_regex.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_regex.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_regex.h =================================================================== --- branches/stable-1.0/src/core/ngx_regex.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_regex.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_resolver.c =================================================================== --- branches/stable-1.0/src/core/ngx_resolver.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_resolver.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_resolver.h =================================================================== --- branches/stable-1.0/src/core/ngx_resolver.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_resolver.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_sha1.h =================================================================== --- branches/stable-1.0/src/core/ngx_sha1.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_sha1.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_shmtx.c =================================================================== --- branches/stable-1.0/src/core/ngx_shmtx.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_shmtx.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_shmtx.h =================================================================== --- branches/stable-1.0/src/core/ngx_shmtx.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_shmtx.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_slab.c =================================================================== --- branches/stable-1.0/src/core/ngx_slab.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_slab.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ #include Modified: branches/stable-1.0/src/core/ngx_slab.h =================================================================== --- branches/stable-1.0/src/core/ngx_slab.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_slab.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_spinlock.c =================================================================== --- branches/stable-1.0/src/core/ngx_spinlock.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_spinlock.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_string.c =================================================================== --- branches/stable-1.0/src/core/ngx_string.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_string.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_string.h =================================================================== --- branches/stable-1.0/src/core/ngx_string.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_string.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_times.c =================================================================== --- branches/stable-1.0/src/core/ngx_times.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_times.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/core/ngx_times.h =================================================================== --- branches/stable-1.0/src/core/ngx_times.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/core/ngx_times.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_aio_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_aio_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_aio_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_devpoll_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_devpoll_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_devpoll_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_epoll_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_epoll_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_epoll_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_eventport_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_eventport_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_eventport_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_iocp_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_iocp_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_iocp_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_iocp_module.h =================================================================== --- branches/stable-1.0/src/event/modules/ngx_iocp_module.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_iocp_module.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_kqueue_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_kqueue_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_kqueue_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_poll_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_poll_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_poll_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_rtsig_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_rtsig_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_rtsig_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_select_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_select_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_select_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/modules/ngx_win32_select_module.c =================================================================== --- branches/stable-1.0/src/event/modules/ngx_win32_select_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/modules/ngx_win32_select_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event.c =================================================================== --- branches/stable-1.0/src/event/ngx_event.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event.h =================================================================== --- branches/stable-1.0/src/event/ngx_event.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_accept.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_accept.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_accept.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_acceptex.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_acceptex.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_acceptex.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_busy_lock.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_busy_lock.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_busy_lock.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_busy_lock.h =================================================================== --- branches/stable-1.0/src/event/ngx_event_busy_lock.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_busy_lock.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_connect.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_connect.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_connect.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_connect.h =================================================================== --- branches/stable-1.0/src/event/ngx_event_connect.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_connect.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_connectex.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_connectex.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_connectex.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_mutex.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_mutex.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_mutex.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_openssl.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_openssl.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_openssl.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_openssl.h =================================================================== --- branches/stable-1.0/src/event/ngx_event_openssl.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_openssl.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_pipe.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_pipe.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_pipe.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_pipe.h =================================================================== --- branches/stable-1.0/src/event/ngx_event_pipe.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_pipe.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_posted.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_posted.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_posted.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_posted.h =================================================================== --- branches/stable-1.0/src/event/ngx_event_posted.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_posted.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_timer.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_timer.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_timer.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/event/ngx_event_timer.h =================================================================== --- branches/stable-1.0/src/event/ngx_event_timer.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/event/ngx_event_timer.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_access_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_access_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_access_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_addition_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_addition_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_addition_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_auth_basic_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_auth_basic_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_auth_basic_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_autoindex_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_autoindex_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_autoindex_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_browser_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_browser_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_browser_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_charset_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_charset_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_charset_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_chunked_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_chunked_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_chunked_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_dav_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_dav_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_dav_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_degradation_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_degradation_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_degradation_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_empty_gif_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_empty_gif_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_empty_gif_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ #include Modified: branches/stable-1.0/src/http/modules/ngx_http_fastcgi_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_fastcgi_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_fastcgi_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_flv_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_flv_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_flv_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ #include Modified: branches/stable-1.0/src/http/modules/ngx_http_geo_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_geo_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_geo_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_geoip_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_geoip_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_geoip_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_gzip_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_gzip_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_gzip_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_gzip_static_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_gzip_static_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_gzip_static_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_headers_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_headers_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_headers_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_image_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_image_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_image_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_index_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_index_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_index_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_limit_req_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_limit_req_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_limit_req_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_limit_zone_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_limit_zone_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_limit_zone_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_log_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_log_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_log_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_map_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_map_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_map_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_memcached_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_memcached_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_memcached_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_mp4_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_mp4_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_mp4_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ #include Modified: branches/stable-1.0/src/http/modules/ngx_http_not_modified_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_not_modified_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_not_modified_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_proxy_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_random_index_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_random_index_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_random_index_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_range_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_range_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_range_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_realip_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_realip_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_realip_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_referer_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_referer_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_referer_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_rewrite_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_rewrite_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_rewrite_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_scgi_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. * Copyright (C) Manlio Perillo (manlio.perillo at gmail.com) */ Modified: branches/stable-1.0/src/http/modules/ngx_http_secure_link_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_secure_link_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_secure_link_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_split_clients_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_split_clients_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_split_clients_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.h =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_ssi_filter_module.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_ssl_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_ssl_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_ssl_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_ssl_module.h =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_ssl_module.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_ssl_module.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_static_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_static_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_static_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_stub_status_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_stub_status_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_stub_status_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_sub_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_sub_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_sub_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_upstream_ip_hash_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_upstream_ip_hash_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_upstream_ip_hash_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_userid_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_userid_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_userid_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_uwsgi_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_uwsgi_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_uwsgi_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -3,6 +3,7 @@ * Copyright (C) Unbit S.a.s. 2009-2010 * Copyright (C) 2008 Manlio Perillo (manlio.perillo at gmail.com) * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/ngx_http_xslt_filter_module.c =================================================================== --- branches/stable-1.0/src/http/modules/ngx_http_xslt_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/ngx_http_xslt_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/perl/Makefile.PL =================================================================== --- branches/stable-1.0/src/http/modules/perl/Makefile.PL 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/perl/Makefile.PL 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ # Copyright (C) Igor Sysoev +# Copyright (C) Nginx, Inc. use 5.006001; use ExtUtils::MakeMaker; Modified: branches/stable-1.0/src/http/modules/perl/nginx.xs =================================================================== --- branches/stable-1.0/src/http/modules/perl/nginx.xs 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/perl/nginx.xs 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/perl/ngx_http_perl_module.c =================================================================== --- branches/stable-1.0/src/http/modules/perl/ngx_http_perl_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/perl/ngx_http_perl_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/modules/perl/ngx_http_perl_module.h =================================================================== --- branches/stable-1.0/src/http/modules/perl/ngx_http_perl_module.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/modules/perl/ngx_http_perl_module.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http.c =================================================================== --- branches/stable-1.0/src/http/ngx_http.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http.h =================================================================== --- branches/stable-1.0/src/http/ngx_http.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_busy_lock.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_busy_lock.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_busy_lock.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_busy_lock.h =================================================================== --- branches/stable-1.0/src/http/ngx_http_busy_lock.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_busy_lock.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_cache.h =================================================================== --- branches/stable-1.0/src/http/ngx_http_cache.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_cache.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_config.h =================================================================== --- branches/stable-1.0/src/http/ngx_http_config.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_config.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_copy_filter_module.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_copy_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_copy_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_core_module.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_core_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_core_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_core_module.h =================================================================== --- branches/stable-1.0/src/http/ngx_http_core_module.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_core_module.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_file_cache.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_file_cache.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_file_cache.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_header_filter_module.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_header_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_header_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_parse.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_parse.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_parse.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_parse_time.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_parse_time.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_parse_time.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_postpone_filter_module.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_postpone_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_postpone_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_request.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_request.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_request.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_request.h =================================================================== --- branches/stable-1.0/src/http/ngx_http_request.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_request.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_request_body.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_request_body.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_request_body.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_script.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_script.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_script.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_script.h =================================================================== --- branches/stable-1.0/src/http/ngx_http_script.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_script.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_special_response.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_special_response.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_special_response.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_upstream.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_upstream.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_upstream.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_upstream.h =================================================================== --- branches/stable-1.0/src/http/ngx_http_upstream.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_upstream.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_upstream_round_robin.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_upstream_round_robin.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_upstream_round_robin.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_upstream_round_robin.h =================================================================== --- branches/stable-1.0/src/http/ngx_http_upstream_round_robin.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_upstream_round_robin.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_variables.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_variables.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_variables.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_variables.h =================================================================== --- branches/stable-1.0/src/http/ngx_http_variables.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_variables.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/http/ngx_http_write_filter_module.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_write_filter_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/http/ngx_http_write_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail.h =================================================================== --- branches/stable-1.0/src/mail/ngx_mail.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_auth_http_module.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_auth_http_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_auth_http_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_core_module.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_core_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_core_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_handler.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_handler.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_handler.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_imap_handler.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_imap_handler.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_imap_handler.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_imap_module.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_imap_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_imap_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_imap_module.h =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_imap_module.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_imap_module.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_parse.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_parse.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_parse.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_pop3_handler.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_pop3_handler.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_pop3_handler.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_pop3_module.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_pop3_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_pop3_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_pop3_module.h =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_pop3_module.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_pop3_module.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_proxy_module.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_proxy_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_proxy_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_smtp_handler.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_smtp_handler.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_smtp_handler.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_smtp_module.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_smtp_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_smtp_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_smtp_module.h =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_smtp_module.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_smtp_module.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_ssl_module.c =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_ssl_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_ssl_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mail/ngx_mail_ssl_module.h =================================================================== --- branches/stable-1.0/src/mail/ngx_mail_ssl_module.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mail/ngx_mail_ssl_module.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/misc/ngx_google_perftools_module.c =================================================================== --- branches/stable-1.0/src/misc/ngx_google_perftools_module.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/misc/ngx_google_perftools_module.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mysql/ngx_http_mysql_test.c =================================================================== --- branches/stable-1.0/src/mysql/ngx_http_mysql_test.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mysql/ngx_http_mysql_test.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ #include Modified: branches/stable-1.0/src/mysql/ngx_mysql.c =================================================================== --- branches/stable-1.0/src/mysql/ngx_mysql.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mysql/ngx_mysql.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/mysql/ngx_mysql.h =================================================================== --- branches/stable-1.0/src/mysql/ngx_mysql.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/mysql/ngx_mysql.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_aio_read.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_aio_read.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_aio_read.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_aio_read_chain.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_aio_read_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_aio_read_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_aio_write.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_aio_write.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_aio_write.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_aio_write_chain.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_aio_write_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_aio_write_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_alloc.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_alloc.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_alloc.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_alloc.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_alloc.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_alloc.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_atomic.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_atomic.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_atomic.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_channel.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_channel.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_channel.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_channel.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_channel.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_channel.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_daemon.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_daemon.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_daemon.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_darwin.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_darwin.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_darwin.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_darwin_config.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_darwin_config.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_darwin_config.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_darwin_init.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_darwin_init.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_darwin_init.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_darwin_sendfile_chain.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_darwin_sendfile_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_darwin_sendfile_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_errno.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_errno.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_errno.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_errno.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_errno.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_errno.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_file_aio_read.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_file_aio_read.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_file_aio_read.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_files.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_files.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_files.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_files.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_files.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_files.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_freebsd.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_freebsd.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_freebsd.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_freebsd_config.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_freebsd_config.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_freebsd_config.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_freebsd_init.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_freebsd_init.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_freebsd_init.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_freebsd_rfork_thread.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_freebsd_rfork_thread.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_freebsd_rfork_thread.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_freebsd_rfork_thread.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_freebsd_rfork_thread.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_freebsd_rfork_thread.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_freebsd_sendfile_chain.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_freebsd_sendfile_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_freebsd_sendfile_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_gcc_atomic_amd64.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_gcc_atomic_amd64.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_gcc_atomic_amd64.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_gcc_atomic_ppc.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_gcc_atomic_ppc.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_gcc_atomic_ppc.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_gcc_atomic_sparc64.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_gcc_atomic_sparc64.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_gcc_atomic_sparc64.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_gcc_atomic_x86.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_gcc_atomic_x86.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_gcc_atomic_x86.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_linux.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_linux.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_linux.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_linux_aio_read.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_linux_aio_read.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_linux_aio_read.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_linux_config.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_linux_config.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_linux_config.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_linux_init.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_linux_init.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_linux_init.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_linux_sendfile_chain.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_linux_sendfile_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_linux_sendfile_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_os.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_os.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_os.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_posix_config.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_posix_config.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_posix_config.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_posix_init.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_posix_init.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_posix_init.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_process.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_process.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_process.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_process.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_process.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_process.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_process_cycle.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_process_cycle.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_process_cycle.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_process_cycle.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_process_cycle.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_process_cycle.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_pthread_thread.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_pthread_thread.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_pthread_thread.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_readv_chain.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_readv_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_readv_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_recv.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_recv.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_recv.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_send.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_send.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_send.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_setproctitle.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_setproctitle.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_setproctitle.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_setproctitle.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_setproctitle.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_setproctitle.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_shmem.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_shmem.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_shmem.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_shmem.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_shmem.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_shmem.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_socket.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_socket.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_socket.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_socket.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_socket.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_socket.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_solaris.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_solaris.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_solaris.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_solaris_config.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_solaris_config.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_solaris_config.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_solaris_init.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_solaris_init.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_solaris_init.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_solaris_sendfilev_chain.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_solaris_sendfilev_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_solaris_sendfilev_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_sunpro_amd64.il =================================================================== --- branches/stable-1.0/src/os/unix/ngx_sunpro_amd64.il 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_sunpro_amd64.il 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ / / Copyright (C) Igor Sysoev +/ Copyright (C) Nginx, Inc. / / ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock, Modified: branches/stable-1.0/src/os/unix/ngx_sunpro_atomic_sparc64.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_sunpro_atomic_sparc64.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_sunpro_atomic_sparc64.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_sunpro_sparc64.il =================================================================== --- branches/stable-1.0/src/os/unix/ngx_sunpro_sparc64.il 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_sunpro_sparc64.il 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ / / Copyright (C) Igor Sysoev +/ Copyright (C) Nginx, Inc. / Modified: branches/stable-1.0/src/os/unix/ngx_sunpro_x86.il =================================================================== --- branches/stable-1.0/src/os/unix/ngx_sunpro_x86.il 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_sunpro_x86.il 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ / / Copyright (C) Igor Sysoev +/ Copyright (C) Nginx, Inc. / / ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock, Modified: branches/stable-1.0/src/os/unix/ngx_thread.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_thread.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_thread.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_time.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_time.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_time.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_time.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_time.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_time.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_udp_recv.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_udp_recv.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_udp_recv.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_user.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_user.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_user.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_user.h =================================================================== --- branches/stable-1.0/src/os/unix/ngx_user.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_user.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/ngx_writev_chain.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_writev_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/ngx_writev_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/unix/rfork_thread.S =================================================================== --- branches/stable-1.0/src/os/unix/rfork_thread.S 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/unix/rfork_thread.S 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/nginx.rc =================================================================== --- branches/stable-1.0/src/os/win32/nginx.rc 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/nginx.rc 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ // Copyright (C) Igor Sysoev +// Copyright (C) Nginx, Inc. nginx icon discardable "src\\os\\win32\\nginx.ico" Modified: branches/stable-1.0/src/os/win32/ngx_alloc.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_alloc.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_alloc.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_alloc.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_alloc.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_alloc.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_atomic.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_atomic.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_atomic.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_errno.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_errno.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_errno.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_errno.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_errno.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_errno.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_event_log.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_event_log.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_event_log.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_files.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_files.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_files.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_files.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_files.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_files.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_os.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_os.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_os.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_process.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_process.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_process.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_process.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_process.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_process.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_process_cycle.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_process_cycle.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_process_cycle.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_process_cycle.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_process_cycle.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_process_cycle.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_service.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_service.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_service.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_shmem.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_shmem.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_shmem.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_shmem.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_shmem.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_shmem.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_socket.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_socket.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_socket.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_socket.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_socket.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_socket.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_stat.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_stat.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_stat.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_thread.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_thread.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_thread.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_thread.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_thread.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_thread.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_time.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_time.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_time.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_time.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_time.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_time.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_udp_wsarecv.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_udp_wsarecv.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_udp_wsarecv.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_user.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_user.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_user.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,5 +1,6 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_user.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_user.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_user.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_win32_config.h =================================================================== --- branches/stable-1.0/src/os/win32/ngx_win32_config.h 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_win32_config.h 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_win32_init.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_win32_init.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_win32_init.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_wsarecv.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_wsarecv.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_wsarecv.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_wsarecv_chain.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_wsarecv_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_wsarecv_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_wsasend.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_wsasend.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_wsasend.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ Modified: branches/stable-1.0/src/os/win32/ngx_wsasend_chain.c =================================================================== --- branches/stable-1.0/src/os/win32/ngx_wsasend_chain.c 2012-02-05 19:27:18 UTC (rev 4450) +++ branches/stable-1.0/src/os/win32/ngx_wsasend_chain.c 2012-02-05 20:02:59 UTC (rev 4451) @@ -1,6 +1,7 @@ /* * Copyright (C) Igor Sysoev + * Copyright (C) Nginx, Inc. */ From mdounin at mdounin.ru Sun Feb 5 20:05:12 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 20:05:12 +0000 Subject: [nginx] svn commit: r4452 - in branches/stable-1.0: . src/http src/os/unix Message-ID: <20120205200512.C851C3F9C6E@mail.nginx.com> Author: mdounin Date: 2012-02-05 20:05:11 +0000 (Sun, 05 Feb 2012) New Revision: 4452 Log: Merge of r4416: Fixed AIO error handling on FreeBSD. The aio_return() must be called regardless of the error returned by aio_error(). Not calling it resulted in various problems up to segmentation faults (as AIO events are level-triggered and were reported again and again). Additionally, in "aio sendfile" case r->blocked was incremented in case of error returned from ngx_file_aio_read(), thus causing request hangs. Modified: branches/stable-1.0/ branches/stable-1.0/src/http/ngx_http_copy_filter_module.c branches/stable-1.0/src/os/unix/ngx_file_aio_read.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4406,4413,4415 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4406,4413,4415-4416 Modified: branches/stable-1.0/src/http/ngx_http_copy_filter_module.c =================================================================== --- branches/stable-1.0/src/http/ngx_http_copy_filter_module.c 2012-02-05 20:02:59 UTC (rev 4451) +++ branches/stable-1.0/src/http/ngx_http_copy_filter_module.c 2012-02-05 20:05:11 UTC (rev 4452) @@ -190,7 +190,7 @@ rc = n; - if (file->aio) { + if (rc == NGX_AGAIN) { file->aio->data = r; file->aio->handler = ngx_http_copy_aio_sendfile_event_handler; Modified: branches/stable-1.0/src/os/unix/ngx_file_aio_read.c =================================================================== --- branches/stable-1.0/src/os/unix/ngx_file_aio_read.c 2012-02-05 20:02:59 UTC (rev 4451) +++ branches/stable-1.0/src/os/unix/ngx_file_aio_read.c 2012-02-05 20:05:11 UTC (rev 4452) @@ -157,24 +157,15 @@ return NGX_ERROR; } - if (n != 0) { - if (n == NGX_EINPROGRESS) { - if (ev->ready) { - ev->ready = 0; - ngx_log_error(NGX_LOG_ALERT, file->log, n, - "aio_read(\"%V\") still in progress", - &file->name); - } - - return NGX_AGAIN; + if (n == NGX_EINPROGRESS) { + if (ev->ready) { + ev->ready = 0; + ngx_log_error(NGX_LOG_ALERT, file->log, n, + "aio_read(\"%V\") still in progress", + &file->name); } - aio->err = n; - ev->ready = 0; - - ngx_log_error(NGX_LOG_CRIT, file->log, n, - "aio_read(\"%V\") failed", &file->name); - return NGX_ERROR; + return NGX_AGAIN; } n = aio_return(&aio->aiocb); @@ -182,9 +173,9 @@ if (n == -1) { err = ngx_errno; aio->err = err; - ev->ready = 0; + ev->ready = 1; - ngx_log_error(NGX_LOG_ALERT, file->log, err, + ngx_log_error(NGX_LOG_CRIT, file->log, err, "aio_return(\"%V\") failed", &file->name); return NGX_ERROR; } From mdounin at mdounin.ru Sun Feb 5 20:06:50 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sun, 5 Feb 2012 20:06:50 +0000 Subject: [nginx] svn commit: r4453 - in branches/stable-1.0: . src/event Message-ID: <20120205200650.E02A93F9C6E@mail.nginx.com> Author: mdounin Date: 2012-02-05 20:06:50 +0000 (Sun, 05 Feb 2012) New Revision: 4453 Log: Merge of r4422: Fixed error handling in ngx_event_connect_peer(). Previously if ngx_add_event() failed a connection was freed two times (once in the ngx_event_connect_peer(), and again by a caller) as pc->connection was left set. Fix is to always use ngx_close_connection() to close connection properly and set pc->connection to NULL on errors. Patch by Piotr Sikora. Modified: branches/stable-1.0/ branches/stable-1.0/src/event/ngx_event_connect.c Property changes on: branches/stable-1.0 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4406,4413,4415-4416 + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4406,4413,4415-4416,4422 Modified: branches/stable-1.0/src/event/ngx_event_connect.c =================================================================== --- branches/stable-1.0/src/event/ngx_event_connect.c 2012-02-05 20:05:11 UTC (rev 4452) +++ branches/stable-1.0/src/event/ngx_event_connect.c 2012-02-05 20:06:50 UTC (rev 4453) @@ -160,6 +160,9 @@ ngx_log_error(level, c->log, err, "connect() to %V failed", pc->name); + ngx_close_connection(c); + pc->connection = NULL; + return NGX_DECLINED; } } @@ -241,13 +244,9 @@ failed: - ngx_free_connection(c); + ngx_close_connection(c); + pc->connection = NULL; - if (ngx_close_socket(s) == -1) { - ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, - ngx_close_socket_n " failed"); - } - return NGX_ERROR; } From maxim at nginx.com Mon Feb 6 09:51:50 2012 From: maxim at nginx.com (Maxim Konovalov) Date: Mon, 06 Feb 2012 13:51:50 +0400 Subject: GSoC 2012 and SPDY In-Reply-To: References: Message-ID: <4F2FA2B6.9070000@nginx.com> Hello, On 2/5/12 3:37 PM, potworyk wrote: > Hi, > > I am wondering if nginx project have any plans to be mentoring > organization in current GSoC (Google Summer of Code)? It would be > great for project and for students like me. > > Personally I am currently doing research on SPDY protocol on > university. I've also read that nginx has done some research in > that area and as Mozilla added support for SPDY its going to be > hot topic again. I have to write some code as a part of my work > so I thought that I could do something for open source community > particularly nginx project and implement some basic SPDY > support. > > If you don't want SPDY, maybe there are other task for students? > Yes, it's probably a good idea. We don't have any plans there and really need to learn more about GSoC in general. Re SPDY: we have some plans for its support. Will release some news soon. -- Maxim Konovalov +7 (910) 4293178 http://nginx.com/ From jightuse at gmail.com Mon Feb 6 10:36:58 2012 From: jightuse at gmail.com (JIghtuse) Date: Mon, 6 Feb 2012 16:36:58 +0600 Subject: GSoC 2012 and SPDY In-Reply-To: <4F2FA2B6.9070000@nginx.com> References: <4F2FA2B6.9070000@nginx.com> Message-ID: On Mon, Feb 6, 2012 at 4:51 PM, Maxim Konovalov wrote: > Hello, > > > On 2/5/12 3:37 PM, potworyk wrote: > >> Hi, >> >> I am wondering if nginx project have any plans to be mentoring >> organization in current GSoC (Google Summer of Code)? It would be >> great for project and for students like me. >> >> Personally I am currently doing research on SPDY protocol on >> university. I've also read that nginx has done some research in >> that area and as Mozilla added support for SPDY its going to be >> hot topic again. I have to write some code as a part of my work >> so I thought that I could do something for open source community >> particularly nginx project and implement some basic SPDY >> support. >> >> If you don't want SPDY, maybe there are other task for students? >> >> Yes, it's probably a good idea. We don't have any plans there and > really need to learn more about GSoC in general. > > Re SPDY: we have some plans for its support. Will release some > news soon. > > -- > Maxim Konovalov > +7 (910) 4293178 > http://nginx.com/ > > > ______________________________**_________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/**mailman/listinfo/nginx-devel > Sorry for some offtop, but I'm interested too in Nginx to be mentoring organization. I have C programming skills and want to write some code for nginx. Are there some other ideas not realized yet? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon Feb 6 11:40:11 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Feb 2012 11:40:11 +0000 Subject: [nginx] svn commit: r4454 - branches/stable-1.0/misc Message-ID: <20120206114011.DC8C03F9C57@mail.nginx.com> Author: mdounin Date: 2012-02-06 11:40:10 +0000 (Mon, 06 Feb 2012) New Revision: 4454 Log: Updated libs used for win32 builds. Modified: branches/stable-1.0/misc/GNUmakefile Modified: branches/stable-1.0/misc/GNUmakefile =================================================================== --- branches/stable-1.0/misc/GNUmakefile 2012-02-05 20:06:50 UTC (rev 4453) +++ branches/stable-1.0/misc/GNUmakefile 2012-02-06 11:40:10 UTC (rev 4454) @@ -6,9 +6,9 @@ REPO = $(shell svn info | sed -n 's/^Repository Root: //p') OBJS = objs.msvc8 -OPENSSL = openssl-0.9.8r -ZLIB = zlib-1.2.3 -PCRE = pcre-7.9 +OPENSSL = openssl-0.9.8t +ZLIB = zlib-1.2.5 +PCRE = pcre-8.21 release: From mdounin at mdounin.ru Mon Feb 6 14:08:59 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Feb 2012 14:08:59 +0000 Subject: [nginx] svn commit: r4455 - branches/stable-1.0/docs/xml/nginx Message-ID: <20120206140859.8A0713F9C79@mail.nginx.com> Author: mdounin Date: 2012-02-06 14:08:59 +0000 (Mon, 06 Feb 2012) New Revision: 4455 Log: nginx-1.0.12-RELEASE Modified: branches/stable-1.0/docs/xml/nginx/changes.xml Modified: branches/stable-1.0/docs/xml/nginx/changes.xml =================================================================== --- branches/stable-1.0/docs/xml/nginx/changes.xml 2012-02-06 11:40:10 UTC (rev 4454) +++ branches/stable-1.0/docs/xml/nginx/changes.xml 2012-02-06 14:08:59 UTC (rev 4455) @@ -9,6 +9,204 @@ nginx changelog + + + + +????????? TLSv1.1 ? TLSv1.2 ? ????????? ssl_protocols. + + +the "TLSv1.1" and "TLSv1.2" parameters of the "ssl_protocols" directive. + + + + + +SSI ??????? if ???????????? ????????? ? ?????????? ??????????. + + +the "if" SSI command supports captures in regular expressions. + + + + + +SSI ??????? if ?? ???????? ?????? ??????? block. + + +the "if" SSI command did not work inside the "block" command. + + + + + +? ????????? ?????? ??? ????????????? AIO ?? FreeBSD. + + +in AIO error handling on FreeBSD. + + + + + +? ????????????? ?????????? OpenSSL. + + +in the OpenSSL library initialization. + + + + + +????????? worker_cpu_affinity ????? ?? ????????. + + +the "worker_cpu_affinity" directive might not work. + + + + + +????????? limit_conn_log_level ? limit_req_log_level ????? ?? ????????. + + +the "limit_conn_log_level" and "limit_req_log_level" directives might not work. + + + + + +????????? read_ahead ????? ?? ???????? ??? ????????????? ????????? ? +try_files ? open_file_cache. + + +the "read_ahead" directive might not work combined with "try_files" +and "open_file_cache". + + + + + +????????? proxy_cache_use_stale ? ?????????? error ?? ?????????? ????? ?? +????, ???? ??? ??????? ???? ???????? ?????????????. + + +the "proxy_cache_use_stale" directive with "error" parameter did not return +answer from cache if there were no live upstreams. + + + + + +???? ? ????????? inactive ????????? proxy_cache_path +???? ??????? ????? ?????, +? ??????? ???????? ??? ????????? segmentation fault. + + +a segmentation fault might occur in a worker process +if small time was used in the "inactive" parameter of +the "proxy_cache_path" directive. + + + + + +?????? ?? ???? ????? ????????. + + +responses from cache might hang. + + + + + +? ????????? ?????? ??? ?????????? ? ????????.
+??????? Piotr Sikora. +
+ +in error handling while connecting to a backend.
+Thanks to Piotr Sikora. +
+
+ + + +? ?????? epoll.
+??????? Yichun Zhang. +
+ +in the "epoll" event method.
+Thanks to Yichun Zhang. +
+
+ + + +?????????? $sent_http_cache_control ????? ????????? ???????? ???????? ??? +????????????? ????????? expires.
+??????? Yichun Zhang. +
+ +the $sent_http_cache_control variable might contain a wrong value if the +"expires" directive was used.
+Thanks to Yichun Zhang. +
+
+ + + +????????? limit_rate ?? ????????? ?????????? ?? ?????? ????????, +???? ???? ??? ?????? ????? ??????? ?????. + + +the "limit_rate" directive did not allow to use full throughput, +even if limit value was very high. + + + + + +????????? sendfile_max_chunk ?? ????????, +???? ?????????????? ????????? limit_rate. + + +the "sendfile_max_chunk" directive did not work, +if the "limit_rate" directive was used. + + + + + +nginx ?? ????????? ?? Solaris; +?????? ????????? ? 1.0.11. + + +nginx could not be built on Solaris; +the bug had appeared in 1.0.11. + + + + + +? ?????? ngx_http_scgi_module. + + +in the ngx_http_scgi_module. + + + + + +? ?????? ngx_http_mp4_module. + + +in the ngx_http_mp4_module. + + + +
+ + From mdounin at mdounin.ru Mon Feb 6 14:09:17 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Feb 2012 14:09:17 +0000 Subject: [nginx] svn commit: r4456 - in tags: . release-1.0.12 Message-ID: <20120206140917.1752D3F9D1E@mail.nginx.com> Author: mdounin Date: 2012-02-06 14:09:16 +0000 (Mon, 06 Feb 2012) New Revision: 4456 Log: release-1.0.12 tag Added: tags/release-1.0.12/ Property changes on: tags/release-1.0.12 ___________________________________________________________________ Added: svn:ignore + access.log client_body_temp fastcgi_temp proxy_temp GNUmakefile Makefile makefile nginx nginx.conf nginx-*.tar.gz objs* tmp Added: svn:mergeinfo + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4406,4413,4415-4416,4422 From l at lrowe.co.uk Wed Feb 8 01:03:27 2012 From: l at lrowe.co.uk (Laurence Rowe) Date: Wed, 8 Feb 2012 01:03:27 +0000 Subject: [PATCH] add xslt_stylesheet_param directive In-Reply-To: References: Message-ID: On 4 February 2012 16:47, SamB wrote: > Hello, > > ?? I've modified my patch, according to comments in > http://mailman.nginx.org/pipermail/nginx-devel/2012-January/001751.html. > > ?? Directive has been renamed to xslt_param, taking 2 parameters - name and > value separated (similarly to set directive), > ?? therefore it's now also possible to pass ':' character as it had been > requested before. > ?? I think it's better and easier to have it this way + there is no need to > do that ugly parsing in runtime ;) Great! Thanks for working on this. One other thing that occurs to me, it would be useful to be able to pass arbitrary string paramaters. Perhaps an xslt_string_param directive could also be added? XPath quoting gets complicated when a string contains both single and double quotes (see http://stackoverflow.com/questions/642125/encoding-xpath-expressions-with-both-single-and-double-quotes), so you should use http://xmlsoft.org/XSLT/html/libxslt-variables.html#xsltQuoteOneUserParam on those values. Laurence From ja.nginx at mailnull.com Wed Feb 8 12:55:47 2012 From: ja.nginx at mailnull.com (SamB) Date: Wed, 8 Feb 2012 13:55:47 +0100 Subject: [PATCH] add xslt_stylesheet_param directive In-Reply-To: References: Message-ID: Hi, I've added xslt_string_param and slightly changed parameter passing and transformation to make it work as expected. As a side effect of this change, might be usage of xslt_param/xslt_string_param faster, because params are directly inserted to transformation context and do not need to be copied to name/value parameter array that is passed to xsltApplyStylesheet() as it's now by parameters passed via xslt_stylesheet directive. Old parameter passing using xslt_stylesheet has not been changed to prevent unexpected behavior, maybe this can be modified later if this patch will prove to be stable... Sam On Wed, Feb 8, 2012 at 2:03 AM, Laurence Rowe wrote: > On 4 February 2012 16:47, SamB wrote: > > Hello, > > > > I've modified my patch, according to comments in > > http://mailman.nginx.org/pipermail/nginx-devel/2012-January/001751.html. > > > > Directive has been renamed to xslt_param, taking 2 parameters - name > and > > value separated (similarly to set directive), > > therefore it's now also possible to pass ':' character as it had been > > requested before. > > I think it's better and easier to have it this way + there is no need > to > > do that ugly parsing in runtime ;) > > Great! Thanks for working on this. One other thing that occurs to me, > it would be useful to be able to pass arbitrary string paramaters. > Perhaps an xslt_string_param directive could also be added? > > XPath quoting gets complicated when a string contains both single and > double quotes (see > > http://stackoverflow.com/questions/642125/encoding-xpath-expressions-with-both-single-and-double-quotes > ), > so you should use > http://xmlsoft.org/XSLT/html/libxslt-variables.html#xsltQuoteOneUserParam > on those values. > > Laurence > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx-1.1.13-xslt-params.patch Type: application/octet-stream Size: 9182 bytes Desc: not available URL: From lifeibo382005 at gmail.com Thu Feb 9 09:43:19 2012 From: lifeibo382005 at gmail.com (=?GB2312?B?wO63ybKq?=) Date: Thu, 9 Feb 2012 17:43:19 +0800 Subject: [PATCH] upstream process header data Message-ID: hello, I encountered a problem when I write a upstream module to process data from my upstream server. I set the header recv buffer to a small size that can not hold the whole response header. While in my process_header handler of my module, it will wait for the whole response header to process header, then return NGX_AGAIN and leave data in u->buffer not processed(in this case, u->buffer->pos < u->buffer->last). Then u->buffer->pos will never equal to u->buffer->end, and nginx will nerver log "upstream send too big header". This will cause nginx to call recv again with zero buffer size. I think this may be a problem, and I made a patch for that. Thinks, lizi -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx-1.0.12-upstream_read_header.patch Type: application/octet-stream Size: 449 bytes Desc: not available URL: From mdounin at mdounin.ru Thu Feb 9 11:12:36 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 9 Feb 2012 15:12:36 +0400 Subject: [PATCH] upstream process header data In-Reply-To: References: Message-ID: <20120209111236.GF67687@mdounin.ru> Hello! On Thu, Feb 09, 2012 at 05:43:19PM +0800, ??? wrote: > hello, > > I encountered a problem when I write a upstream module to process > data from my upstream server. > I set the header recv buffer to a small size that can not hold the > whole response header. While in my process_header handler of my > module, it will wait for the whole response header to process header, > then return NGX_AGAIN and leave data in u->buffer not processed(in > this case, u->buffer->pos < u->buffer->last). Then u->buffer->pos will > never equal to u->buffer->end, and nginx will nerver log "upstream > send too big header". This will cause nginx to call recv again with > zero buffer size. > I think this may be a problem, and I made a patch for that. Looks like valid problem and correct patch for me. In vanilla nginx this currently affects at least memcached module. If memcached_buffer set to low value, it causes [error] ... upstream prematurely closed connection while reading response header from upstream ... to be logged instead of correct [error] ... upstream sent too big header while reading response header from upstream ... Could you please provide English transcription of your name you would like to see in CHANGES? Is "Li Feibo" looks ok? Maxim Dounin From mdounin at mdounin.ru Thu Feb 9 16:18:03 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Thu, 9 Feb 2012 16:18:03 +0000 Subject: [nginx] svn commit: r4457 - in trunk/src: core http/modules/perl Message-ID: <20120209161803.206B73F9CFD@mail.nginx.com> Author: mdounin Date: 2012-02-09 16:18:02 +0000 (Thu, 09 Feb 2012) New Revision: 4457 Log: Version bump. Modified: trunk/src/core/nginx.h trunk/src/http/modules/perl/nginx.pm Modified: trunk/src/core/nginx.h =================================================================== --- trunk/src/core/nginx.h 2012-02-06 14:09:16 UTC (rev 4456) +++ trunk/src/core/nginx.h 2012-02-09 16:18:02 UTC (rev 4457) @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1001014 -#define NGINX_VERSION "1.1.14" +#define nginx_version 1001015 +#define NGINX_VERSION "1.1.15" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" Modified: trunk/src/http/modules/perl/nginx.pm =================================================================== --- trunk/src/http/modules/perl/nginx.pm 2012-02-06 14:09:16 UTC (rev 4456) +++ trunk/src/http/modules/perl/nginx.pm 2012-02-09 16:18:02 UTC (rev 4457) @@ -48,7 +48,7 @@ HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '1.1.14'; +our $VERSION = '1.1.15'; require XSLoader; XSLoader::load('nginx', $VERSION); From mdounin at mdounin.ru Thu Feb 9 17:47:03 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 9 Feb 2012 21:47:03 +0400 Subject: Patch for nginx handling of X-Accel-Redirect URLs In-Reply-To: <9a6b12669e6851d01405a18506920feb@yourcmc.ru> References: <8b6059000146223e8d811ef594799638@yourcmc.ru> <20120201003141.GS67687@mdounin.ru> <5f518c78-7223-4f42-b304-b759b04bd240@email.android.com> <20120201143812.GW67687@mdounin.ru> <9a6b12669e6851d01405a18506920feb@yourcmc.ru> Message-ID: <20120209174702.GN67687@mdounin.ru> Hello! On Thu, Feb 02, 2012 at 03:27:27AM +0400, vitalif at yourcmc.ru wrote: > A new version of patch, unescaping in ngx_http_parse_unsafe_uri()... > Note that it required removing if (ch == ?) blocks that come AFTER > decoding the character (I don't understand their purpose, they seem > incorrect, as escaped '?' does not mean the beginning of query > string). > And I still don't understand what NGX_UNESCAPE_REDIRECT is... :-) > This is a patch for nginx 1.1.12 handling of X-Accel-Redirect URLs: > allow to handle percent-encoded URLs and complex filenames in X-Accel-Redirect > (for example, filenames which contain '?'). > > --- a/src/core/ngx_string.c 2011-11-25 20:36:02.000000000 +0400 > +++ b/src/core/ngx_string.c 2012-02-02 03:21:46.153704057 +0400 > @@ -1590,21 +1590,11 @@ ngx_unescape_uri(u_char **dst, u_char ** > ch = (u_char) ((decoded << 4) + c - 'a' + 10); > > if (type & NGX_UNESCAPE_URI) { > - if (ch == '?') { > - *d++ = ch; > - goto done; > - } > - This looks like a correct change. > *d++ = ch; > break; > } > > if (type & NGX_UNESCAPE_REDIRECT) { > - if (ch == '?') { > - *d++ = ch; > - goto done; > - } > - This is not correct, as this will break current behaviour of redirect unescaping. Unless you are willing to work on it in general, please don't touch it. In any case this should be a separate patch. > if (ch > '%' && ch < 0x7f) { > *d++ = ch; > break; > --- a/src/http/ngx_http_parse.c 2011-11-28 13:15:33.000000000 +0400 > +++ b/src/http/ngx_http_parse.c 2012-02-02 03:18:42.561709398 +0400 > @@ -1591,7 +1591,7 @@ ngx_int_t > ngx_http_parse_unsafe_uri(ngx_http_request_t *r, ngx_str_t *uri, > ngx_str_t *args, ngx_uint_t *flags) > { > - u_char ch, *p; > + u_char ch, *p, *src, *dst; > size_t len; > > len = uri->len; > @@ -1605,6 +1605,23 @@ ngx_http_parse_unsafe_uri(ngx_http_reque > goto unsafe; > } > > + /* unescape URI */ > + > + if (ngx_strchr(p, '%')) { This isn't a good idea to assume uri is null-terminated. > + > + dst = uri->data; > + src = uri->data; > + > + ngx_unescape_uri(&dst, &src, uri->len, NGX_UNESCAPE_URI); And it may not be good idea to assume uri->data is writable. > + > + len = (uri->data + uri->len) - src; > + if (len) { > + dst = ngx_copy(dst, src, len); > + } > + > + uri->len = dst - uri->data; > + } > + > for ( /* void */ ; len; len--) { > > ch = *p++; This also needs changes at least in ssi module, which currently does unescaping itself. The dav module needs some attention too, as this change will affect it and it should be made clear it doesn't break things. Maxim Dounin From mdounin at mdounin.ru Thu Feb 9 23:12:13 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 10 Feb 2012 03:12:13 +0400 Subject: [PATCH] add xslt_stylesheet_param directive In-Reply-To: References: Message-ID: <20120209231213.GQ67687@mdounin.ru> Hello! On Wed, Feb 08, 2012 at 01:55:47PM +0100, SamB wrote: > Hi, > > I've added xslt_string_param and slightly changed parameter passing and > transformation > to make it work as expected. > As a side effect of this change, might be usage of > xslt_param/xslt_string_param faster, > because params are directly inserted to transformation context and do > not need to be > copied to name/value parameter array that is passed to > xsltApplyStylesheet() as it's now > by parameters passed via xslt_stylesheet directive. > > Old parameter passing using xslt_stylesheet has not been changed to > prevent unexpected behavior, > maybe this can be modified later if this patch will prove to be stable... This looks intresting, though may be it would be better to finish and commit the xslt_param patch first (see another message for a review). Below is review of the xslt_param + xslt_string_param patch specific bits. [...] > diff -ur nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c > --- nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c 2010-07-12 14:52:01.000000000 +0200 > +++ nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c 2012-02-08 13:34:43.000000000 +0100 > @@ -10,6 +10,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -48,6 +49,8 @@ > ngx_array_t sheets; /* ngx_http_xslt_sheet_t */ > ngx_hash_t types; > ngx_array_t *types_keys; > + ngx_array_t string_params; /* ngx_http_complex_value_t */ > + ngx_array_t params; /* ngx_http_complex_value_t */ I would like to see single "params" array instead, with both string params and xpath ones. [...] > @@ -84,6 +90,13 @@ > void *conf); > static char *ngx_http_xslt_stylesheet(ngx_conf_t *cf, ngx_command_t *cmd, > void *conf); > +static char *ngx_http_xslt_add_param(ngx_conf_t *cf, ngx_command_t *cmd, > + ngx_array_t *params); > +static char *ngx_http_xslt_stylesheet_param(ngx_conf_t *cf, ngx_command_t *cmd, > + void *conf); > +static char *ngx_http_xslt_stylesheet_string_param(ngx_conf_t *cf, > + ngx_command_t *cmd, > + void *conf); There is no need for 3 functions here. Just one is enough. In your current code, you may (and probably have to) use "offset" field of the command structure to pass offset of array you want to work with. With single params array as suggested earlier - you may use "post" field to distinguish string and non-string versions. > static void ngx_http_xslt_cleanup_dtd(void *data); > static void ngx_http_xslt_cleanup_stylesheet(void *data); > static void *ngx_http_xslt_filter_create_main_conf(ngx_conf_t *cf); > @@ -116,6 +129,20 @@ > 0, > NULL }, > > + { ngx_string("xslt_param"), > + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, > + ngx_http_xslt_stylesheet_param, > + NGX_HTTP_LOC_CONF_OFFSET, > + 0, > + NULL }, > + > + { ngx_string("xslt_string_param"), > + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, > + ngx_http_xslt_stylesheet_string_param, > + NGX_HTTP_LOC_CONF_OFFSET, > + 0, > + NULL }, > + > { ngx_string("xslt_types"), > NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, > ngx_http_types_slot, > @@ -450,6 +477,7 @@ > ngx_uint_t i; > xmlChar *buf; > xmlDocPtr doc, res; > + xsltTransformContextPtr xctxt; In libxslt this is usually called "ctxt", I think we should follow. > ngx_http_xslt_sheet_t *sheet; > ngx_http_xslt_filter_loc_conf_t *conf; > > @@ -468,14 +496,28 @@ > > for (i = 0; i < conf->sheets.nelts; i++) { > > - if (ngx_http_xslt_params(r, ctx, &sheet[i].params) != NGX_OK) { > + xctxt = xsltNewTransformContext(sheet[i].stylesheet, doc); > + if (xctxt == NULL) { > xmlFreeDoc(doc); > return NULL; > } > > - res = xsltApplyStylesheet(sheet[i].stylesheet, doc, ctx->params.elts); > + xctxt->initialContextDoc = doc; > + xctxt->initialContextNode = (xmlNodePtr) doc; According to http://xmlsoft.org/XSLT/html/libxslt-xsltInternals.html this is internal to libxslt, and using it may not be a good idea. Are you sure it's needed? As far as I can see in sources, it's ceratainly *not* needed for xsltQuoteOneUserParam(). Not sure about xsltEvalOneUserParam(). > + > + if (ngx_http_xslt_params(r, ctx, conf, xctxt, > + &sheet[i].params) != NGX_OK) { > + xmlFreeDoc(doc); > + xsltFreeTransformContext(xctxt); It may be a good idea to free this in reverse order, i.e. transformation context first. > + return NULL; > + } > + > + res = xsltApplyStylesheetUser(sheet[i].stylesheet, doc, > + ctx->params.elts, > + NULL, NULL, xctxt); > > xmlFreeDoc(doc); > + xsltFreeTransformContext(xctxt); Same here. > > if (res == NULL) { > ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, > @@ -564,14 +606,92 @@ [...] Maxim Dounin From mdounin at mdounin.ru Thu Feb 9 23:12:21 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 10 Feb 2012 03:12:21 +0400 Subject: [PATCH] add xslt_stylesheet_param directive In-Reply-To: References: Message-ID: <20120209231221.GR67687@mdounin.ru> Hello! On Sat, Feb 04, 2012 at 05:47:10PM +0100, SamB wrote: > Hello, > > I've modified my patch, according to comments in > http://mailman.nginx.org/pipermail/nginx-devel/2012-January/001751.html. > > Directive has been renamed to xslt_param, taking 2 parameters - name and > value separated (similarly to set directive), > therefore it's now also possible to pass ':' character as it had been > requested before. > I think it's better and easier to have it this way + there is no need to > do that ugly parsing in runtime ;) Overall looks good, thank you for your work (and sorry for late reply). See below for some more mostly minor comments. I think we want to commit this version for now, not the one with xslt_string_param, as the one with xslt_string_param scares me a bit due to use of internal xslt structures. See reply there for details. And could you please provide your name for CHANGES? [...] > diff -ur nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c > --- nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c 2010-07-12 14:52:01.000000000 +0200 > +++ nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c 2012-02-04 17:24:38.000000000 +0100 > @@ -48,6 +48,7 @@ > ngx_array_t sheets; /* ngx_http_xslt_sheet_t */ > ngx_hash_t types; > ngx_array_t *types_keys; > + ngx_array_t params; /* ngx_http_complex_value_t */ Using additional type with both name and value combined should be better. And we probably want to use pointer here, i.e. ngx_array_t *params; to simplify inheritance, see below. > } ngx_http_xslt_filter_loc_conf_t; > > > @@ -75,7 +76,9 @@ > static ngx_buf_t *ngx_http_xslt_apply_stylesheet(ngx_http_request_t *r, > ngx_http_xslt_filter_ctx_t *ctx); > static ngx_int_t ngx_http_xslt_params(ngx_http_request_t *r, > - ngx_http_xslt_filter_ctx_t *ctx, ngx_array_t *params); > + ngx_http_xslt_filter_ctx_t *ctx, > + const ngx_http_xslt_filter_loc_conf_t *conf, > + ngx_array_t *params); We don't generally use "const". If we will, it should be used consistently over code - marking just one of the arguments as "const" is misleading. Please leave it for now. > static u_char *ngx_http_xslt_content_type(xsltStylesheetPtr s); > static u_char *ngx_http_xslt_encoding(xsltStylesheetPtr s); > static void ngx_http_xslt_cleanup(void *data); > @@ -84,6 +87,8 @@ > void *conf); > static char *ngx_http_xslt_stylesheet(ngx_conf_t *cf, ngx_command_t *cmd, > void *conf); > +static char *ngx_http_xslt_stylesheet_param(ngx_conf_t *cf, ngx_command_t *cmd, > + void *conf); In should be named ngx_http_xslt_param(), there is no need for "stylesheet" here. > static void ngx_http_xslt_cleanup_dtd(void *data); > static void ngx_http_xslt_cleanup_stylesheet(void *data); > static void *ngx_http_xslt_filter_create_main_conf(ngx_conf_t *cf); > @@ -116,6 +121,13 @@ > 0, > NULL }, > > + { ngx_string("xslt_param"), > + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, > + ngx_http_xslt_stylesheet_param, > + NGX_HTTP_LOC_CONF_OFFSET, > + 0, > + NULL }, > + > { ngx_string("xslt_types"), > NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, > ngx_http_types_slot, > @@ -468,7 +480,7 @@ > > for (i = 0; i < conf->sheets.nelts; i++) { > > - if (ngx_http_xslt_params(r, ctx, &sheet[i].params) != NGX_OK) { > + if (ngx_http_xslt_params(r, ctx, conf, &sheet[i].params) != NGX_OK) { Passing conf isn't really needed as it may be obtained within ngx_http_xslt_params() function from request. > xmlFreeDoc(doc); > return NULL; > } > @@ -564,7 +576,7 @@ > > static ngx_int_t > ngx_http_xslt_params(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t *ctx, > - ngx_array_t *params) > + const ngx_http_xslt_filter_loc_conf_t *conf, ngx_array_t *params) > { > u_char *p, *last, *value, *dst, *src, **s; > size_t len; > @@ -572,6 +584,47 @@ > ngx_str_t string; > ngx_http_complex_value_t *param; > > + /* location params */ > + param = conf->params.elts; Style nitpicking: Blank line after comment, please. > + > + for (i = 0; i < conf->params.nelts; i++) { > + > + if (ngx_http_complex_value(r, ¶m[i], &string) != NGX_OK) { > + return NGX_ERROR; > + } > + > + value = string.data; > + len = string.len; > + > + if ((i & 1) == 0) { > + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, > + "xslt filter param name: \"%s\"", string.data); > + } else { Style nitpicking: Blank line before "} else {", please. Though this is probably irrelevant, as I suggested to change the code to use custom type instead, and this if() will go away. > + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, > + "xslt filter param value: \"%s\"", string.data); > + > + dst = value; > + src = value; > + > + ngx_unescape_uri(&dst, &src, len, 0); > + > + *dst = '\0'; > + > + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, > + "xslt filter param unescaped: \"%s\"", value); > + } > + > + p = string.data; > + > + s = ngx_array_push(&ctx->params); > + if (s == NULL) { > + return NGX_ERROR; > + } > + > + *s = value; > + } > + > + /* per-stylesheet params */ > param = params->elts; > > for (i = 0; i < params->nelts; i++) { > @@ -865,6 +918,51 @@ > } > > > +static char * > +ngx_http_xslt_stylesheet_param(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) > +{ > + ngx_http_xslt_filter_loc_conf_t *xlcf = conf; > + > + ngx_uint_t i; > + ngx_http_complex_value_t *param; > + ngx_http_compile_complex_value_t ccv; > + ngx_str_t *value; > + > + value = cf->args->elts; > + > + /* alloc array */ This comment looks redundant. > + if (xlcf->params.elts == NULL) { > + if (ngx_array_init(&xlcf->params, cf->pool, 2, > + sizeof(ngx_http_complex_value_t)) > + != NGX_OK) Just a note: this will be ngx_array_create() instead with a pointer, as suggested above. Something like this: if (xlcf->params == NULL) { xlcf->params = ngx_array_create(cf->pool, 2, sizeof(ngx_http_xslt_param_t)); if (xlcf->params == NULL) { return NGX_CONF_ERROR; } } > + { > + return NGX_CONF_ERROR; > + } > + } > + > + for (i = 1; i <= 2; i++) { > + > + param = ngx_array_push(&xlcf->params); > + if (param == NULL) { > + return NGX_CONF_ERROR; > + } > + > + ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); > + > + ccv.cf = cf; > + ccv.value = &value[i]; > + ccv.complex_value = param; > + ccv.zero = 1; > + > + if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { > + return NGX_CONF_ERROR; > + } > + } I don't think we want to support variables within param name. It would be better to leave it as static string. > + > + return NGX_CONF_OK; > +} > + > + > static void > ngx_http_xslt_cleanup_dtd(void *data) > { > @@ -944,6 +1042,10 @@ > conf->sheets = prev->sheets; > } > > + if (conf->params.elts == 0) { > + conf->params = prev->params; > + } This will be if (conf->params == NULL) { conf->params = prev->params; } And please also add conf->params = NULL; into comment in ngx_http_xslt_filter_create_conf() to clarify how it's initialized. > + > if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types, > &prev->types_keys, &prev->types, > ngx_http_xslt_default_types) Maxim Dounin From lifeibo382005 at gmail.com Fri Feb 10 01:56:29 2012 From: lifeibo382005 at gmail.com (=?GB2312?B?wO63ybKq?=) Date: Fri, 10 Feb 2012 09:56:29 +0800 Subject: [PATCH] upstream process header data In-Reply-To: <20120209111236.GF67687@mdounin.ru> References: <20120209111236.GF67687@mdounin.ru> Message-ID: Hi, Thanks for your response, "Feibo Li" js just ok!! lizi 2012/2/9 Maxim Dounin : > Hello! > > On Thu, Feb 09, 2012 at 05:43:19PM +0800, ??? wrote: > >> hello, >> >> I encountered a problem when I write a upstream module to process >> data from my upstream server. >> I set the header recv buffer to a small size that can not hold the >> whole response header. While in my process_header handler of my >> module, it will wait for the whole response header to process header, >> then return NGX_AGAIN and leave data in u->buffer not processed(in >> this case, u->buffer->pos < u->buffer->last). Then u->buffer->pos will >> never equal to u->buffer->end, and nginx will nerver log "upstream >> send too big header". This will cause nginx to call recv again with >> zero buffer size. >> I think this may be a problem, and I made a patch for that. > > Looks like valid problem and correct patch for me. In vanilla > nginx this currently affects at least memcached module. If > memcached_buffer set to low value, it causes > > [error] ... upstream prematurely closed connection while reading > response header from upstream ... > > to be logged instead of correct > > [error] ... upstream sent too big header while reading response > header from upstream ... > > Could you please provide English transcription of your name you > would like to see in CHANGES? Is "Li Feibo" looks ok? > > Maxim Dounin > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From vbart at nginx.com Fri Feb 10 09:56:38 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Fri, 10 Feb 2012 09:56:38 +0000 Subject: [nginx] svn commit: r4458 - trunk/src/http Message-ID: Author: vbart Date: 2012-02-10 09:56:37 +0000 (Fri, 10 Feb 2012) New Revision: 4458 Modified: trunk/src/http/ngx_http_request.h Log: Fixed module name in comment. It was forgotten in r4281. Modified: trunk/src/http/ngx_http_request.h =================================================================== --- trunk/src/http/ngx_http_request.h 2012-02-09 16:18:02 UTC (rev 4457) +++ trunk/src/http/ngx_http_request.h 2012-02-10 09:56:37 UTC (rev 4458) @@ -478,7 +478,7 @@ /* * instead of using the request context data in - * ngx_http_limit_zone_module and ngx_http_limit_req_module + * ngx_http_limit_conn_module and ngx_http_limit_req_module * we use the single bits in the request structure */ unsigned limit_conn_set:1; From vbart at nginx.com Fri Feb 10 10:48:58 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Fri, 10 Feb 2012 10:48:58 +0000 Subject: [nginx] svn commit: r4459 - trunk/src/http/modules Message-ID: Author: vbart Date: 2012-02-10 10:48:58 +0000 (Fri, 10 Feb 2012) New Revision: 4459 Modified: trunk/src/http/modules/ngx_http_limit_conn_module.c Log: Limit conn: returned to the old behavior of using the first actual limit on the way. It was unintentionally changed in r4272, so that it could only limit the first location where the processing of the request has reached PREACCESS phase. Modified: trunk/src/http/modules/ngx_http_limit_conn_module.c =================================================================== --- trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-02-10 09:56:37 UTC (rev 4458) +++ trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-02-10 10:48:58 UTC (rev 4459) @@ -159,8 +159,6 @@ return NGX_DECLINED; } - r->main->limit_conn_set = 1; - lccf = ngx_http_get_module_loc_conf(r, ngx_http_limit_conn_module); limits = lccf->limits.elts; @@ -187,6 +185,8 @@ continue; } + r->main->limit_conn_set = 1; + hash = ngx_crc32_short(vv->data, len); shpool = (ngx_slab_pool_t *) limits[i].shm_zone->shm.addr; From vbart at nginx.com Fri Feb 10 11:24:20 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Fri, 10 Feb 2012 11:24:20 +0000 Subject: [nginx] svn commit: r4460 - in trunk: auto src/os/unix Message-ID: Author: vbart Date: 2012-02-10 11:24:19 +0000 (Fri, 10 Feb 2012) New Revision: 4460 Modified: trunk/auto/unix trunk/src/os/unix/ngx_posix_init.c Log: Added ngx_ncpu detection for most *nix platforms. This inaccurate detection by using sysconf(_SC_NPROCESSORS_ONLN) can improve usage of the mutex lock optimization on multicore systems. Modified: trunk/auto/unix =================================================================== --- trunk/auto/unix 2012-02-10 10:48:58 UTC (rev 4459) +++ trunk/auto/unix 2012-02-10 11:24:19 UTC (rev 4460) @@ -721,3 +721,13 @@ ngx_feature_libs= ngx_feature_test="struct dirent dir; dir.d_type = DT_REG" . auto/feature + + +ngx_feature="sysconf(_SC_NPROCESSORS_ONLN)" +ngx_feature_name="NGX_HAVE_SC_NPROCESSORS_ONLN" +ngx_feature_run=no +ngx_feature_incs= +ngx_feature_path= +ngx_feature_libs= +ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)" +. auto/feature Modified: trunk/src/os/unix/ngx_posix_init.c =================================================================== --- trunk/src/os/unix/ngx_posix_init.c 2012-02-10 10:48:58 UTC (rev 4459) +++ trunk/src/os/unix/ngx_posix_init.c 2012-02-10 11:24:19 UTC (rev 4460) @@ -47,7 +47,13 @@ for (n = ngx_pagesize; n >>= 1; ngx_pagesize_shift++) { /* void */ } +#if (NGX_HAVE_SC_NPROCESSORS_ONLN) if (ngx_ncpu == 0) { + ngx_ncpu = sysconf(_SC_NPROCESSORS_ONLN); + } +#endif + + if (ngx_ncpu < 1) { ngx_ncpu = 1; } From mdounin at mdounin.ru Fri Feb 10 14:31:04 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Fri, 10 Feb 2012 14:31:04 +0000 Subject: [nginx] svn commit: r4461 - trunk/src/http Message-ID: <20120210143104.4B51A3F9C55@mail.nginx.com> Author: mdounin Date: 2012-02-10 14:31:04 +0000 (Fri, 10 Feb 2012) New Revision: 4461 Log: Upstream: fixed "too big header" check. If header filter postponed processing of a header by returning NGX_AGAIN and not moved u->buffer->pos, previous check incorrectly assumed there is additional space and did another recv() with zero-size buffer. This resulted in "upstream prematurely closed connection" error instead of correct "upstream sent too big header" one. Patch by Feibo Li. Modified: trunk/src/http/ngx_http_upstream.c Modified: trunk/src/http/ngx_http_upstream.c =================================================================== --- trunk/src/http/ngx_http_upstream.c 2012-02-10 11:24:19 UTC (rev 4460) +++ trunk/src/http/ngx_http_upstream.c 2012-02-10 14:31:04 UTC (rev 4461) @@ -1591,7 +1591,7 @@ if (rc == NGX_AGAIN) { - if (u->buffer.pos == u->buffer.end) { + if (u->buffer.last == u->buffer.end) { ngx_log_error(NGX_LOG_ERR, c->log, 0, "upstream sent too big header"); From mdounin at mdounin.ru Fri Feb 10 14:32:24 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 10 Feb 2012 18:32:24 +0400 Subject: [PATCH] upstream process header data In-Reply-To: References: <20120209111236.GF67687@mdounin.ru> Message-ID: <20120210143224.GA67687@mdounin.ru> Hello! On Fri, Feb 10, 2012 at 09:56:29AM +0800, ??? wrote: > Hi, > > Thanks for your response, "Feibo Li" js just ok!! Committed, thanks. Maxim Dounin > > > lizi > > 2012/2/9 Maxim Dounin : > > Hello! > > > > On Thu, Feb 09, 2012 at 05:43:19PM +0800, ??? wrote: > > > >> hello, > >> > >> I encountered a problem when I write a upstream module to process > >> data from my upstream server. > >> I set the header recv buffer to a small size that can not hold the > >> whole response header. While in my process_header handler of my > >> module, it will wait for the whole response header to process header, > >> then return NGX_AGAIN and leave data in u->buffer not processed(in > >> this case, u->buffer->pos < u->buffer->last). Then u->buffer->pos will > >> never equal to u->buffer->end, and nginx will nerver log "upstream > >> send too big header". This will cause nginx to call recv again with > >> zero buffer size. > >> I think this may be a problem, and I made a patch for that. > > > > Looks like valid problem and correct patch for me. In vanilla > > nginx this currently affects at least memcached module. If > > memcached_buffer set to low value, it causes > > > > [error] ... upstream prematurely closed connection while reading > > response header from upstream ... > > > > to be logged instead of correct > > > > [error] ... upstream sent too big header while reading response > > header from upstream ... > > > > Could you please provide English transcription of your name you > > would like to see in CHANGES? Is "Li Feibo" looks ok? > > > > Maxim Dounin > > > > _______________________________________________ > > nginx-devel mailing list > > nginx-devel at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx-devel > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From ja.nginx at mailnull.com Fri Feb 10 17:00:48 2012 From: ja.nginx at mailnull.com (SamB) Date: Fri, 10 Feb 2012 18:00:48 +0100 Subject: [PATCH] add xslt_stylesheet_param directive In-Reply-To: <20120209231221.GR67687@mdounin.ru> References: <20120209231221.GR67687@mdounin.ru> Message-ID: Hi, ok On Fri, Feb 10, 2012 at 12:12 AM, Maxim Dounin wrote: > Hello! > > On Sat, Feb 04, 2012 at 05:47:10PM +0100, SamB wrote: > > > Hello, > > > > I've modified my patch, according to comments in > > http://mailman.nginx.org/pipermail/nginx-devel/2012-January/001751.html. > > > > Directive has been renamed to xslt_param, taking 2 parameters - name > and > > value separated (similarly to set directive), > > therefore it's now also possible to pass ':' character as it had been > > requested before. > > I think it's better and easier to have it this way + there is no need > to > > do that ugly parsing in runtime ;) > > Overall looks good, thank you for your work (and sorry for late > reply). See below for some more mostly minor comments. > > I think we want to commit this version for now, not the one with > xslt_string_param, as the one with xslt_string_param scares me a > bit due to use of internal xslt structures. See reply there for > details. > > And could you please provide your name for CHANGES? > > > [...] > > > diff -ur nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c > nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c > > --- nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c > 2010-07-12 14:52:01.000000000 +0200 > > +++ nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c > 2012-02-04 17:24:38.000000000 +0100 > > @@ -48,6 +48,7 @@ > > ngx_array_t sheets; /* ngx_http_xslt_sheet_t */ > > ngx_hash_t types; > > ngx_array_t *types_keys; > > + ngx_array_t params; /* ngx_http_complex_value_t */ > > Using additional type with both name and value combined should be > better. > > And we probably want to use pointer here, i.e. > > ngx_array_t *params; > > to simplify inheritance, see below. > > > } ngx_http_xslt_filter_loc_conf_t; > > > > > > @@ -75,7 +76,9 @@ > > static ngx_buf_t *ngx_http_xslt_apply_stylesheet(ngx_http_request_t *r, > > ngx_http_xslt_filter_ctx_t *ctx); > > static ngx_int_t ngx_http_xslt_params(ngx_http_request_t *r, > > - ngx_http_xslt_filter_ctx_t *ctx, ngx_array_t *params); > > + ngx_http_xslt_filter_ctx_t *ctx, > > + const ngx_http_xslt_filter_loc_conf_t *conf, > > + ngx_array_t *params); > > We don't generally use "const". If we will, it should be used > consistently over code - marking just one of the arguments as > "const" is misleading. Please leave it for now. > > > static u_char *ngx_http_xslt_content_type(xsltStylesheetPtr s); > > static u_char *ngx_http_xslt_encoding(xsltStylesheetPtr s); > > static void ngx_http_xslt_cleanup(void *data); > > @@ -84,6 +87,8 @@ > > void *conf); > > static char *ngx_http_xslt_stylesheet(ngx_conf_t *cf, ngx_command_t > *cmd, > > void *conf); > > +static char *ngx_http_xslt_stylesheet_param(ngx_conf_t *cf, > ngx_command_t *cmd, > > + void *conf); > > In should be named ngx_http_xslt_param(), there is no need for > "stylesheet" here. > > > static void ngx_http_xslt_cleanup_dtd(void *data); > > static void ngx_http_xslt_cleanup_stylesheet(void *data); > > static void *ngx_http_xslt_filter_create_main_conf(ngx_conf_t *cf); > > @@ -116,6 +121,13 @@ > > 0, > > NULL }, > > > > + { ngx_string("xslt_param"), > > + > NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, > > + ngx_http_xslt_stylesheet_param, > > + NGX_HTTP_LOC_CONF_OFFSET, > > + 0, > > + NULL }, > > + > > { ngx_string("xslt_types"), > > > NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, > > ngx_http_types_slot, > > @@ -468,7 +480,7 @@ > > > > for (i = 0; i < conf->sheets.nelts; i++) { > > > > - if (ngx_http_xslt_params(r, ctx, &sheet[i].params) != NGX_OK) { > > + if (ngx_http_xslt_params(r, ctx, conf, &sheet[i].params) != > NGX_OK) { > > Passing conf isn't really needed as it may be obtained within > ngx_http_xslt_params() function from request. > > > xmlFreeDoc(doc); > > return NULL; > > } > > @@ -564,7 +576,7 @@ > > > > static ngx_int_t > > ngx_http_xslt_params(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t > *ctx, > > - ngx_array_t *params) > > + const ngx_http_xslt_filter_loc_conf_t *conf, ngx_array_t *params) > > { > > u_char *p, *last, *value, *dst, *src, **s; > > size_t len; > > @@ -572,6 +584,47 @@ > > ngx_str_t string; > > ngx_http_complex_value_t *param; > > > > + /* location params */ > > + param = conf->params.elts; > > Style nitpicking: > Blank line after comment, please. > > > + > > + for (i = 0; i < conf->params.nelts; i++) { > > + > > + if (ngx_http_complex_value(r, ¶m[i], &string) != NGX_OK) { > > + return NGX_ERROR; > > + } > > + > > + value = string.data; > > + len = string.len; > > + > > + if ((i & 1) == 0) { > > + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, > > + "xslt filter param name: \"%s\"", > string.data); > > + } else { > > Style nitpicking: > Blank line before "} else {", please. > > Though this is probably irrelevant, as I suggested to change the > code to use custom type instead, and this if() will go away. > > > + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, > > + "xslt filter param value: \"%s\"", > string.data); > > + > > + dst = value; > > + src = value; > > + > > + ngx_unescape_uri(&dst, &src, len, 0); > > + > > + *dst = '\0'; > > + > > + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, > > + "xslt filter param unescaped: \"%s\"", > value); > > + } > > + > > + p = string.data; > > + > > + s = ngx_array_push(&ctx->params); > > + if (s == NULL) { > > + return NGX_ERROR; > > + } > > + > > + *s = value; > > + } > > + > > + /* per-stylesheet params */ > > param = params->elts; > > > > for (i = 0; i < params->nelts; i++) { > > @@ -865,6 +918,51 @@ > > } > > > > > > +static char * > > +ngx_http_xslt_stylesheet_param(ngx_conf_t *cf, ngx_command_t *cmd, void > *conf) > > +{ > > + ngx_http_xslt_filter_loc_conf_t *xlcf = conf; > > + > > + ngx_uint_t i; > > + ngx_http_complex_value_t *param; > > + ngx_http_compile_complex_value_t ccv; > > + ngx_str_t *value; > > + > > + value = cf->args->elts; > > + > > + /* alloc array */ > > This comment looks redundant. > > > + if (xlcf->params.elts == NULL) { > > + if (ngx_array_init(&xlcf->params, cf->pool, 2, > > + sizeof(ngx_http_complex_value_t)) > > + != NGX_OK) > > Just a note: this will be ngx_array_create() instead with a > pointer, as suggested above. > > Something like this: > > if (xlcf->params == NULL) { > xlcf->params = ngx_array_create(cf->pool, 2, > sizeof(ngx_http_xslt_param_t)); > if (xlcf->params == NULL) { > return NGX_CONF_ERROR; > } > } > > > + { > > + return NGX_CONF_ERROR; > > + } > > + } > > + > > + for (i = 1; i <= 2; i++) { > > + > > + param = ngx_array_push(&xlcf->params); > > + if (param == NULL) { > > + return NGX_CONF_ERROR; > > + } > > + > > + ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); > > + > > + ccv.cf = cf; > > + ccv.value = &value[i]; > > + ccv.complex_value = param; > > + ccv.zero = 1; > > + > > + if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { > > + return NGX_CONF_ERROR; > > + } > > + } > > I don't think we want to support variables within param name. It > would be better to leave it as static string. > > > + > > + return NGX_CONF_OK; > > +} > > + > > + > > static void > > ngx_http_xslt_cleanup_dtd(void *data) > > { > > @@ -944,6 +1042,10 @@ > > conf->sheets = prev->sheets; > > } > > > > + if (conf->params.elts == 0) { > > + conf->params = prev->params; > > + } > > This will be > > if (conf->params == NULL) { > conf->params = prev->params; > } > > And please also add > > conf->params = NULL; > > into comment in ngx_http_xslt_filter_create_conf() to clarify how > it's initialized. > > > + > > if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types, > > &prev->types_keys, &prev->types, > > ngx_http_xslt_default_types) > > Maxim Dounin > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ja.nginx at mailnull.com Fri Feb 10 17:48:48 2012 From: ja.nginx at mailnull.com (SamB) Date: Fri, 10 Feb 2012 18:48:48 +0100 Subject: [PATCH] add xslt_stylesheet_param directive In-Reply-To: <20120209231213.GQ67687@mdounin.ru> References: <20120209231213.GQ67687@mdounin.ru> Message-ID: Hi, I'll fix my non-string patch, here are my explanations to your comments ;) Sam On Fri, Feb 10, 2012 at 12:12 AM, Maxim Dounin wrote: > Hello! > > On Wed, Feb 08, 2012 at 01:55:47PM +0100, SamB wrote: > > > Hi, > > > > I've added xslt_string_param and slightly changed parameter passing > and > > transformation > > to make it work as expected. > > As a side effect of this change, might be usage of > > xslt_param/xslt_string_param faster, > > because params are directly inserted to transformation context and do > > not need to be > > copied to name/value parameter array that is passed to > > xsltApplyStylesheet() as it's now > > by parameters passed via xslt_stylesheet directive. > > > > Old parameter passing using xslt_stylesheet has not been changed to > > prevent unexpected behavior, > > maybe this can be modified later if this patch will prove to be > stable... > > This looks intresting, though may be it would be better to finish > and commit the xslt_param patch first (see another message for a > review). > > Below is review of the xslt_param + xslt_string_param patch > specific bits. > > [...] > > > diff -ur nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c > nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c > > --- nginx-1.1.13/src/http/modules/ngx_http_xslt_filter_module.c > 2010-07-12 14:52:01.000000000 +0200 > > +++ nginx-1.1.13-new/src/http/modules/ngx_http_xslt_filter_module.c > 2012-02-08 13:34:43.000000000 +0100 > > @@ -10,6 +10,7 @@ > > > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -48,6 +49,8 @@ > > ngx_array_t sheets; /* ngx_http_xslt_sheet_t */ > > ngx_hash_t types; > > ngx_array_t *types_keys; > > + ngx_array_t string_params; /* ngx_http_complex_value_t */ > > + ngx_array_t params; /* ngx_http_complex_value_t */ > > I would like to see single "params" array instead, with both > string params and xpath ones. > > Ok, I will merge them and distinguish by flag. > [...] > > > @@ -84,6 +90,13 @@ > > void *conf); > > static char *ngx_http_xslt_stylesheet(ngx_conf_t *cf, ngx_command_t > *cmd, > > void *conf); > > +static char *ngx_http_xslt_add_param(ngx_conf_t *cf, ngx_command_t *cmd, > > + ngx_array_t *params); > > +static char *ngx_http_xslt_stylesheet_param(ngx_conf_t *cf, > ngx_command_t *cmd, > > + void *conf); > > +static char *ngx_http_xslt_stylesheet_string_param(ngx_conf_t *cf, > > + ngx_command_t *cmd, > > + void *conf); > > There is no need for 3 functions here. Just one is enough. > > In your current code, you may (and probably have to) use "offset" > field of the command structure to pass offset of array you want to > work with. With single params array as suggested earlier - you > may use "post" field to distinguish string and non-string > versions. > > Ok. Regarding rename of ngx_http_xslt_stylesheet_param to shorter ngx_http_xslt_param, I've had again problem with existing function with similar name ngx_http_xslt_params. > > static void ngx_http_xslt_cleanup_dtd(void *data); > > static void ngx_http_xslt_cleanup_stylesheet(void *data); > > static void *ngx_http_xslt_filter_create_main_conf(ngx_conf_t *cf); > > @@ -116,6 +129,20 @@ > > 0, > > NULL }, > > > > + { ngx_string("xslt_param"), > > + > NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, > > + ngx_http_xslt_stylesheet_param, > > + NGX_HTTP_LOC_CONF_OFFSET, > > + 0, > > + NULL }, > > + > > + { ngx_string("xslt_string_param"), > > + > NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, > > + ngx_http_xslt_stylesheet_string_param, > > + NGX_HTTP_LOC_CONF_OFFSET, > > + 0, > > + NULL }, > > + > > { ngx_string("xslt_types"), > > > NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, > > ngx_http_types_slot, > > @@ -450,6 +477,7 @@ > > ngx_uint_t i; > > xmlChar *buf; > > xmlDocPtr doc, res; > > + xsltTransformContextPtr xctxt; > > In libxslt this is usually called "ctxt", I think we should > follow. > > There exists variable ctx already in this context, and I find them too similar therefore this way. > > ngx_http_xslt_sheet_t *sheet; > > ngx_http_xslt_filter_loc_conf_t *conf; > > > > @@ -468,14 +496,28 @@ > > > > for (i = 0; i < conf->sheets.nelts; i++) { > > > > - if (ngx_http_xslt_params(r, ctx, &sheet[i].params) != NGX_OK) { > > + xctxt = xsltNewTransformContext(sheet[i].stylesheet, doc); > > + if (xctxt == NULL) { > > xmlFreeDoc(doc); > > return NULL; > > } > > > > - res = xsltApplyStylesheet(sheet[i].stylesheet, doc, > ctx->params.elts); > > + xctxt->initialContextDoc = doc; > > + xctxt->initialContextNode = (xmlNodePtr) doc; > > According to > > http://xmlsoft.org/XSLT/html/libxslt-xsltInternals.html > > this is internal to libxslt, and using it may not be a good idea. > Are you sure it's needed? > > As far as I can see in sources, it's ceratainly *not* needed for > xsltQuoteOneUserParam(). Not sure about xsltEvalOneUserParam(). > > This is needed for xsltEvalOneUserParam() to work correctly, there is no other way how to make it work (libxslt bug?), and I don't think its risky to use it. But, I can avoid use of xsltEvalOneUserParam() at all and pass params in the old way. > > + > > + if (ngx_http_xslt_params(r, ctx, conf, xctxt, > > + &sheet[i].params) != NGX_OK) { > > + xmlFreeDoc(doc); > > + xsltFreeTransformContext(xctxt); > > It may be a good idea to free this in reverse order, i.e. > transformation context first. > > Ok. > > + return NULL; > > + } > > + > > + res = xsltApplyStylesheetUser(sheet[i].stylesheet, doc, > > + ctx->params.elts, > > + NULL, NULL, xctxt); > > > > xmlFreeDoc(doc); > > + xsltFreeTransformContext(xctxt); > > Same here. > > > > > if (res == NULL) { > > ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, > > @@ -564,14 +606,92 @@ > > [...] > > Maxim Dounin > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wandenberg at gmail.com Fri Feb 10 20:44:45 2012 From: wandenberg at gmail.com (Wandenberg Peixoto) Date: Fri, 10 Feb 2012 18:44:45 -0200 Subject: Request inside a timer Message-ID: Hi, I would like to do a module which, at some interval, refresh part of its configuration getting some values from a external service. So I need to make a GET independent of a user request. Has any way to do that with nginx core functions or I have to use external libs? If somebody could send me an example will be great. Regards, Wandenberg -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Fri Feb 10 22:39:10 2012 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Fri, 10 Feb 2012 22:39:10 +0000 Subject: Request inside a timer In-Reply-To: References: Message-ID: <87zkcqqpo1.wl%appa@perusio.net> On 10 Fev 2012 20h44 WET, wandenberg at gmail.com wrote: > Hi, > > I would like to do a module which, at some interval, refresh part of > its configuration getting some values from a external service. So I > need to make a GET independent of a user request. I suggest not doing a module, but instead making use of: http://wiki.nginx.org/HttpLuaModule It can do that and more, much more. Just an idea, --- appa From zzz at zzz.org.ua Fri Feb 10 23:04:13 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Sat, 11 Feb 2012 01:04:13 +0200 Subject: Request inside a timer In-Reply-To: <87zkcqqpo1.wl%appa@perusio.net> References: <87zkcqqpo1.wl%appa@perusio.net> Message-ID: On Sat, Feb 11, 2012 at 12:39 AM, Ant?nio P. P. Almeida wrote: >> I would like to do a module which, at some interval, refresh part of >> its configuration getting some values from a external service. ?So I >> need to make a GET independent of a user request. > > I suggest not doing a module, but instead making use of: > > http://wiki.nginx.org/HttpLuaModule > > It can do that and more, much more. I don't think it can. But pretty easy with Nginx::Perl: use Nginx; use Nginx::HTTP; sub init_worker { ... my $req = "GET / HTTP/1.1" . "\x0d\x0a" . "Host: foobar" . "\x0d\x0a\x0d\x0a" ; ngx_timer 0, 5, sub { ngx_http "1.2.3.4:80", $req, sub { my ($headers, $buf_ref) = @_; unless ($headers) { ngx_log_error $!, "error"; return; } ngx_log_notice 0, "got $headers->{'_status'}"; ... }; }; } http://zzzcpan.github.com/nginx-perl/ From appa at perusio.net Fri Feb 10 23:35:45 2012 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Fri, 10 Feb 2012 23:35:45 +0000 Subject: Request inside a timer In-Reply-To: References: <87zkcqqpo1.wl%appa@perusio.net> Message-ID: <87wr7uqn1q.wl%appa@perusio.net> On 10 Fev 2012 23h04 WET, zzz at zzz.org.ua wrote: > On Sat, Feb 11, 2012 at 12:39 AM, Ant?nio P. P. Almeida > wrote: >>> I would like to do a module which, at some interval, refresh part >>> of its configuration getting some values from a external >>> service. ?So I need to make a GET independent of a user request. >> >> I suggest not doing a module, but instead making use of: >> >> http://wiki.nginx.org/HttpLuaModule >> >> It can do that and more, much more. > > I don't think it can. But pretty easy with Nginx::Perl: > > use Nginx; > use Nginx::HTTP; > > sub init_worker { > ... > my $req = "GET / HTTP/1.1" . "\x0d\x0a" . "Host: foobar" . > "\x0d\x0a\x0d\x0a" ; > > ngx_timer 0, 5, sub { > ngx_http "1.2.3.4:80", $req, sub { > my ($headers, $buf_ref) = @_; > > unless ($headers) { > ngx_log_error $!, "error"; > return; > } > > ngx_log_notice 0, "got $headers->{'_status'}"; > ... > }; > }; > } > > http://zzzcpan.github.com/nginx-perl/ I think it can. Since right now you can create sockets right within the config. Therefore making the request from within is possible. As is processing the response and updating the config based on the values obtained. http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp What does your embedded Perl offer that you cannot accomplish with this? --- appa From zzz at zzz.org.ua Fri Feb 10 23:58:31 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Sat, 11 Feb 2012 01:58:31 +0200 Subject: Request inside a timer In-Reply-To: <87wr7uqn1q.wl%appa@perusio.net> References: <87zkcqqpo1.wl%appa@perusio.net> <87wr7uqn1q.wl%appa@perusio.net> Message-ID: On Sat, Feb 11, 2012 at 1:35 AM, Ant?nio P. P. Almeida wrote: > On 10 Fev 2012 23h04 WET, zzz at zzz.org.ua wrote: > >> On Sat, Feb 11, 2012 at 12:39 AM, Ant?nio P. P. Almeida >> wrote: >>>> I would like to do a module which, at some interval, refresh part >>>> of its configuration getting some values from a external >>>> service. ?So I need to make a GET independent of a user request. > I think it can. Since right now you can create sockets right within > the config. Therefore making the request from within is possible. As > is processing the response and updating the config based on the values > obtained. > > http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp > > What does your embedded Perl offer that you cannot accomplish with > this? I don't think that task in question can be implemented with just this. Or maybe I'm wrong, than show me how. From xb.zhou at qq.com Sat Feb 11 08:54:55 2012 From: xb.zhou at qq.com (=?ISO-8859-1?B?WkhPVSBYaWFvYm8=?=) Date: Sat, 11 Feb 2012 16:54:55 +0800 Subject: Can nginx module produce multiple request to upstreams? Message-ID: My demand is: 1) client sends a request to nginx 2) nginx processes this request and sends 2 requests to 2 different backend servers 3) after the 2 responses arrive, nginx builds the response and sends it to client. so my question is: can I write a module to do this? Or I have to employ a CGI-like(fcgi/uwsgi etc.) server? thanks ------------------ Sincerely yours ZHOU Xiaobo
From brian at akins.org Sat Feb 11 12:12:17 2012 From: brian at akins.org (Brian Akins) Date: Sat, 11 Feb 2012 07:12:17 -0500 Subject: Can nginx module produce multiple request to upstreams? In-Reply-To: References: Message-ID: <3670DA9A-D8CE-4AC5-99EC-0C5E9F6337AD@akins.org> Easy to do with the Lua module. http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi From ne at vbart.ru Sat Feb 11 13:42:41 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Sat, 11 Feb 2012 17:42:41 +0400 Subject: Can nginx module produce multiple request to upstreams? In-Reply-To: References: Message-ID: <201202111742.41231.ne@vbart.ru> On Saturday 11 February 2012 12:54:55 ZHOU Xiaobo wrote: > My demand is: > 1) client sends a request to nginx > 2) nginx processes this request and sends 2 requests to 2 different backend > servers 3) after the 2 responses arrive, nginx builds the response and > sends it to client. a. http://nginx.org/en/docs/http/ngx_http_addition_module.html b. http://nginx.org/en/docs/http/ngx_http_ssi_module.html#commands wbr, Valentin V. Bartenev From zhuzhaoyuan at gmail.com Mon Feb 13 07:08:22 2012 From: zhuzhaoyuan at gmail.com (Joshua Zhu) Date: Mon, 13 Feb 2012 15:08:22 +0800 Subject: [PATCH] Fix logging keepalive related variables bug Message-ID: Hi, A bug was introduced in revision 3181 that r->keepalive was set to 0 before calling ngx_http_log_reques(), so the $sent_http_connection and $sent_http_keep_alive variables will not work anymore. The following patch is trying to fix this problem. diff -uprN nginx-1.1.14/src/http/ngx_http_request.c nginx-1.1.14-patched/src/http/ngx_http_request.c --- nginx-1.1.14/src/http/ngx_http_request.c ? ?2012-01-18 23:07:43.000000000 +0800 +++ nginx-1.1.14-patched/src/http/ngx_http_request.c ? ?2012-02-13 12:44:11.190366479 +0800 @@ -2498,8 +2498,6 @@ ngx_http_set_keepalive(ngx_http_request_ ? ? ? ? ?} ? ? ?} - ? ?r->keepalive = 0; - ? ? ?ngx_http_free_request(r, 0); ? ? ?c->data = hc; @@ -2978,6 +2976,7 @@ ngx_http_close_request(ngx_http_request_ ?static void ?ngx_http_free_request(ngx_http_request_t *r, ngx_int_t rc) ?{ + ? ?unsigned ? ? ? ? ? ? ? ? ? keepalive; ? ? ?ngx_log_t ? ? ? ? ? ? ? ? *log; ? ? ?struct linger ? ? ? ? ? ? ?linger; ? ? ?ngx_http_cleanup_t ? ? ? ?*cln; @@ -2993,12 +2992,22 @@ ngx_http_free_request(ngx_http_request_t ? ? ? ? ?return; ? ? ?} + ? ?/* + ? ? * clear r->keepalive to disable preventively calling + ? ? * ngx_http_set_keepalive() while request cleanup + ? ? */ + + ? ?keepalive = r->keepalive; + ? ?r->keepalive = 0; + ? ? ?for (cln = r->cleanup; cln; cln = cln->next) { ? ? ? ? ?if (cln->handler) { ? ? ? ? ? ? ?cln->handler(cln->data); ? ? ? ? ?} ? ? ?} + ? ?r->keepalive = keepalive; + ?#if (NGX_STAT_STUB) ? ? ?if (r->stat_reading) { Regards, -- Joshua Zhu Senior Software Engineer Server Platforms Team at Taobao -------------- next part -------------- A non-text attachment was scrubbed... Name: keepalive.patch Type: text/x-patch Size: 1232 bytes Desc: not available URL: From vbart at nginx.com Mon Feb 13 10:42:45 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Mon, 13 Feb 2012 10:42:45 +0000 Subject: [nginx] svn commit: r4462 - trunk/src/http/modules Message-ID: Author: vbart Date: 2012-02-13 10:42:44 +0000 (Mon, 13 Feb 2012) New Revision: 4462 Modified: trunk/src/http/modules/ngx_http_proxy_module.c Log: Proxy: renamed some "proxy_redirect" related declarations to a more general and reusable. No functional changes. Modified: trunk/src/http/modules/ngx_http_proxy_module.c =================================================================== --- trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-10 14:31:04 UTC (rev 4461) +++ trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-13 10:42:44 UTC (rev 4462) @@ -10,20 +10,20 @@ #include -typedef struct ngx_http_proxy_redirect_s ngx_http_proxy_redirect_t; +typedef struct ngx_http_proxy_rewrite_s ngx_http_proxy_rewrite_t; -typedef ngx_int_t (*ngx_http_proxy_redirect_pt)(ngx_http_request_t *r, - ngx_table_elt_t *h, size_t prefix, ngx_http_proxy_redirect_t *pr); +typedef ngx_int_t (*ngx_http_proxy_rewrite_pt)(ngx_http_request_t *r, + ngx_table_elt_t *h, size_t prefix, ngx_http_proxy_rewrite_t *pr); -struct ngx_http_proxy_redirect_s { - ngx_http_proxy_redirect_pt handler; +struct ngx_http_proxy_rewrite_s { + ngx_http_proxy_rewrite_pt handler; union { ngx_http_complex_value_t complex; #if (NGX_PCRE) ngx_http_regex_t *regex; #endif - } redirect; + } pattern; ngx_http_complex_value_t replacement; }; @@ -2274,8 +2274,8 @@ { ngx_int_t rc; ngx_uint_t i; + ngx_http_proxy_rewrite_t *pr; ngx_http_proxy_loc_conf_t *plcf; - ngx_http_proxy_redirect_t *pr; plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); @@ -2298,20 +2298,20 @@ static ngx_int_t -ngx_http_proxy_rewrite_redirect_complex(ngx_http_request_t *r, - ngx_table_elt_t *h, size_t prefix, ngx_http_proxy_redirect_t *pr) +ngx_http_proxy_rewrite_complex_handler(ngx_http_request_t *r, + ngx_table_elt_t *h, size_t prefix, ngx_http_proxy_rewrite_t *pr) { size_t len; u_char *data, *p; - ngx_str_t redirect, replacement; + ngx_str_t pattern, replacement; - if (ngx_http_complex_value(r, &pr->redirect.complex, &redirect) != NGX_OK) { + if (ngx_http_complex_value(r, &pr->pattern.complex, &pattern) != NGX_OK) { return NGX_ERROR; } - if (redirect.len > h->value.len - prefix - || ngx_rstrncmp(h->value.data + prefix, redirect.data, - redirect.len) != 0) + if (pattern.len > h->value.len - prefix + || ngx_rstrncmp(h->value.data + prefix, pattern.data, + pattern.len) != 0) { return NGX_DECLINED; } @@ -2320,7 +2320,7 @@ return NGX_ERROR; } - len = replacement.len + h->value.len - redirect.len; + len = replacement.len + h->value.len - pattern.len; data = ngx_pnalloc(r->pool, len); if (data == NULL) { @@ -2333,8 +2333,8 @@ p = ngx_copy(p, replacement.data, replacement.len); } - ngx_memcpy(p, h->value.data + prefix + redirect.len, - h->value.len - redirect.len - prefix); + ngx_memcpy(p, h->value.data + prefix + pattern.len, + h->value.len - pattern.len - prefix); h->value.len = len; h->value.data = data; @@ -2346,17 +2346,17 @@ #if (NGX_PCRE) static ngx_int_t -ngx_http_proxy_rewrite_redirect_regex(ngx_http_request_t *r, ngx_table_elt_t *h, - size_t prefix, ngx_http_proxy_redirect_t *pr) +ngx_http_proxy_rewrite_regex_handler(ngx_http_request_t *r, ngx_table_elt_t *h, + size_t prefix, ngx_http_proxy_rewrite_t *pr) { size_t len; u_char *data; - ngx_str_t redirect, replacement; + ngx_str_t pattern, replacement; - redirect.len = h->value.len - prefix; - redirect.data = h->value.data + prefix; + pattern.len = h->value.len - prefix; + pattern.data = h->value.data + prefix; - if (ngx_http_regex_exec(r, pr->redirect.regex, &redirect) != NGX_OK) { + if (ngx_http_regex_exec(r, pr->pattern.regex, &pattern) != NGX_OK) { return NGX_DECLINED; } @@ -2507,7 +2507,7 @@ size_t size; ngx_hash_init_t hash; ngx_http_core_loc_conf_t *clcf; - ngx_http_proxy_redirect_t *pr; + ngx_http_proxy_rewrite_t *pr; ngx_http_script_compile_t sc; if (conf->upstream.store != 0) { @@ -2760,7 +2760,7 @@ if (conf->redirects == NULL && conf->url.data) { conf->redirects = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_proxy_redirect_t)); + sizeof(ngx_http_proxy_rewrite_t)); if (conf->redirects == NULL) { return NGX_CONF_ERROR; } @@ -2770,27 +2770,27 @@ return NGX_CONF_ERROR; } - ngx_memzero(&pr->redirect.complex, + ngx_memzero(&pr->pattern.complex, sizeof(ngx_http_complex_value_t)); ngx_memzero(&pr->replacement, sizeof(ngx_http_complex_value_t)); - pr->handler = ngx_http_proxy_rewrite_redirect_complex; + pr->handler = ngx_http_proxy_rewrite_complex_handler; if (conf->vars.uri.len) { - pr->redirect.complex.value = conf->url; + pr->pattern.complex.value = conf->url; pr->replacement.value = conf->location; } else { - pr->redirect.complex.value.len = conf->url.len - + sizeof("/") - 1; + pr->pattern.complex.value.len = conf->url.len + + sizeof("/") - 1; - p = ngx_pnalloc(cf->pool, pr->redirect.complex.value.len); + p = ngx_pnalloc(cf->pool, pr->pattern.complex.value.len); if (p == NULL) { return NGX_CONF_ERROR; } - pr->redirect.complex.value.data = p; + pr->pattern.complex.value.data = p; p = ngx_cpymem(p, conf->url.data, conf->url.len); *p = '/'; @@ -3285,7 +3285,7 @@ u_char *p; ngx_str_t *value; - ngx_http_proxy_redirect_t *pr; + ngx_http_proxy_rewrite_t *pr; ngx_http_compile_complex_value_t ccv; if (plcf->redirect == 0) { @@ -3320,7 +3320,7 @@ if (plcf->redirects == NULL) { plcf->redirects = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_proxy_redirect_t)); + sizeof(ngx_http_proxy_rewrite_t)); if (plcf->redirects == NULL) { return NGX_CONF_ERROR; } @@ -3346,25 +3346,25 @@ return NGX_CONF_ERROR; } - pr->handler = ngx_http_proxy_rewrite_redirect_complex; + pr->handler = ngx_http_proxy_rewrite_complex_handler; - ngx_memzero(&pr->redirect.complex, sizeof(ngx_http_complex_value_t)); + ngx_memzero(&pr->pattern.complex, sizeof(ngx_http_complex_value_t)); ngx_memzero(&pr->replacement, sizeof(ngx_http_complex_value_t)); if (plcf->vars.uri.len) { - pr->redirect.complex.value = plcf->url; + pr->pattern.complex.value = plcf->url; pr->replacement.value = plcf->location; } else { - pr->redirect.complex.value.len = plcf->url.len + sizeof("/") - 1; + pr->pattern.complex.value.len = plcf->url.len + sizeof("/") - 1; - p = ngx_pnalloc(cf->pool, pr->redirect.complex.value.len); + p = ngx_pnalloc(cf->pool, pr->pattern.complex.value.len); if (p == NULL) { return NGX_CONF_ERROR; } - pr->redirect.complex.value.data = p; + pr->pattern.complex.value.data = p; p = ngx_cpymem(p, plcf->url.data, plcf->url.len); *p = '/'; @@ -3396,12 +3396,12 @@ rc.err.len = NGX_MAX_CONF_ERRSTR; rc.err.data = errstr; - pr->redirect.regex = ngx_http_regex_compile(cf, &rc); - if (pr->redirect.regex == NULL) { + pr->pattern.regex = ngx_http_regex_compile(cf, &rc); + if (pr->pattern.regex == NULL) { return NGX_CONF_ERROR; } - pr->handler = ngx_http_proxy_rewrite_redirect_regex; + pr->handler = ngx_http_proxy_rewrite_regex_handler; #else ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, @@ -3416,13 +3416,13 @@ ccv.cf = cf; ccv.value = &value[1]; - ccv.complex_value = &pr->redirect.complex; + ccv.complex_value = &pr->pattern.complex; if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { return NGX_CONF_ERROR; } - pr->handler = ngx_http_proxy_rewrite_redirect_complex; + pr->handler = ngx_http_proxy_rewrite_complex_handler; } From vbart at nginx.com Mon Feb 13 10:56:09 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Mon, 13 Feb 2012 10:56:09 +0000 Subject: [nginx] svn commit: r4463 - trunk/src/http/modules Message-ID: Author: vbart Date: 2012-02-13 10:56:09 +0000 (Mon, 13 Feb 2012) New Revision: 4463 Modified: trunk/src/http/modules/ngx_http_proxy_module.c Log: Proxy: generic rewrite code from the "proxy_redirect" handlers moved to a separate function with trivial optimization. No functional changes. Modified: trunk/src/http/modules/ngx_http_proxy_module.c =================================================================== --- trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-13 10:42:44 UTC (rev 4462) +++ trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-13 10:56:09 UTC (rev 4463) @@ -13,7 +13,8 @@ typedef struct ngx_http_proxy_rewrite_s ngx_http_proxy_rewrite_t; typedef ngx_int_t (*ngx_http_proxy_rewrite_pt)(ngx_http_request_t *r, - ngx_table_elt_t *h, size_t prefix, ngx_http_proxy_rewrite_t *pr); + ngx_table_elt_t *h, size_t prefix, size_t len, + ngx_http_proxy_rewrite_t *pr); struct ngx_http_proxy_rewrite_s { ngx_http_proxy_rewrite_pt handler; @@ -123,6 +124,8 @@ ngx_http_variable_value_t *v, uintptr_t data); static ngx_int_t ngx_http_proxy_rewrite_redirect(ngx_http_request_t *r, ngx_table_elt_t *h, size_t prefix); +static ngx_int_t ngx_http_proxy_rewrite(ngx_http_request_t *r, + ngx_table_elt_t *h, size_t prefix, size_t len, ngx_str_t *replacement); static ngx_int_t ngx_http_proxy_add_variables(ngx_conf_t *cf); static void *ngx_http_proxy_create_loc_conf(ngx_conf_t *cf); @@ -2272,6 +2275,7 @@ ngx_http_proxy_rewrite_redirect(ngx_http_request_t *r, ngx_table_elt_t *h, size_t prefix) { + size_t len; ngx_int_t rc; ngx_uint_t i; ngx_http_proxy_rewrite_t *pr; @@ -2285,8 +2289,10 @@ return NGX_DECLINED; } + len = h->value.len - prefix; + for (i = 0; i < plcf->redirects->nelts; i++) { - rc = pr[i].handler(r, h, prefix, &pr[i]); + rc = pr[i].handler(r, h, prefix, len, &pr[i]); if (rc != NGX_DECLINED) { return rc; @@ -2299,17 +2305,15 @@ static ngx_int_t ngx_http_proxy_rewrite_complex_handler(ngx_http_request_t *r, - ngx_table_elt_t *h, size_t prefix, ngx_http_proxy_rewrite_t *pr) + ngx_table_elt_t *h, size_t prefix, size_t len, ngx_http_proxy_rewrite_t *pr) { - size_t len; - u_char *data, *p; - ngx_str_t pattern, replacement; + ngx_str_t pattern, replacement; if (ngx_http_complex_value(r, &pr->pattern.complex, &pattern) != NGX_OK) { return NGX_ERROR; } - if (pattern.len > h->value.len - prefix + if (pattern.len > len || ngx_rstrncmp(h->value.data + prefix, pattern.data, pattern.len) != 0) { @@ -2320,26 +2324,7 @@ return NGX_ERROR; } - len = replacement.len + h->value.len - pattern.len; - - data = ngx_pnalloc(r->pool, len); - if (data == NULL) { - return NGX_ERROR; - } - - p = ngx_copy(data, h->value.data, prefix); - - if (replacement.len) { - p = ngx_copy(p, replacement.data, replacement.len); - } - - ngx_memcpy(p, h->value.data + prefix + pattern.len, - h->value.len - pattern.len - prefix); - - h->value.len = len; - h->value.data = data; - - return NGX_OK; + return ngx_http_proxy_rewrite(r, h, prefix, pattern.len, &replacement); } @@ -2347,13 +2332,11 @@ static ngx_int_t ngx_http_proxy_rewrite_regex_handler(ngx_http_request_t *r, ngx_table_elt_t *h, - size_t prefix, ngx_http_proxy_rewrite_t *pr) + size_t prefix, size_t len, ngx_http_proxy_rewrite_t *pr) { - size_t len; - u_char *data; - ngx_str_t pattern, replacement; + ngx_str_t pattern, replacement; - pattern.len = h->value.len - prefix; + pattern.len = len; pattern.data = h->value.data + prefix; if (ngx_http_regex_exec(r, pr->pattern.regex, &pattern) != NGX_OK) { @@ -2364,30 +2347,55 @@ return NGX_ERROR; } - if (!prefix) { + if (prefix == 0 && h->value.len == len) { h->value = replacement; return NGX_OK; } - len = prefix + replacement.len; + return ngx_http_proxy_rewrite(r, h, prefix, len, &replacement); +} - data = ngx_pnalloc(r->pool, len); - if (data == NULL) { - return NGX_ERROR; +#endif + + +static ngx_int_t +ngx_http_proxy_rewrite(ngx_http_request_t *r, ngx_table_elt_t *h, size_t prefix, + size_t len, ngx_str_t *replacement) +{ + u_char *p, *data; + size_t new_len; + + new_len = replacement->len + h->value.len - len; + + if (replacement->len > len) { + + data = ngx_pnalloc(r->pool, new_len); + if (data == NULL) { + return NGX_ERROR; + } + + p = ngx_copy(data, h->value.data, prefix); + p = ngx_copy(p, replacement->data, replacement->len); + + ngx_memcpy(p, h->value.data + prefix + len, + h->value.len - len - prefix); + + h->value.data = data; + + } else { + p = ngx_copy(h->value.data + prefix, replacement->data, + replacement->len); + + ngx_memmove(p, h->value.data + prefix + len, + h->value.len - len - prefix); } - ngx_memcpy(data, h->value.data, prefix); - ngx_memcpy(data + prefix, replacement.data, replacement.len); + h->value.len = new_len; - h->value.len = len; - h->value.data = data; - return NGX_OK; } -#endif - static ngx_int_t ngx_http_proxy_add_variables(ngx_conf_t *cf) { From vbart at nginx.com Mon Feb 13 11:00:09 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Mon, 13 Feb 2012 11:00:09 +0000 Subject: [nginx] svn commit: r4464 - trunk/src/http/modules Message-ID: Author: vbart Date: 2012-02-13 11:00:08 +0000 (Mon, 13 Feb 2012) New Revision: 4464 Modified: trunk/src/http/modules/ngx_http_proxy_module.c Log: Proxy: generic regex related code from the "proxy_redirect" directive moved to a separate function. No functional changes. Modified: trunk/src/http/modules/ngx_http_proxy_module.c =================================================================== --- trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-13 10:56:09 UTC (rev 4463) +++ trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-13 11:00:08 UTC (rev 4464) @@ -149,6 +149,9 @@ static char *ngx_http_proxy_lowat_check(ngx_conf_t *cf, void *post, void *data); +static ngx_int_t ngx_http_proxy_rewrite_regex(ngx_conf_t *cf, + ngx_http_proxy_rewrite_t *pr, ngx_str_t *regex, ngx_uint_t caseless); + #if (NGX_HTTP_SSL) static ngx_int_t ngx_http_proxy_set_ssl(ngx_conf_t *cf, ngx_http_proxy_loc_conf_t *plcf); @@ -3385,39 +3388,23 @@ if (value[1].data[0] == '~') { -#if (NGX_PCRE) - u_char errstr[NGX_MAX_CONF_ERRSTR]; - ngx_regex_compile_t rc; - value[1].len--; value[1].data++; - ngx_memzero(&rc, sizeof(ngx_regex_compile_t)); - if (value[1].data[0] == '*') { value[1].len--; value[1].data++; - rc.options = NGX_REGEX_CASELESS; - } - rc.pattern = value[1]; - rc.err.len = NGX_MAX_CONF_ERRSTR; - rc.err.data = errstr; + if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 1) != NGX_OK) { + return NGX_CONF_ERROR; + } - pr->pattern.regex = ngx_http_regex_compile(cf, &rc); - if (pr->pattern.regex == NULL) { - return NGX_CONF_ERROR; + } else { + if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 0) != NGX_OK) { + return NGX_CONF_ERROR; + } } - pr->handler = ngx_http_proxy_rewrite_regex_handler; - -#else - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "using regex \"%V\" requires PCRE library", - &value[1]); - - return NGX_CONF_ERROR; -#endif } else { ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); @@ -3448,6 +3435,43 @@ } +static ngx_int_t +ngx_http_proxy_rewrite_regex(ngx_conf_t *cf, ngx_http_proxy_rewrite_t *pr, + ngx_str_t *regex, ngx_uint_t caseless) +{ +#if (NGX_PCRE) + u_char errstr[NGX_MAX_CONF_ERRSTR]; + ngx_regex_compile_t rc; + + ngx_memzero(&rc, sizeof(ngx_regex_compile_t)); + + rc.pattern = *regex; + rc.err.len = NGX_MAX_CONF_ERRSTR; + rc.err.data = errstr; + + if (caseless) { + rc.options = NGX_REGEX_CASELESS; + } + + pr->pattern.regex = ngx_http_regex_compile(cf, &rc); + if (pr->pattern.regex == NULL) { + return NGX_ERROR; + } + + pr->handler = ngx_http_proxy_rewrite_regex_handler; + + return NGX_OK; + +#else + + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "using regex \"%V\" requires PCRE library", regex); + return NGX_ERROR; + +#endif +} + + static char * ngx_http_proxy_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { From vbart at nginx.com Mon Feb 13 11:02:00 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Mon, 13 Feb 2012 11:02:00 +0000 Subject: [nginx] svn commit: r4465 - trunk/src/http Message-ID: Author: vbart Date: 2012-02-13 11:01:58 +0000 (Mon, 13 Feb 2012) New Revision: 4465 Modified: trunk/src/http/ngx_http_upstream.c trunk/src/http/ngx_http_upstream.h Log: Upstream: added callback hook for the "Set-Cookie" header. No functional changes. Modified: trunk/src/http/ngx_http_upstream.c =================================================================== --- trunk/src/http/ngx_http_upstream.c 2012-02-13 11:00:08 UTC (rev 4464) +++ trunk/src/http/ngx_http_upstream.c 2012-02-13 11:01:58 UTC (rev 4465) @@ -110,6 +110,8 @@ ngx_table_elt_t *h, ngx_uint_t offset); static ngx_int_t ngx_http_upstream_rewrite_refresh(ngx_http_request_t *r, ngx_table_elt_t *h, ngx_uint_t offset); +static ngx_int_t ngx_http_upstream_rewrite_set_cookie(ngx_http_request_t *r, + ngx_table_elt_t *h, ngx_uint_t offset); static ngx_int_t ngx_http_upstream_copy_allow_ranges(ngx_http_request_t *r, ngx_table_elt_t *h, ngx_uint_t offset); @@ -198,7 +200,7 @@ { ngx_string("Set-Cookie"), ngx_http_upstream_process_set_cookie, 0, - ngx_http_upstream_copy_header_line, 0, 1 }, + ngx_http_upstream_rewrite_set_cookie, 0, 1 }, { ngx_string("Content-Disposition"), ngx_http_upstream_ignore_header_line, 0, @@ -3673,6 +3675,27 @@ static ngx_int_t +ngx_http_upstream_rewrite_set_cookie(ngx_http_request_t *r, ngx_table_elt_t *h, + ngx_uint_t offset) +{ + ngx_table_elt_t *ho; + + ho = ngx_list_push(&r->headers_out.headers); + if (ho == NULL) { + return NGX_ERROR; + } + + *ho = *h; + + if (r->upstream->rewrite_cookie) { + return r->upstream->rewrite_cookie(r, ho); + } + + return NGX_OK; +} + + +static ngx_int_t ngx_http_upstream_copy_allow_ranges(ngx_http_request_t *r, ngx_table_elt_t *h, ngx_uint_t offset) { Modified: trunk/src/http/ngx_http_upstream.h =================================================================== --- trunk/src/http/ngx_http_upstream.h 2012-02-13 11:00:08 UTC (rev 4464) +++ trunk/src/http/ngx_http_upstream.h 2012-02-13 11:01:58 UTC (rev 4465) @@ -299,6 +299,8 @@ ngx_int_t rc); ngx_int_t (*rewrite_redirect)(ngx_http_request_t *r, ngx_table_elt_t *h, size_t prefix); + ngx_int_t (*rewrite_cookie)(ngx_http_request_t *r, + ngx_table_elt_t *h); ngx_msec_t timeout; From vbart at nginx.com Mon Feb 13 11:04:45 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Mon, 13 Feb 2012 11:04:45 +0000 Subject: [nginx] svn commit: r4466 - trunk/src/http/modules Message-ID: Author: vbart Date: 2012-02-13 11:04:45 +0000 (Mon, 13 Feb 2012) New Revision: 4466 Modified: trunk/src/http/modules/ngx_http_proxy_module.c Log: Proxy: added the "proxy_cookie_domain" directive. Modified: trunk/src/http/modules/ngx_http_proxy_module.c =================================================================== --- trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-13 11:01:58 UTC (rev 4465) +++ trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-13 11:04:45 UTC (rev 4466) @@ -55,6 +55,7 @@ ngx_array_t *proxy_values; ngx_array_t *redirects; + ngx_array_t *cookie_domains; ngx_str_t body_source; @@ -124,6 +125,10 @@ ngx_http_variable_value_t *v, uintptr_t data); static ngx_int_t ngx_http_proxy_rewrite_redirect(ngx_http_request_t *r, ngx_table_elt_t *h, size_t prefix); +static ngx_int_t ngx_http_proxy_rewrite_cookie(ngx_http_request_t *r, + ngx_table_elt_t *h); +static ngx_int_t ngx_http_proxy_rewrite_cookie_value(ngx_http_request_t *r, + ngx_table_elt_t *h, u_char *value, ngx_array_t *rewrites); static ngx_int_t ngx_http_proxy_rewrite(ngx_http_request_t *r, ngx_table_elt_t *h, size_t prefix, size_t len, ngx_str_t *replacement); @@ -138,6 +143,8 @@ void *conf); static char *ngx_http_proxy_redirect(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); +static char *ngx_http_proxy_cookie_domain(ngx_conf_t *cf, ngx_command_t *cmd, + void *conf); static char *ngx_http_proxy_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); #if (NGX_HTTP_CACHE) @@ -204,6 +211,13 @@ 0, NULL }, + { ngx_string("proxy_cookie_domain"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12, + ngx_http_proxy_cookie_domain, + NGX_HTTP_LOC_CONF_OFFSET, + 0, + NULL }, + { ngx_string("proxy_store"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ngx_http_proxy_store, @@ -655,6 +669,10 @@ u->rewrite_redirect = ngx_http_proxy_rewrite_redirect; } + if (plcf->cookie_domains) { + u->rewrite_cookie = ngx_http_proxy_rewrite_cookie; + } + u->buffering = plcf->upstream.buffering; u->pipe = ngx_pcalloc(r->pool, sizeof(ngx_event_pipe_t)); @@ -2307,6 +2325,68 @@ static ngx_int_t +ngx_http_proxy_rewrite_cookie(ngx_http_request_t *r, ngx_table_elt_t *h) +{ + size_t prefix; + u_char *p; + ngx_int_t rc; + ngx_http_proxy_loc_conf_t *plcf; + + p = (u_char *) ngx_strchr(h->value.data, ';'); + if (p == NULL) { + return NGX_DECLINED; + } + + prefix = p + 1 - h->value.data; + + rc = NGX_DECLINED; + + plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); + + if (plcf->cookie_domains) { + p = ngx_strcasestrn(h->value.data + prefix, "domain=", 7 - 1); + + if (p) { + rc = ngx_http_proxy_rewrite_cookie_value(r, h, p + 7, + plcf->cookie_domains); + } + } + + return rc; +} + + +static ngx_int_t +ngx_http_proxy_rewrite_cookie_value(ngx_http_request_t *r, ngx_table_elt_t *h, + u_char *value, ngx_array_t *rewrites) +{ + size_t len, prefix; + u_char *p; + ngx_int_t rc; + ngx_uint_t i; + ngx_http_proxy_rewrite_t *pr; + + prefix = value - h->value.data; + + p = (u_char *) ngx_strchr(value, ';'); + + len = p ? (size_t) (p - value) : (h->value.len - prefix); + + pr = rewrites->elts; + + for (i = 0; i < rewrites->nelts; i++) { + rc = pr[i].handler(r, h, prefix, len, &pr[i]); + + if (rc != NGX_DECLINED) { + return rc; + } + } + + return NGX_DECLINED; +} + + +static ngx_int_t ngx_http_proxy_rewrite_complex_handler(ngx_http_request_t *r, ngx_table_elt_t *h, size_t prefix, size_t len, ngx_http_proxy_rewrite_t *pr) { @@ -2362,6 +2442,37 @@ static ngx_int_t +ngx_http_proxy_rewrite_domain_handler(ngx_http_request_t *r, + ngx_table_elt_t *h, size_t prefix, size_t len, ngx_http_proxy_rewrite_t *pr) +{ + u_char *p; + ngx_str_t pattern, replacement; + + if (ngx_http_complex_value(r, &pr->pattern.complex, &pattern) != NGX_OK) { + return NGX_ERROR; + } + + p = h->value.data + prefix; + + if (p[0] == '.') { + p++; + prefix++; + len--; + } + + if (pattern.len != len || ngx_rstrncasecmp(pattern.data, p, len) != 0) { + return NGX_DECLINED; + } + + if (ngx_http_complex_value(r, &pr->replacement, &replacement) != NGX_OK) { + return NGX_ERROR; + } + + return ngx_http_proxy_rewrite(r, h, prefix, len, &replacement); +} + + +static ngx_int_t ngx_http_proxy_rewrite(ngx_http_request_t *r, ngx_table_elt_t *h, size_t prefix, size_t len, ngx_str_t *replacement) { @@ -2497,6 +2608,8 @@ conf->redirect = NGX_CONF_UNSET; conf->upstream.change_buffering = 1; + conf->cookie_domains = NGX_CONF_UNSET_PTR; + conf->http_version = NGX_CONF_UNSET_UINT; conf->headers_hash_max_size = NGX_CONF_UNSET_UINT; @@ -2811,6 +2924,8 @@ } } + ngx_conf_merge_ptr_value(conf->cookie_domains, prev->cookie_domains, NULL); + #if (NGX_HTTP_SSL) if (conf->upstream.ssl == NULL) { conf->upstream.ssl = prev->upstream.ssl; @@ -3435,6 +3550,93 @@ } +static char * +ngx_http_proxy_cookie_domain(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) +{ + ngx_http_proxy_loc_conf_t *plcf = conf; + + ngx_str_t *value; + ngx_http_proxy_rewrite_t *pr; + ngx_http_compile_complex_value_t ccv; + + if (plcf->cookie_domains == NULL) { + return NGX_CONF_OK; + } + + value = cf->args->elts; + + if (cf->args->nelts == 2) { + + if (ngx_strcmp(value[1].data, "off") == 0) { + plcf->cookie_domains = NULL; + return NGX_CONF_OK; + } + + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "invalid parameter \"%V\"", &value[1]); + return NGX_CONF_ERROR; + } + + if (plcf->cookie_domains == NGX_CONF_UNSET_PTR) { + plcf->cookie_domains = ngx_array_create(cf->pool, 1, + sizeof(ngx_http_proxy_rewrite_t)); + if (plcf->cookie_domains == NULL) { + return NGX_CONF_ERROR; + } + } + + pr = ngx_array_push(plcf->cookie_domains); + if (pr == NULL) { + return NGX_CONF_ERROR; + } + + if (value[1].data[0] == '~') { + value[1].len--; + value[1].data++; + + if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 1) != NGX_OK) { + return NGX_CONF_ERROR; + } + + } else { + + if (value[1].data[0] == '.') { + value[1].len--; + value[1].data++; + } + + ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); + + ccv.cf = cf; + ccv.value = &value[1]; + ccv.complex_value = &pr->pattern.complex; + + if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { + return NGX_CONF_ERROR; + } + + pr->handler = ngx_http_proxy_rewrite_domain_handler; + + if (value[2].data[0] == '.') { + value[2].len--; + value[2].data++; + } + } + + ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); + + ccv.cf = cf; + ccv.value = &value[2]; + ccv.complex_value = &pr->replacement; + + if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { + return NGX_CONF_ERROR; + } + + return NGX_CONF_OK; +} + + static ngx_int_t ngx_http_proxy_rewrite_regex(ngx_conf_t *cf, ngx_http_proxy_rewrite_t *pr, ngx_str_t *regex, ngx_uint_t caseless) From vbart at nginx.com Mon Feb 13 11:08:05 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Mon, 13 Feb 2012 11:08:05 +0000 Subject: [nginx] svn commit: r4467 - trunk/src/http/modules Message-ID: Author: vbart Date: 2012-02-13 11:08:05 +0000 (Mon, 13 Feb 2012) New Revision: 4467 Modified: trunk/src/http/modules/ngx_http_proxy_module.c Log: Proxy: added the "proxy_cookie_path" directive. Modified: trunk/src/http/modules/ngx_http_proxy_module.c =================================================================== --- trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-13 11:04:45 UTC (rev 4466) +++ trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-13 11:08:05 UTC (rev 4467) @@ -56,6 +56,7 @@ ngx_array_t *redirects; ngx_array_t *cookie_domains; + ngx_array_t *cookie_paths; ngx_str_t body_source; @@ -145,6 +146,8 @@ void *conf); static char *ngx_http_proxy_cookie_domain(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); +static char *ngx_http_proxy_cookie_path(ngx_conf_t *cf, ngx_command_t *cmd, + void *conf); static char *ngx_http_proxy_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); #if (NGX_HTTP_CACHE) @@ -218,6 +221,13 @@ 0, NULL }, + { ngx_string("proxy_cookie_path"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12, + ngx_http_proxy_cookie_path, + NGX_HTTP_LOC_CONF_OFFSET, + 0, + NULL }, + { ngx_string("proxy_store"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ngx_http_proxy_store, @@ -669,7 +679,7 @@ u->rewrite_redirect = ngx_http_proxy_rewrite_redirect; } - if (plcf->cookie_domains) { + if (plcf->cookie_domains || plcf->cookie_paths) { u->rewrite_cookie = ngx_http_proxy_rewrite_cookie; } @@ -2329,7 +2339,7 @@ { size_t prefix; u_char *p; - ngx_int_t rc; + ngx_int_t rc, rv; ngx_http_proxy_loc_conf_t *plcf; p = (u_char *) ngx_strchr(h->value.data, ';'); @@ -2339,7 +2349,7 @@ prefix = p + 1 - h->value.data; - rc = NGX_DECLINED; + rv = NGX_DECLINED; plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); @@ -2349,10 +2359,33 @@ if (p) { rc = ngx_http_proxy_rewrite_cookie_value(r, h, p + 7, plcf->cookie_domains); + if (rc == NGX_ERROR) { + return NGX_ERROR; + } + + if (rc != NGX_DECLINED) { + rv = rc; + } } } - return rc; + if (plcf->cookie_paths) { + p = ngx_strcasestrn(h->value.data + prefix, "path=", 5 - 1); + + if (p) { + rc = ngx_http_proxy_rewrite_cookie_value(r, h, p + 5, + plcf->cookie_paths); + if (rc == NGX_ERROR) { + return NGX_ERROR; + } + + if (rc != NGX_DECLINED) { + rv = rc; + } + } + } + + return rv; } @@ -2609,6 +2642,7 @@ conf->upstream.change_buffering = 1; conf->cookie_domains = NGX_CONF_UNSET_PTR; + conf->cookie_paths = NGX_CONF_UNSET_PTR; conf->http_version = NGX_CONF_UNSET_UINT; @@ -2926,6 +2960,8 @@ ngx_conf_merge_ptr_value(conf->cookie_domains, prev->cookie_domains, NULL); + ngx_conf_merge_ptr_value(conf->cookie_paths, prev->cookie_paths, NULL); + #if (NGX_HTTP_SSL) if (conf->upstream.ssl == NULL) { conf->upstream.ssl = prev->upstream.ssl; @@ -3637,6 +3673,93 @@ } +static char * +ngx_http_proxy_cookie_path(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) +{ + ngx_http_proxy_loc_conf_t *plcf = conf; + + ngx_str_t *value; + ngx_http_proxy_rewrite_t *pr; + ngx_http_compile_complex_value_t ccv; + + if (plcf->cookie_paths == NULL) { + return NGX_CONF_OK; + } + + value = cf->args->elts; + + if (cf->args->nelts == 2) { + + if (ngx_strcmp(value[1].data, "off") == 0) { + plcf->cookie_paths = NULL; + return NGX_CONF_OK; + } + + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "invalid parameter \"%V\"", &value[1]); + return NGX_CONF_ERROR; + } + + if (plcf->cookie_paths == NGX_CONF_UNSET_PTR) { + plcf->cookie_paths = ngx_array_create(cf->pool, 1, + sizeof(ngx_http_proxy_rewrite_t)); + if (plcf->cookie_paths == NULL) { + return NGX_CONF_ERROR; + } + } + + pr = ngx_array_push(plcf->cookie_paths); + if (pr == NULL) { + return NGX_CONF_ERROR; + } + + if (value[1].data[0] == '~') { + value[1].len--; + value[1].data++; + + if (value[1].data[0] == '*') { + value[1].len--; + value[1].data++; + + if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 1) != NGX_OK) { + return NGX_CONF_ERROR; + } + + } else { + if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 0) != NGX_OK) { + return NGX_CONF_ERROR; + } + } + + } else { + + ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); + + ccv.cf = cf; + ccv.value = &value[1]; + ccv.complex_value = &pr->pattern.complex; + + if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { + return NGX_CONF_ERROR; + } + + pr->handler = ngx_http_proxy_rewrite_complex_handler; + } + + ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); + + ccv.cf = cf; + ccv.value = &value[2]; + ccv.complex_value = &pr->replacement; + + if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { + return NGX_CONF_ERROR; + } + + return NGX_CONF_OK; +} + + static ngx_int_t ngx_http_proxy_rewrite_regex(ngx_conf_t *cf, ngx_http_proxy_rewrite_t *pr, ngx_str_t *regex, ngx_uint_t caseless) From mdounin at mdounin.ru Mon Feb 13 15:20:49 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 13 Feb 2012 15:20:49 +0000 Subject: [nginx] svn commit: r4468 - trunk/src/http/modules Message-ID: <20120213152050.6A6363F9DA4@mail.nginx.com> Author: mdounin Date: 2012-02-13 15:20:49 +0000 (Mon, 13 Feb 2012) New Revision: 4468 Log: Removed r->cache/r->cached dependencies in range filter. This is a layering violation, use correct offset calculations instead. Modified: trunk/src/http/modules/ngx_http_range_filter_module.c Modified: trunk/src/http/modules/ngx_http_range_filter_module.c =================================================================== --- trunk/src/http/modules/ngx_http_range_filter_module.c 2012-02-13 11:08:05 UTC (rev 4467) +++ trunk/src/http/modules/ngx_http_range_filter_module.c 2012-02-13 15:20:49 UTC (rev 4468) @@ -595,16 +595,9 @@ buf = in->buf; if (!buf->last_buf) { + start = ctx->offset; + last = ctx->offset + ngx_buf_size(buf); - if (buf->in_file) { - start = buf->file_pos + ctx->offset; - last = buf->file_last + ctx->offset; - - } else { - start = buf->pos - buf->start + ctx->offset; - last = buf->last - buf->start + ctx->offset; - } - range = ctx->ranges.elts; for (i = 0; i < ctx->ranges.nelts; i++) { if (start > range[i].start || last < range[i].end) { @@ -716,7 +709,6 @@ ngx_http_range_multipart_body(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx, ngx_chain_t *in) { - off_t body_start; ngx_buf_t *b, *buf; ngx_uint_t i; ngx_chain_t *out, *hcl, *rcl, *dcl, **ll; @@ -726,12 +718,6 @@ buf = in->buf; range = ctx->ranges.elts; -#if (NGX_HTTP_CACHE) - body_start = r->cached ? r->cache->body_start : 0; -#else - body_start = 0; -#endif - for (i = 0; i < ctx->ranges.nelts; i++) { /* @@ -792,13 +778,13 @@ b->file = buf->file; if (buf->in_file) { - b->file_pos = body_start + range[i].start; - b->file_last = body_start + range[i].end; + b->file_pos = buf->file_pos + range[i].start; + b->file_last = buf->file_pos + range[i].end; } if (ngx_buf_in_memory(buf)) { - b->pos = buf->start + (size_t) range[i].start; - b->last = buf->start + (size_t) range[i].end; + b->pos = buf->pos + (size_t) range[i].start; + b->last = buf->pos + (size_t) range[i].end; } dcl = ngx_alloc_chain_link(r->pool); From mdounin at mdounin.ru Mon Feb 13 15:23:43 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 13 Feb 2012 15:23:43 +0000 Subject: [nginx] svn commit: r4469 - trunk/src/http/modules Message-ID: <20120213152343.935773F9C9A@mail.nginx.com> Author: mdounin Date: 2012-02-13 15:23:43 +0000 (Mon, 13 Feb 2012) New Revision: 4469 Log: Gzip filter: handling of empty flush buffers. Empty flush buffers are legitimate and may happen e.g. due to $r->flush() calls in embedded perl. If there are no data buffered in zlib, deflate() will return Z_BUF_ERROR (i.e. no progress possible) without adding anything to output. Don't treat Z_BUF_ERROR as fatal and correctly send empty flush buffer if we have no data in output at all. See this thread for details: http://mailman.nginx.org/pipermail/nginx/2010-November/023693.html Modified: trunk/src/http/modules/ngx_http_gzip_filter_module.c Modified: trunk/src/http/modules/ngx_http_gzip_filter_module.c =================================================================== --- trunk/src/http/modules/ngx_http_gzip_filter_module.c 2012-02-13 15:20:49 UTC (rev 4468) +++ trunk/src/http/modules/ngx_http_gzip_filter_module.c 2012-02-13 15:23:43 UTC (rev 4469) @@ -759,6 +759,7 @@ ngx_http_gzip_filter_deflate(ngx_http_request_t *r, ngx_http_gzip_ctx_t *ctx) { int rc; + ngx_buf_t *b; ngx_chain_t *cl; ngx_http_gzip_conf_t *conf; @@ -770,7 +771,7 @@ rc = deflate(&ctx->zstream, ctx->flush); - if (rc != Z_OK && rc != Z_STREAM_END) { + if (rc != Z_OK && rc != Z_STREAM_END && rc != Z_BUF_ERROR) { ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, "deflate() failed: %d, %d", ctx->flush, rc); return NGX_ERROR; @@ -819,8 +820,6 @@ if (ctx->flush == Z_SYNC_FLUSH) { - ctx->zstream.avail_out = 0; - ctx->out_buf->flush = 1; ctx->flush = Z_NO_FLUSH; cl = ngx_alloc_chain_link(r->pool); @@ -828,7 +827,22 @@ return NGX_ERROR; } - cl->buf = ctx->out_buf; + b = ctx->out_buf; + + if (ngx_buf_size(b) == 0) { + + b = ngx_calloc_buf(ctx->request->pool); + if (b == NULL) { + return NGX_ERROR; + } + + } else { + ctx->zstream.avail_out = 0; + } + + b->flush = 1; + + cl->buf = b; cl->next = NULL; *ctx->last_out = cl; ctx->last_out = &cl->next; From mdounin at mdounin.ru Mon Feb 13 15:28:19 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 13 Feb 2012 15:28:19 +0000 Subject: [nginx] svn commit: r4470 - trunk/src/http Message-ID: <20120213152819.D75BE3F9CA9@mail.nginx.com> Author: mdounin Date: 2012-02-13 15:28:19 +0000 (Mon, 13 Feb 2012) New Revision: 4470 Log: Fix for proxy_store leaving temporary files for subrequests. Temporary files might not be removed if the "proxy_store" or "fastcgi_store" directives were used for subrequests (e.g. ssi includes) and client closed connection prematurely. Non-active subrequests are finalized out of the control of the upstream module when client closes a connection. As a result, the code to remove unfinished temporary files in ngx_http_upstream_process_request() wasn't executed. Fix is to move relevant code into ngx_http_upstream_finalize_request() which is called in all cases, either directly or via the cleanup handler. Modified: trunk/src/http/ngx_http_upstream.c Modified: trunk/src/http/ngx_http_upstream.c =================================================================== --- trunk/src/http/ngx_http_upstream.c 2012-02-13 15:23:43 UTC (rev 4469) +++ trunk/src/http/ngx_http_upstream.c 2012-02-13 15:28:19 UTC (rev 4470) @@ -2651,7 +2651,6 @@ static void ngx_http_upstream_process_request(ngx_http_request_t *r) { - ngx_uint_t del; ngx_temp_file_t *tf; ngx_event_pipe_t *p; ngx_http_upstream_t *u; @@ -2663,32 +2662,18 @@ if (u->store) { - del = p->upstream_error; - - tf = u->pipe->temp_file; - if (p->upstream_eof || p->upstream_done) { + tf = u->pipe->temp_file; + if (u->headers_in.status_n == NGX_HTTP_OK && (u->headers_in.content_length_n == -1 || (u->headers_in.content_length_n == tf->offset))) { ngx_http_upstream_store(r, u); - - } else { - del = 1; + u->store = 0; } } - - if (del && tf->file.fd != NGX_INVALID_FILE) { - - if (ngx_delete_file(tf->file.name.data) == NGX_FILE_ERROR) { - - ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, - ngx_delete_file_n " \"%s\" failed", - u->pipe->temp_file->file.name.data); - } - } } #if (NGX_HTTP_CACHE) @@ -3049,6 +3034,18 @@ u->pipe->temp_file->file.fd); } + if (u->store && u->pipe && u->pipe->temp_file + && u->pipe->temp_file->file.fd != NGX_INVALID_FILE) + { + if (ngx_delete_file(u->pipe->temp_file->file.name.data) + == NGX_FILE_ERROR) + { + ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, + ngx_delete_file_n " \"%s\" failed", + u->pipe->temp_file->file.name.data); + } + } + #if (NGX_HTTP_CACHE) if (r->cache) { From mdounin at mdounin.ru Mon Feb 13 15:31:08 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 13 Feb 2012 15:31:08 +0000 Subject: [nginx] svn commit: r4471 - trunk/src/http Message-ID: <20120213153108.9A6733F9CA9@mail.nginx.com> Author: mdounin Date: 2012-02-13 15:31:07 +0000 (Mon, 13 Feb 2012) New Revision: 4471 Log: Variables: honor no_cacheable for not_found variables. Variables with the "not_found" flag set follow the same rules as ones with the "valid" flag set. Make sure ngx_http_get_flushed_variable() will flush non-cacheable variables with the "not_found" flag set. This fixes at least one known problem with $args not available in a subrequest (with args) when there were no args in the main request and $args variable was queried in the main request (reported by Laurence Rowe aka elro on irc). Also this eliminates unneeded call to ngx_http_get_indexed_variable() in cacheable case (as it will return cached value anyway). Modified: trunk/src/http/ngx_http_variables.c Modified: trunk/src/http/ngx_http_variables.c =================================================================== --- trunk/src/http/ngx_http_variables.c 2012-02-13 15:28:19 UTC (rev 4470) +++ trunk/src/http/ngx_http_variables.c 2012-02-13 15:31:07 UTC (rev 4471) @@ -432,7 +432,7 @@ v = &r->variables[index]; - if (v->valid) { + if (v->valid || v->not_found) { if (!v->no_cacheable) { return v; } From mdounin at mdounin.ru Mon Feb 13 15:33:08 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 13 Feb 2012 15:33:08 +0000 Subject: [nginx] svn commit: r4472 - trunk/src/http Message-ID: <20120213153308.EBC563F9CE2@mail.nginx.com> Author: mdounin Date: 2012-02-13 15:33:08 +0000 (Mon, 13 Feb 2012) New Revision: 4472 Log: Core: protection from subrequest loops. Without the protection, subrequest loop results in r->count overflow and SIGSEGV. Protection was broken in 0.7.25. Note that this also limits number of parallel subrequests. This wasn't exactly the case before 0.7.25 as local subrequests were completed directly. See here for details: http://nginx.org/pipermail/nginx-ru/2010-February/032184.html Modified: trunk/src/http/ngx_http_core_module.c trunk/src/http/ngx_http_request.c Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-02-13 15:31:07 UTC (rev 4471) +++ trunk/src/http/ngx_http_core_module.c 2012-02-13 15:33:08 UTC (rev 4472) @@ -2453,7 +2453,6 @@ sr->start_sec = tp->sec; sr->start_msec = tp->msec; - r->main->subrequests++; r->main->count++; *psr = sr; Modified: trunk/src/http/ngx_http_request.c =================================================================== --- trunk/src/http/ngx_http_request.c 2012-02-13 15:31:07 UTC (rev 4471) +++ trunk/src/http/ngx_http_request.c 2012-02-13 15:33:08 UTC (rev 4472) @@ -2010,6 +2010,7 @@ if (r == c->data) { r->main->count--; + r->main->subrequests++; if (!r->logged) { From mdounin at mdounin.ru Mon Feb 13 15:35:48 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 13 Feb 2012 15:35:48 +0000 Subject: [nginx] svn commit: r4473 - trunk/src/http Message-ID: <20120213153548.6C4A53F9CE2@mail.nginx.com> Author: mdounin Date: 2012-02-13 15:35:48 +0000 (Mon, 13 Feb 2012) New Revision: 4473 Log: Core: protection from cycles with named locations and post_action. Now redirects to named locations are counted against normal uri changes limit, and post_action respects this limit as well. As a result at least the following (bad) configurations no longer trigger infinite cycles: 1. Post action which recursively triggers post action: location / { post_action /index.html; } 2. Post action pointing to nonexistent named location: location / { post_action @nonexistent; } 3. Recursive error page for 500 (Internal Server Error) pointing to a nonexistent named location: location / { recursive_error_pages on; error_page 500 @nonexistent; return 500; } Modified: trunk/src/http/ngx_http_core_module.c trunk/src/http/ngx_http_request.c Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-02-13 15:33:08 UTC (rev 4472) +++ trunk/src/http/ngx_http_core_module.c 2012-02-13 15:35:48 UTC (rev 4473) @@ -2524,7 +2524,17 @@ ngx_http_core_main_conf_t *cmcf; r->main->count++; + r->uri_changes--; + if (r->uri_changes == 0) { + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "rewrite or internal redirection cycle " + "while redirect to named location \"%V\"", name); + + ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); + return NGX_DONE; + } + cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); if (cscf->named_locations) { Modified: trunk/src/http/ngx_http_request.c =================================================================== --- trunk/src/http/ngx_http_request.c 2012-02-13 15:33:08 UTC (rev 4472) +++ trunk/src/http/ngx_http_request.c 2012-02-13 15:35:48 UTC (rev 4473) @@ -2928,6 +2928,10 @@ return NGX_DECLINED; } + if (r->post_action && r->uri_changes == 0) { + return NGX_DECLINED; + } + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "post action: \"%V\"", &clcf->post_action); From mdounin at mdounin.ru Mon Feb 13 15:38:49 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 13 Feb 2012 15:38:49 +0000 Subject: [nginx] svn commit: r4474 - in trunk: auto/lib/perl src/http/modules/perl Message-ID: <20120213153849.B7AA53FA8CF@mail.nginx.com> Author: mdounin Date: 2012-02-13 15:38:48 +0000 (Mon, 13 Feb 2012) New Revision: 4474 Log: Fixed build with embedded perl and --with-openssl. Modified: trunk/auto/lib/perl/make trunk/src/http/modules/perl/Makefile.PL Modified: trunk/auto/lib/perl/make =================================================================== --- trunk/auto/lib/perl/make 2012-02-13 15:35:48 UTC (rev 4473) +++ trunk/auto/lib/perl/make 2012-02-13 15:38:48 UTC (rev 4474) @@ -28,6 +28,7 @@ && NGX_PM_CFLAGS="\$(NGX_PM_CFLAGS) -g $NGX_CC_OPT" \ NGX_PCRE=$PCRE \ NGX_OBJS=$NGX_OBJS \ + NGX_OPENSSL=$OPENSSL \ $NGX_PERL Makefile.PL \ LIB=$NGX_PERL_MODULES \ INSTALLSITEMAN3DIR=$NGX_PERL_MODULES_MAN Modified: trunk/src/http/modules/perl/Makefile.PL =================================================================== --- trunk/src/http/modules/perl/Makefile.PL 2012-02-13 15:35:48 UTC (rev 4473) +++ trunk/src/http/modules/perl/Makefile.PL 2012-02-13 15:38:48 UTC (rev 4474) @@ -25,7 +25,11 @@ "-I ../../../../../$ENV{NGX_OBJS} " . ($ENV{NGX_PCRE} =~ /^(YES|NO)/ ? "" : ($ENV{NGX_PCRE} =~ m#^/# ? "-I $ENV{NGX_PCRE} " : - "-I ../../../../../$ENV{NGX_PCRE} ")), + "-I ../../../../../$ENV{NGX_PCRE} ")) . + ($ENV{NGX_OPENSSL} =~ /^(YES|NO)/ ? "" : + ($ENV{NGX_OPENSSL} =~ m#^/# ? + "-I $ENV{NGX_OPENSSL}/.openssl/include " : + "-I ../../../../../$ENV{NGX_OPENSSL}/.openssl/include ")), depend => { 'nginx.c' => From mdounin at mdounin.ru Mon Feb 13 15:41:11 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 13 Feb 2012 15:41:11 +0000 Subject: [nginx] svn commit: r4475 - in trunk/src: core http http/modules mail Message-ID: <20120213154112.025CA3FA88C@mail.nginx.com> Author: mdounin Date: 2012-02-13 15:41:11 +0000 (Mon, 13 Feb 2012) New Revision: 4475 Log: Time parsing cleanup. Nuke NGX_PARSE_LARGE_TIME, it's not used since 0.6.30. The only error ngx_parse_time() can currently return is NGX_ERROR, check it explicitly and make sure to cast it to appropriate type (either time_t or ngx_msec_t) to avoid signedness warnings on platforms with unsigned time_t (notably QNX). Modified: trunk/src/core/ngx_conf_file.c trunk/src/core/ngx_parse.h trunk/src/core/ngx_resolver.c trunk/src/http/modules/ngx_http_headers_filter_module.c trunk/src/http/modules/ngx_http_log_module.c trunk/src/http/modules/ngx_http_userid_filter_module.c trunk/src/http/ngx_http_busy_lock.c trunk/src/http/ngx_http_core_module.c trunk/src/http/ngx_http_file_cache.c trunk/src/http/ngx_http_upstream.c trunk/src/mail/ngx_mail_core_module.c Modified: trunk/src/core/ngx_conf_file.c =================================================================== --- trunk/src/core/ngx_conf_file.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/core/ngx_conf_file.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -1295,10 +1295,6 @@ return "invalid value"; } - if (*msp == (ngx_msec_t) NGX_PARSE_LARGE_TIME) { - return "value must be less than 597 hours"; - } - if (cmd->post) { post = cmd->post; return post->post_handler(cf, post, msp); @@ -1326,14 +1322,10 @@ value = cf->args->elts; *sp = ngx_parse_time(&value[1], 1); - if (*sp == NGX_ERROR) { + if (*sp == (time_t) NGX_ERROR) { return "invalid value"; } - if (*sp == NGX_PARSE_LARGE_TIME) { - return "value must be less than 68 years"; - } - if (cmd->post) { post = cmd->post; return post->post_handler(cf, post, sp); Modified: trunk/src/core/ngx_parse.h =================================================================== --- trunk/src/core/ngx_parse.h 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/core/ngx_parse.h 2012-02-13 15:41:11 UTC (rev 4475) @@ -13,9 +13,6 @@ #include -#define NGX_PARSE_LARGE_TIME -2 - - ssize_t ngx_parse_size(ngx_str_t *line); off_t ngx_parse_offset(ngx_str_t *line); ngx_int_t ngx_parse_time(ngx_str_t *line, ngx_uint_t is_sec); Modified: trunk/src/core/ngx_resolver.c =================================================================== --- trunk/src/core/ngx_resolver.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/core/ngx_resolver.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -160,7 +160,7 @@ r->valid = ngx_parse_time(&s, 1); - if (r->valid == NGX_ERROR) { + if (r->valid == (time_t) NGX_ERROR) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter: %V", &names[i]); return NULL; Modified: trunk/src/http/modules/ngx_http_headers_filter_module.c =================================================================== --- trunk/src/http/modules/ngx_http_headers_filter_module.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/http/modules/ngx_http_headers_filter_module.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -530,7 +530,7 @@ hcf->expires_time = ngx_parse_time(&value[n], 1); - if (hcf->expires_time == NGX_ERROR) { + if (hcf->expires_time == (time_t) NGX_ERROR) { return "invalid value"; } @@ -540,10 +540,6 @@ return "daily time value must be less than 24 hours"; } - if (hcf->expires_time == NGX_PARSE_LARGE_TIME) { - return "value must be less than 68 years"; - } - if (minus) { hcf->expires_time = - hcf->expires_time; } Modified: trunk/src/http/modules/ngx_http_log_module.c =================================================================== --- trunk/src/http/modules/ngx_http_log_module.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/http/modules/ngx_http_log_module.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -1249,7 +1249,7 @@ s.data = value[i].data + 9; inactive = ngx_parse_time(&s, 1); - if (inactive < 0) { + if (inactive == (time_t) NGX_ERROR) { goto failed; } @@ -1272,7 +1272,7 @@ s.data = value[i].data + 6; valid = ngx_parse_time(&s, 1); - if (valid < 0) { + if (valid == (time_t) NGX_ERROR) { goto failed; } Modified: trunk/src/http/modules/ngx_http_userid_filter_module.c =================================================================== --- trunk/src/http/modules/ngx_http_userid_filter_module.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/http/modules/ngx_http_userid_filter_module.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -774,14 +774,10 @@ } ucf->expires = ngx_parse_time(&value[1], 1); - if (ucf->expires == NGX_ERROR) { + if (ucf->expires == (time_t) NGX_ERROR) { return "invalid value"; } - if (ucf->expires == NGX_PARSE_LARGE_TIME) { - return "value must be less than 68 years"; - } - return NGX_CONF_OK; } Modified: trunk/src/http/ngx_http_busy_lock.c =================================================================== --- trunk/src/http/ngx_http_busy_lock.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/http/ngx_http_busy_lock.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -274,7 +274,7 @@ line.data = value[i].data + 2; bl->timeout = ngx_parse_time(&line, 1); - if (bl->timeout == NGX_ERROR) { + if (bl->timeout == (time_t) NGX_ERROR) { invalid = 1; break; } Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/http/ngx_http_core_module.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -3853,7 +3853,7 @@ s.len = p - s.data; lsopt.tcp_keepidle = ngx_parse_time(&s, 1); - if (lsopt.tcp_keepidle == NGX_ERROR) { + if (lsopt.tcp_keepidle == (time_t) NGX_ERROR) { goto invalid_so_keepalive; } } @@ -3869,7 +3869,7 @@ s.len = p - s.data; lsopt.tcp_keepintvl = ngx_parse_time(&s, 1); - if (lsopt.tcp_keepintvl == NGX_ERROR) { + if (lsopt.tcp_keepintvl == (time_t) NGX_ERROR) { goto invalid_so_keepalive; } } @@ -4516,7 +4516,7 @@ s.data = value[i].data + 9; inactive = ngx_parse_time(&s, 1); - if (inactive < 0) { + if (inactive == (time_t) NGX_ERROR) { goto failed; } @@ -4603,24 +4603,16 @@ return "invalid value"; } - if (clcf->keepalive_timeout == (ngx_msec_t) NGX_PARSE_LARGE_TIME) { - return "value must be less than 597 hours"; - } - if (cf->args->nelts == 2) { return NGX_CONF_OK; } clcf->keepalive_header = ngx_parse_time(&value[2], 1); - if (clcf->keepalive_header == NGX_ERROR) { + if (clcf->keepalive_header == (time_t) NGX_ERROR) { return "invalid value"; } - if (clcf->keepalive_header == NGX_PARSE_LARGE_TIME) { - return "value must be less than 68 years"; - } - return NGX_CONF_OK; } Modified: trunk/src/http/ngx_http_file_cache.c =================================================================== --- trunk/src/http/ngx_http_file_cache.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/http/ngx_http_file_cache.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -1597,7 +1597,8 @@ time_t inactive; ssize_t size; ngx_str_t s, name, *value; - ngx_int_t loader_files, loader_sleep, loader_threshold; + ngx_int_t loader_files; + ngx_msec_t loader_sleep, loader_threshold; ngx_uint_t i, n; ngx_http_file_cache_t *cache; @@ -1704,7 +1705,7 @@ s.data = value[i].data + 9; inactive = ngx_parse_time(&s, 1); - if (inactive < 0) { + if (inactive == (time_t) NGX_ERROR) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid inactive value \"%V\"", &value[i]); return NGX_CONF_ERROR; @@ -1746,7 +1747,7 @@ s.data = value[i].data + 13; loader_sleep = ngx_parse_time(&s, 0); - if (loader_sleep < 0) { + if (loader_sleep == (ngx_msec_t) NGX_ERROR) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid loader_sleep value \"%V\"", &value[i]); return NGX_CONF_ERROR; @@ -1761,7 +1762,7 @@ s.data = value[i].data + 17; loader_threshold = ngx_parse_time(&s, 0); - if (loader_threshold < 0) { + if (loader_threshold == (ngx_msec_t) NGX_ERROR) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid loader_threshold value \"%V\"", &value[i]); return NGX_CONF_ERROR; @@ -1788,8 +1789,8 @@ cache->path->conf_file = cf->conf_file->file.name.data; cache->path->line = cf->conf_file->line; cache->loader_files = loader_files; - cache->loader_sleep = (ngx_msec_t) loader_sleep; - cache->loader_threshold = (ngx_msec_t) loader_threshold; + cache->loader_sleep = loader_sleep; + cache->loader_threshold = loader_threshold; if (ngx_add_path(cf, &cache->path) != NGX_OK) { return NGX_CONF_ERROR; @@ -1843,7 +1844,7 @@ n = cf->args->nelts - 1; valid = ngx_parse_time(&value[n], 1); - if (valid < 0) { + if (valid == (time_t) NGX_ERROR) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid time value \"%V\"", &value[n]); return NGX_CONF_ERROR; Modified: trunk/src/http/ngx_http_upstream.c =================================================================== --- trunk/src/http/ngx_http_upstream.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/http/ngx_http_upstream.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -4268,7 +4268,7 @@ fail_timeout = ngx_parse_time(&s, 1); - if (fail_timeout == NGX_ERROR) { + if (fail_timeout == (time_t) NGX_ERROR) { goto invalid; } Modified: trunk/src/mail/ngx_mail_core_module.c =================================================================== --- trunk/src/mail/ngx_mail_core_module.c 2012-02-13 15:38:48 UTC (rev 4474) +++ trunk/src/mail/ngx_mail_core_module.c 2012-02-13 15:41:11 UTC (rev 4475) @@ -479,7 +479,7 @@ s.len = p - s.data; ls->tcp_keepidle = ngx_parse_time(&s, 1); - if (ls->tcp_keepidle == NGX_ERROR) { + if (ls->tcp_keepidle == (time_t) NGX_ERROR) { goto invalid_so_keepalive; } } @@ -495,7 +495,7 @@ s.len = p - s.data; ls->tcp_keepintvl = ngx_parse_time(&s, 1); - if (ls->tcp_keepintvl == NGX_ERROR) { + if (ls->tcp_keepintvl == (time_t) NGX_ERROR) { goto invalid_so_keepalive; } } From noreply at nginx.com Mon Feb 13 16:13:21 2012 From: noreply at nginx.com (noreply at nginx.com) Date: Mon, 13 Feb 2012 16:13:21 +0000 Subject: [nginx] svn commit: r4476 - in trunk: auto src/os/unix Message-ID: <20120213161322.1F3C13F9CA0@mail.nginx.com> Author: defan Date: 2012-02-13 16:13:21 +0000 (Mon, 13 Feb 2012) New Revision: 4476 Log: Added openat()/fstatat(). Modified: trunk/auto/unix trunk/src/os/unix/ngx_errno.h trunk/src/os/unix/ngx_files.h Modified: trunk/auto/unix =================================================================== --- trunk/auto/unix 2012-02-13 15:41:11 UTC (rev 4475) +++ trunk/auto/unix 2012-02-13 16:13:21 UTC (rev 4476) @@ -731,3 +731,17 @@ ngx_feature_libs= ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)" . auto/feature + + +ngx_feature="openat(), fstatat()" +ngx_feature_name="NGX_HAVE_OPENAT" +ngx_feature_run=no +ngx_feature_incs="#include + #include + #include " +ngx_feature_path= +ngx_feature_libs= +ngx_feature_test="struct stat sb; + openat(AT_FDCWD, \".\", O_RDONLY|O_NOFOLLOW); + fstatat(AT_FDCWD, \".\", &sb, AT_SYMLINK_NOFOLLOW);" +. auto/feature Modified: trunk/src/os/unix/ngx_errno.h =================================================================== --- trunk/src/os/unix/ngx_errno.h 2012-02-13 15:41:11 UTC (rev 4475) +++ trunk/src/os/unix/ngx_errno.h 2012-02-13 16:13:21 UTC (rev 4476) @@ -48,6 +48,11 @@ #define NGX_EILSEQ EILSEQ #define NGX_ENOMOREFILES 0 +#if (NGX_HAVE_OPENAT) +#define NGX_EMLINK EMLINK +#define NGX_ELOOP ELOOP +#endif + #if (__hpux__) #define NGX_EAGAIN EWOULDBLOCK #else Modified: trunk/src/os/unix/ngx_files.h =================================================================== --- trunk/src/os/unix/ngx_files.h 2012-02-13 15:41:11 UTC (rev 4475) +++ trunk/src/os/unix/ngx_files.h 2012-02-13 16:13:21 UTC (rev 4476) @@ -76,6 +76,10 @@ #define NGX_FILE_APPEND O_WRONLY|O_APPEND #define NGX_FILE_NONBLOCK O_NONBLOCK +#if (NGX_HAVE_OPENAT) +#define NGX_FILE_NOFOLLOW O_NOFOLLOW +#endif + #define NGX_FILE_DEFAULT_ACCESS 0644 #define NGX_FILE_OWNER_ACCESS 0600 @@ -324,6 +328,21 @@ size_t ngx_fs_bsize(u_char *name); +#if (NGX_HAVE_OPENAT) + +#define ngx_openat_file(fd, name, mode, create, access) \ + openat(fd, (const char *) name, mode|create, access) + +#define ngx_openat_file_n "openat()" + +#define ngx_file_at_info(fd, name, sb, flag) \ + fstatat(fd, (const char *) name, sb, flag) + +#define ngx_file_at_info_n "fstatat()" + +#endif + + #define ngx_stderr STDERR_FILENO #define ngx_set_stderr(fd) dup2(fd, STDERR_FILENO) #define ngx_set_stderr_n "dup2(STDERR_FILENO)" From noreply at nginx.com Mon Feb 13 16:16:45 2012 From: noreply at nginx.com (noreply at nginx.com) Date: Mon, 13 Feb 2012 16:16:45 +0000 Subject: [nginx] svn commit: r4477 - trunk/src/core Message-ID: <20120213161645.91C2D3F9CA0@mail.nginx.com> Author: defan Date: 2012-02-13 16:16:45 +0000 (Mon, 13 Feb 2012) New Revision: 4477 Log: Changed ngx_open_and_stat_file() to use ngx_str_t. No functional changes. Modified: trunk/src/core/ngx_open_file_cache.c Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-13 16:13:21 UTC (rev 4476) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-13 16:16:45 UTC (rev 4477) @@ -22,8 +22,8 @@ static void ngx_open_file_cache_cleanup(void *data); -static ngx_int_t ngx_open_and_stat_file(u_char *name, ngx_open_file_info_t *of, - ngx_log_t *log); +static ngx_int_t ngx_open_and_stat_file(ngx_str_t *name, + ngx_open_file_info_t *of, ngx_log_t *log); static void ngx_open_file_add_event(ngx_open_file_cache_t *cache, ngx_cached_open_file_t *file, ngx_open_file_info_t *of, ngx_log_t *log); static void ngx_open_file_cleanup(void *data); @@ -170,7 +170,7 @@ return NGX_ERROR; } - rc = ngx_open_and_stat_file(name->data, of, pool->log); + rc = ngx_open_and_stat_file(name, of, pool->log); if (rc == NGX_OK && !of->is_dir) { cln->handler = ngx_pool_cleanup_file; @@ -205,7 +205,7 @@ /* file was not used often enough to keep open */ - rc = ngx_open_and_stat_file(name->data, of, pool->log); + rc = ngx_open_and_stat_file(name, of, pool->log); if (rc != NGX_OK && (of->err == 0 || !of->errors)) { goto failed; @@ -263,7 +263,7 @@ of->fd = file->fd; of->uniq = file->uniq; - rc = ngx_open_and_stat_file(name->data, of, pool->log); + rc = ngx_open_and_stat_file(name, of, pool->log); if (rc != NGX_OK && (of->err == 0 || !of->errors)) { goto failed; @@ -311,8 +311,7 @@ if (ngx_close_file(file->fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno, - ngx_close_file_n " \"%s\" failed", - name->data); + ngx_close_file_n " \"%V\" failed", name); } goto add_event; @@ -329,7 +328,7 @@ /* not found */ - rc = ngx_open_and_stat_file(name->data, of, pool->log); + rc = ngx_open_and_stat_file(name, of, pool->log); if (rc != NGX_OK && (of->err == 0 || !of->errors)) { goto failed; @@ -452,7 +451,7 @@ if (of->fd != NGX_INVALID_FILE) { if (ngx_close_file(of->fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno, - ngx_close_file_n " \"%s\" failed", name->data); + ngx_close_file_n " \"%V\" failed", name); } } @@ -461,14 +460,15 @@ static ngx_int_t -ngx_open_and_stat_file(u_char *name, ngx_open_file_info_t *of, ngx_log_t *log) +ngx_open_and_stat_file(ngx_str_t *name, ngx_open_file_info_t *of, + ngx_log_t *log) { ngx_fd_t fd; ngx_file_info_t fi; if (of->fd != NGX_INVALID_FILE) { - if (ngx_file_info(name, &fi) == NGX_FILE_ERROR) { + if (ngx_file_info(name->data, &fi) == NGX_FILE_ERROR) { of->failed = ngx_file_info_n; goto failed; } @@ -479,7 +479,7 @@ } else if (of->test_dir) { - if (ngx_file_info(name, &fi) == NGX_FILE_ERROR) { + if (ngx_file_info(name->data, &fi) == NGX_FILE_ERROR) { of->failed = ngx_file_info_n; goto failed; } @@ -496,11 +496,12 @@ * This flag has no effect on a regular files. */ - fd = ngx_open_file(name, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + fd = ngx_open_file(name->data, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, NGX_FILE_OPEN, 0); } else { - fd = ngx_open_file(name, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN, + fd = ngx_open_file(name->data, NGX_FILE_APPEND, + NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS); } @@ -511,11 +512,11 @@ if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_CRIT, log, ngx_errno, - ngx_fd_info_n " \"%s\" failed", name); + ngx_fd_info_n " \"%V\" failed", name); if (ngx_close_file(fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, - ngx_close_file_n " \"%s\" failed", name); + ngx_close_file_n " \"%V\" failed", name); } of->fd = NGX_INVALID_FILE; @@ -526,7 +527,7 @@ if (ngx_is_dir(&fi)) { if (ngx_close_file(fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, - ngx_close_file_n " \"%s\" failed", name); + ngx_close_file_n " \"%V\" failed", name); } of->fd = NGX_INVALID_FILE; @@ -537,14 +538,14 @@ if (of->read_ahead && ngx_file_size(&fi) > NGX_MIN_READ_AHEAD) { if (ngx_read_ahead(fd, of->read_ahead) == NGX_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, - ngx_read_ahead_n " \"%s\" failed", name); + ngx_read_ahead_n " \"%V\" failed", name); } } if (of->directio <= ngx_file_size(&fi)) { if (ngx_directio_on(fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, - ngx_directio_on_n " \"%s\" failed", name); + ngx_directio_on_n " \"%V\" failed", name); } else { of->is_directio = 1; From defan at nginx.com Mon Feb 13 16:29:04 2012 From: defan at nginx.com (defan at nginx.com) Date: Mon, 13 Feb 2012 16:29:04 +0000 Subject: [nginx] svn commit: r4478 - in trunk/src: core http Message-ID: <20120213162905.054613FA869@mail.nginx.com> Author: defan Date: 2012-02-13 16:29:04 +0000 (Mon, 13 Feb 2012) New Revision: 4478 Log: Added disable_symlinks directive. To completely disable symlinks (disable_symlinks on) we use openat(O_NOFOLLOW) for each path component to avoid races. To allow symlinks with the same owner (disable_symlinks if_not_owner), use openat() (followed by fstat()) and fstatat(AT_SYMLINK_NOFOLLOW), and then compare uids between fstat() and fstatat(). As there is a race between openat() and fstatat() we don't know if openat() in fact opened symlink or not. Therefore, we have to compare uids even if fstatat() reports the opened component isn't a symlink (as we don't know whether it was symlink during openat() or not). Default value is off, i.e. symlinks are allowed. Modified: trunk/src/core/ngx_core.h trunk/src/core/ngx_open_file_cache.c trunk/src/core/ngx_open_file_cache.h trunk/src/http/ngx_http_core_module.c trunk/src/http/ngx_http_core_module.h Modified: trunk/src/core/ngx_core.h =================================================================== --- trunk/src/core/ngx_core.h 2012-02-13 16:16:45 UTC (rev 4477) +++ trunk/src/core/ngx_core.h 2012-02-13 16:29:04 UTC (rev 4478) @@ -91,5 +91,10 @@ void ngx_cpuinfo(void); +#if (NGX_HAVE_OPENAT) +#define NGX_DISABLE_SYMLINKS_OFF 0 +#define NGX_DISABLE_SYMLINKS_ON 1 +#define NGX_DISABLE_SYMLINKS_NOTOWNER 2 +#endif #endif /* _NGX_CORE_H_INCLUDED_ */ Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-13 16:16:45 UTC (rev 4477) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-13 16:29:04 UTC (rev 4478) @@ -22,6 +22,15 @@ static void ngx_open_file_cache_cleanup(void *data); +#if (NGX_HAVE_OPENAT) +static ngx_fd_t ngx_openat_file_owner(ngx_fd_t at_fd, const u_char *name, + ngx_int_t mode, ngx_int_t create, ngx_int_t access); +#endif +static ngx_fd_t ngx_open_file_wrapper(ngx_str_t *name, + ngx_open_file_info_t *of, ngx_int_t mode, ngx_int_t create, + ngx_int_t access); +static ngx_int_t ngx_file_info_wrapper(ngx_str_t *name, + ngx_open_file_info_t *of, ngx_file_info_t *fi); static ngx_int_t ngx_open_and_stat_file(ngx_str_t *name, ngx_open_file_info_t *of, ngx_log_t *log); static void ngx_open_file_add_event(ngx_open_file_cache_t *cache, @@ -147,9 +156,7 @@ if (of->test_only) { - if (ngx_file_info(name->data, &fi) == NGX_FILE_ERROR) { - of->err = ngx_errno; - of->failed = ngx_file_info_n; + if (ngx_file_info_wrapper(name, of, &fi) == NGX_FILE_ERROR) { return NGX_ERROR; } @@ -217,7 +224,11 @@ if (file->use_event || (file->event == NULL && (of->uniq == 0 || of->uniq == file->uniq) - && now - file->created < of->valid)) + && now - file->created < of->valid +#if (NGX_HAVE_OPENAT) + && of->disable_symlinks == file->disable_symlinks +#endif + )) { if (file->err == 0) { @@ -239,7 +250,12 @@ } else { of->err = file->err; +#if (NGX_HAVE_OPENAT) + of->failed = file->disable_symlinks ? ngx_openat_file_n + : ngx_open_file_n; +#else of->failed = ngx_open_file_n; +#endif } goto found; @@ -375,6 +391,9 @@ file->fd = of->fd; file->err = of->err; +#if (NGX_HAVE_OPENAT) + file->disable_symlinks = of->disable_symlinks; +#endif if (of->err == 0) { file->uniq = of->uniq; @@ -459,7 +478,213 @@ } +#if (NGX_HAVE_OPENAT) + +static ngx_fd_t +ngx_openat_file_owner(ngx_fd_t at_fd, const u_char *name, + ngx_int_t mode, ngx_int_t create, ngx_int_t access) +{ + ngx_fd_t fd; + ngx_file_info_t fi, atfi; + + /* + * To allow symlinks with the same owner, use openat() (followed + * by fstat()) and fstatat(AT_SYMLINK_NOFOLLOW), and then compare + * uids between fstat() and fstatat(). + * + * As there is a race between openat() and fstatat() we don't + * know if openat() in fact opened symlink or not. Therefore, + * we have to compare uids even if fstatat() reports the opened + * component isn't a symlink (as we don't know whether it was + * symlink during openat() or not). + */ + + fd = ngx_openat_file(at_fd, name, mode, create, access); + + if (fd == NGX_FILE_ERROR) { + return NGX_FILE_ERROR; + } + + if (ngx_file_at_info(at_fd, name, &atfi, AT_SYMLINK_NOFOLLOW) + == NGX_FILE_ERROR) + { + ngx_close_file(fd); + return NGX_FILE_ERROR; + } + + if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) { + ngx_close_file(fd); + return NGX_FILE_ERROR; + } + + if (fi.st_uid != atfi.st_uid) { + ngx_close_file(fd); + ngx_set_errno(NGX_ELOOP); + return NGX_FILE_ERROR; + } + + return fd; +} + +#endif + + +static ngx_fd_t +ngx_open_file_wrapper(ngx_str_t *name, ngx_open_file_info_t *of, + ngx_int_t mode, ngx_int_t create, ngx_int_t access) +{ + ngx_fd_t fd; + +#if !(NGX_HAVE_OPENAT) + + fd = ngx_open_file(name->data, mode, create, access); + + if (fd == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_open_file_n; + return NGX_FILE_ERROR; + } + + return fd; + +#else + + u_char *p, *cp, *end; + ngx_fd_t at_fd; + + if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_OFF) { + fd = ngx_open_file(name->data, mode, create, access); + + if (fd == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_open_file_n; + return NGX_FILE_ERROR; + } + + return fd; + } + + at_fd = ngx_openat_file(AT_FDCWD, "/", NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + NGX_FILE_OPEN, 0); + + if (at_fd == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_openat_file_n; + return NGX_FILE_ERROR; + } + + end = name->data + name->len; + p = name->data + 1; + + for ( ;; ) { + cp = ngx_strlchr(p, end, '/'); + if (cp == NULL) { + break; + } + + *cp = '\0'; + + if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) { + fd = ngx_openat_file_owner(at_fd, p, + NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + NGX_FILE_OPEN, 0); + + } else { + fd = ngx_openat_file(at_fd, p, + NGX_FILE_RDONLY|NGX_FILE_NONBLOCK|NGX_FILE_NOFOLLOW, + NGX_FILE_OPEN, 0); + } + + *cp = '/'; + + ngx_close_file(at_fd); + + if (fd == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_openat_file_n; + return NGX_FILE_ERROR; + } + + p = cp + 1; + at_fd = fd; + } + + if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) { + fd = ngx_openat_file_owner(at_fd, p, mode, create, access); + + } else { + fd = ngx_openat_file(at_fd, p, mode|NGX_FILE_NOFOLLOW, create, access); + } + + if (fd == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_openat_file_n; + } + + ngx_close_file(at_fd); + + return fd; +#endif +} + + static ngx_int_t +ngx_file_info_wrapper(ngx_str_t *name, ngx_open_file_info_t *of, + ngx_file_info_t *fi) +{ + ngx_int_t rc; + +#if !(NGX_HAVE_OPENAT) + + rc = ngx_file_info(name->data, fi); + + if (rc == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_file_info_n; + return NGX_FILE_ERROR; + } + + return rc; + +#else + + ngx_fd_t fd; + + if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_OFF) { + + rc = ngx_file_info(name->data, fi); + + if (rc == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_file_info_n; + return NGX_FILE_ERROR; + } + + return rc; + } + + fd = ngx_open_file_wrapper(name, of, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + NGX_FILE_OPEN, 0); + + if (fd == NGX_FILE_ERROR) { + return NGX_FILE_ERROR; + } + + if (ngx_fd_info(fd, fi) == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_fd_info_n; + ngx_close_file(fd); + return NGX_FILE_ERROR; + } + + ngx_close_file(fd); + + return NGX_OK; +#endif +} + + +static ngx_int_t ngx_open_and_stat_file(ngx_str_t *name, ngx_open_file_info_t *of, ngx_log_t *log) { @@ -468,9 +693,9 @@ if (of->fd != NGX_INVALID_FILE) { - if (ngx_file_info(name->data, &fi) == NGX_FILE_ERROR) { - of->failed = ngx_file_info_n; - goto failed; + if (ngx_file_info_wrapper(name, of, &fi) == NGX_FILE_ERROR) { + of->fd = NGX_INVALID_FILE; + return NGX_ERROR; } if (of->uniq == ngx_file_uniq(&fi)) { @@ -479,9 +704,9 @@ } else if (of->test_dir) { - if (ngx_file_info(name->data, &fi) == NGX_FILE_ERROR) { - of->failed = ngx_file_info_n; - goto failed; + if (ngx_file_info_wrapper(name, of, &fi) == NGX_FILE_ERROR) { + of->fd = NGX_INVALID_FILE; + return NGX_ERROR; } if (ngx_is_dir(&fi)) { @@ -496,18 +721,18 @@ * This flag has no effect on a regular files. */ - fd = ngx_open_file(name->data, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, - NGX_FILE_OPEN, 0); + fd = ngx_open_file_wrapper(name, of, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + NGX_FILE_OPEN, 0); } else { - fd = ngx_open_file(name->data, NGX_FILE_APPEND, - NGX_FILE_CREATE_OR_OPEN, - NGX_FILE_DEFAULT_ACCESS); + fd = ngx_open_file_wrapper(name, of, NGX_FILE_APPEND, + NGX_FILE_CREATE_OR_OPEN, + NGX_FILE_DEFAULT_ACCESS); } if (fd == NGX_INVALID_FILE) { - of->failed = ngx_open_file_n; - goto failed; + of->fd = NGX_INVALID_FILE; + return NGX_ERROR; } if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) { @@ -565,13 +790,6 @@ of->is_exec = ngx_is_exec(&fi); return NGX_OK; - -failed: - - of->fd = NGX_INVALID_FILE; - of->err = ngx_errno; - - return NGX_ERROR; } Modified: trunk/src/core/ngx_open_file_cache.h =================================================================== --- trunk/src/core/ngx_open_file_cache.h 2012-02-13 16:16:45 UTC (rev 4477) +++ trunk/src/core/ngx_open_file_cache.h 2012-02-13 16:29:04 UTC (rev 4478) @@ -32,6 +32,10 @@ ngx_uint_t min_uses; +#if (NGX_HAVE_OPENAT) + unsigned disable_symlinks:2; +#endif + unsigned test_dir:1; unsigned test_only:1; unsigned log:1; @@ -64,6 +68,10 @@ uint32_t uses; +#if (NGX_HAVE_OPENAT) + unsigned disable_symlinks:2; +#endif + unsigned count:24; unsigned close:1; unsigned use_event:1; Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-02-13 16:16:45 UTC (rev 4477) +++ trunk/src/http/ngx_http_core_module.c 2012-02-13 16:29:04 UTC (rev 4478) @@ -187,6 +187,18 @@ #endif +#if (NGX_HAVE_OPENAT) + +static ngx_conf_enum_t ngx_http_core_disable_symlinks[] = { + { ngx_string("off"), NGX_DISABLE_SYMLINKS_OFF }, + { ngx_string("if_not_owner"), NGX_DISABLE_SYMLINKS_NOTOWNER }, + { ngx_string("on"), NGX_DISABLE_SYMLINKS_ON }, + { ngx_null_string, 0 } +}; + +#endif + + static ngx_command_t ngx_http_core_commands[] = { { ngx_string("variables_hash_max_size"), @@ -764,6 +776,17 @@ #endif +#if (NGX_HAVE_OPENAT) + + { ngx_string("disable_symlinks"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, + ngx_conf_set_enum_slot, + NGX_HTTP_LOC_CONF_OFFSET, + offsetof(ngx_http_core_loc_conf_t, disable_symlinks), + &ngx_http_core_disable_symlinks }, + +#endif + ngx_null_command }; @@ -1297,6 +1320,9 @@ of.test_only = 1; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) @@ -3344,6 +3370,10 @@ #endif #endif +#if (NGX_HAVE_OPENAT) + clcf->disable_symlinks = NGX_CONF_UNSET_UINT; +#endif + return clcf; } @@ -3623,6 +3653,11 @@ #endif #endif +#if (NGX_HAVE_OPENAT) + ngx_conf_merge_uint_value(conf->disable_symlinks, prev->disable_symlinks, + NGX_DISABLE_SYMLINKS_OFF); +#endif + return NGX_CONF_OK; } Modified: trunk/src/http/ngx_http_core_module.h =================================================================== --- trunk/src/http/ngx_http_core_module.h 2012-02-13 16:16:45 UTC (rev 4477) +++ trunk/src/http/ngx_http_core_module.h 2012-02-13 16:29:04 UTC (rev 4478) @@ -404,6 +404,10 @@ #endif #endif +#if (NGX_HAVE_OPENAT) + ngx_uint_t disable_symlinks; /* disable_symlinks */ +#endif + ngx_array_t *error_pages; /* error_page */ ngx_http_try_file_t *try_files; /* try_files */ From defan at nginx.com Mon Feb 13 16:32:22 2012 From: defan at nginx.com (defan at nginx.com) Date: Mon, 13 Feb 2012 16:32:22 +0000 Subject: [nginx] svn commit: r4479 - in trunk/src/http: . modules modules/perl Message-ID: <20120213163222.3436B3F9D01@mail.nginx.com> Author: defan Date: 2012-02-13 16:32:21 +0000 (Mon, 13 Feb 2012) New Revision: 4479 Log: Support for disable_symlinks in various modules. Modified: trunk/src/http/modules/ngx_http_flv_module.c trunk/src/http/modules/ngx_http_gzip_static_module.c trunk/src/http/modules/ngx_http_index_module.c trunk/src/http/modules/ngx_http_log_module.c trunk/src/http/modules/ngx_http_mp4_module.c trunk/src/http/modules/ngx_http_static_module.c trunk/src/http/modules/perl/nginx.xs trunk/src/http/ngx_http_script.c Modified: trunk/src/http/modules/ngx_http_flv_module.c =================================================================== --- trunk/src/http/modules/ngx_http_flv_module.c 2012-02-13 16:29:04 UTC (rev 4478) +++ trunk/src/http/modules/ngx_http_flv_module.c 2012-02-13 16:32:21 UTC (rev 4479) @@ -109,6 +109,9 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) @@ -127,6 +130,10 @@ break; case NGX_EACCES: +#if (NGX_HAVE_OPENAT) + case NGX_EMLINK: + case NGX_ELOOP: +#endif level = NGX_LOG_ERR; rc = NGX_HTTP_FORBIDDEN; Modified: trunk/src/http/modules/ngx_http_gzip_static_module.c =================================================================== --- trunk/src/http/modules/ngx_http_gzip_static_module.c 2012-02-13 16:29:04 UTC (rev 4478) +++ trunk/src/http/modules/ngx_http_gzip_static_module.c 2012-02-13 16:32:21 UTC (rev 4479) @@ -129,6 +129,9 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) @@ -145,6 +148,10 @@ return NGX_DECLINED; case NGX_EACCES: +#if (NGX_HAVE_OPENAT) + case NGX_EMLINK: + case NGX_ELOOP: +#endif level = NGX_LOG_ERR; break; Modified: trunk/src/http/modules/ngx_http_index_module.c =================================================================== --- trunk/src/http/modules/ngx_http_index_module.c 2012-02-13 16:29:04 UTC (rev 4478) +++ trunk/src/http/modules/ngx_http_index_module.c 2012-02-13 16:32:21 UTC (rev 4479) @@ -209,6 +209,9 @@ of.test_only = 1; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) @@ -220,6 +223,14 @@ return NGX_HTTP_INTERNAL_SERVER_ERROR; } +#if (NGX_HAVE_OPENAT) + if (of.err == NGX_EMLINK + || of.err == NGX_ELOOP) + { + return NGX_HTTP_FORBIDDEN; + } +#endif + if (of.err == NGX_ENOTDIR || of.err == NGX_ENAMETOOLONG || of.err == NGX_EACCES) @@ -296,12 +307,23 @@ of.test_only = 1; of.valid = clcf->open_file_cache_valid; of.errors = clcf->open_file_cache_errors; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool) != NGX_OK) { if (of.err) { +#if (NGX_HAVE_OPENAT) + if (of.err == NGX_EMLINK + || of.err == NGX_ELOOP) + { + return NGX_HTTP_FORBIDDEN; + } +#endif + if (of.err == NGX_ENOENT) { *last = c; return ngx_http_index_error(r, clcf, dir.data, NGX_ENOENT); Modified: trunk/src/http/modules/ngx_http_log_module.c =================================================================== --- trunk/src/http/modules/ngx_http_log_module.c 2012-02-13 16:29:04 UTC (rev 4478) +++ trunk/src/http/modules/ngx_http_log_module.c 2012-02-13 16:32:21 UTC (rev 4479) @@ -373,6 +373,8 @@ ngx_http_log_loc_conf_t *llcf; ngx_http_core_loc_conf_t *clcf; + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + if (!r->root_tested) { /* test root directory existance */ @@ -384,8 +386,6 @@ path.data[root] = '\0'; - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - ngx_memzero(&of, sizeof(ngx_open_file_info_t)); of.valid = clcf->open_file_cache_valid; @@ -394,6 +394,9 @@ of.test_only = 1; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) @@ -441,6 +444,9 @@ of.valid = llcf->open_file_cache_valid; of.min_uses = llcf->open_file_cache_min_uses; of.directio = NGX_OPEN_FILE_DIRECTIO_OFF; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) != NGX_OK) Modified: trunk/src/http/modules/ngx_http_mp4_module.c =================================================================== --- trunk/src/http/modules/ngx_http_mp4_module.c 2012-02-13 16:29:04 UTC (rev 4478) +++ trunk/src/http/modules/ngx_http_mp4_module.c 2012-02-13 16:32:21 UTC (rev 4479) @@ -440,6 +440,9 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) @@ -458,6 +461,10 @@ break; case NGX_EACCES: +#if (NGX_HAVE_OPENAT) + case NGX_EMLINK: + case NGX_ELOOP: +#endif level = NGX_LOG_ERR; rc = NGX_HTTP_FORBIDDEN; Modified: trunk/src/http/modules/ngx_http_static_module.c =================================================================== --- trunk/src/http/modules/ngx_http_static_module.c 2012-02-13 16:29:04 UTC (rev 4478) +++ trunk/src/http/modules/ngx_http_static_module.c 2012-02-13 16:32:21 UTC (rev 4479) @@ -94,6 +94,9 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) @@ -112,6 +115,10 @@ break; case NGX_EACCES: +#if (NGX_HAVE_OPENAT) + case NGX_EMLINK: + case NGX_ELOOP: +#endif level = NGX_LOG_ERR; rc = NGX_HTTP_FORBIDDEN; Modified: trunk/src/http/modules/perl/nginx.xs =================================================================== --- trunk/src/http/modules/perl/nginx.xs 2012-02-13 16:29:04 UTC (rev 4478) +++ trunk/src/http/modules/perl/nginx.xs 2012-02-13 16:32:21 UTC (rev 4479) @@ -662,6 +662,9 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) Modified: trunk/src/http/ngx_http_script.c =================================================================== --- trunk/src/http/ngx_http_script.c 2012-02-13 16:29:04 UTC (rev 4478) +++ trunk/src/http/ngx_http_script.c 2012-02-13 16:32:21 UTC (rev 4479) @@ -1505,6 +1505,9 @@ of.test_only = 1; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; +#if (NGX_HAVE_OPENAT) + of.disable_symlinks = clcf->disable_symlinks; +#endif if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) From wandenberg at gmail.com Tue Feb 14 02:02:38 2012 From: wandenberg at gmail.com (Wandenberg Peixoto) Date: Tue, 14 Feb 2012 00:02:38 -0200 Subject: Request inside a timer In-Reply-To: References: <87zkcqqpo1.wl%appa@perusio.net> <87wr7uqn1q.wl%appa@perusio.net> Message-ID: Hi, thanks for your responses. In fact, I already have written the module. What I want is reconfigure some values at some interval, getting the new values from another service. Is for this reason I need to do a request inside a timer, not from the nginx configuration or using another worker process just for that. If anyone can help me will be great. Regards, Wandenberg On Fri, Feb 10, 2012 at 9:58 PM, Alexandr Gomoliako wrote: > On Sat, Feb 11, 2012 at 1:35 AM, Ant?nio P. P. Almeida > wrote: > > On 10 Fev 2012 23h04 WET, zzz at zzz.org.ua wrote: > > > >> On Sat, Feb 11, 2012 at 12:39 AM, Ant?nio P. P. Almeida > >> wrote: > >>>> I would like to do a module which, at some interval, refresh part > >>>> of its configuration getting some values from a external > >>>> service. So I need to make a GET independent of a user request. > > > I think it can. Since right now you can create sockets right within > > the config. Therefore making the request from within is possible. As > > is processing the response and updating the config based on the values > > obtained. > > > > http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp > > > > What does your embedded Perl offer that you cannot accomplish with > > this? > > I don't think that task in question can be implemented with just this. > Or maybe I'm wrong, than show me how. > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zzz at zzz.org.ua Tue Feb 14 02:41:57 2012 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Tue, 14 Feb 2012 04:41:57 +0200 Subject: Request inside a timer In-Reply-To: References: <87zkcqqpo1.wl%appa@perusio.net> <87wr7uqn1q.wl%appa@perusio.net> Message-ID: On 2/14/12, Wandenberg Peixoto wrote: > In fact, I already have written the module. What I want is reconfigure some > values at some interval, getting the new values from another service. I guess you'll have to look for ngx_event_connect_peer as a starting point and implement this request yourself. I don't think there are any manuals for this, so just trace it. From mdounin at mdounin.ru Wed Feb 15 12:17:25 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Wed, 15 Feb 2012 12:17:25 +0000 Subject: [nginx] svn commit: r4480 - trunk/src/core Message-ID: <20120215121725.366073F9C1B@mail.nginx.com> Author: mdounin Date: 2012-02-15 12:17:24 +0000 (Wed, 15 Feb 2012) New Revision: 4480 Log: Disable symlinks: cleanup error handling. Notably this fixes NGX_INVALID_FILE/NGX_FILE_ERROR mess, and adds logging of close() errors. In collaboration with Valentin Bartenev. Modified: trunk/src/core/ngx_open_file_cache.c Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-13 16:32:21 UTC (rev 4479) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-15 12:17:24 UTC (rev 4480) @@ -24,13 +24,13 @@ static void ngx_open_file_cache_cleanup(void *data); #if (NGX_HAVE_OPENAT) static ngx_fd_t ngx_openat_file_owner(ngx_fd_t at_fd, const u_char *name, - ngx_int_t mode, ngx_int_t create, ngx_int_t access); + ngx_int_t mode, ngx_int_t create, ngx_int_t access, ngx_log_t *log); #endif static ngx_fd_t ngx_open_file_wrapper(ngx_str_t *name, ngx_open_file_info_t *of, ngx_int_t mode, ngx_int_t create, - ngx_int_t access); + ngx_int_t access, ngx_log_t *log); static ngx_int_t ngx_file_info_wrapper(ngx_str_t *name, - ngx_open_file_info_t *of, ngx_file_info_t *fi); + ngx_open_file_info_t *of, ngx_file_info_t *fi, ngx_log_t *log); static ngx_int_t ngx_open_and_stat_file(ngx_str_t *name, ngx_open_file_info_t *of, ngx_log_t *log); static void ngx_open_file_add_event(ngx_open_file_cache_t *cache, @@ -156,7 +156,9 @@ if (of->test_only) { - if (ngx_file_info_wrapper(name, of, &fi) == NGX_FILE_ERROR) { + if (ngx_file_info_wrapper(name, of, &fi, pool->log) + == NGX_FILE_ERROR) + { return NGX_ERROR; } @@ -482,9 +484,10 @@ static ngx_fd_t ngx_openat_file_owner(ngx_fd_t at_fd, const u_char *name, - ngx_int_t mode, ngx_int_t create, ngx_int_t access) + ngx_int_t mode, ngx_int_t create, ngx_int_t access, ngx_log_t *log) { ngx_fd_t fd; + ngx_err_t err; ngx_file_info_t fi, atfi; /* @@ -508,22 +511,32 @@ if (ngx_file_at_info(at_fd, name, &atfi, AT_SYMLINK_NOFOLLOW) == NGX_FILE_ERROR) { - ngx_close_file(fd); - return NGX_FILE_ERROR; + err = ngx_errno; + goto failed; } if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) { - ngx_close_file(fd); - return NGX_FILE_ERROR; + err = ngx_errno; + goto failed; } if (fi.st_uid != atfi.st_uid) { - ngx_close_file(fd); - ngx_set_errno(NGX_ELOOP); - return NGX_FILE_ERROR; + err = NGX_ELOOP; + goto failed; } return fd; + +failed: + + if (ngx_close_file(fd) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, + ngx_close_file_n " \"%V\" failed", name); + } + + ngx_set_errno(err); + + return NGX_INVALID_FILE; } #endif @@ -531,7 +544,7 @@ static ngx_fd_t ngx_open_file_wrapper(ngx_str_t *name, ngx_open_file_info_t *of, - ngx_int_t mode, ngx_int_t create, ngx_int_t access) + ngx_int_t mode, ngx_int_t create, ngx_int_t access, ngx_log_t *log) { ngx_fd_t fd; @@ -539,26 +552,27 @@ fd = ngx_open_file(name->data, mode, create, access); - if (fd == NGX_FILE_ERROR) { + if (fd == NGX_INVALID_FILE) { of->err = ngx_errno; of->failed = ngx_open_file_n; - return NGX_FILE_ERROR; + return NGX_INVALID_FILE; } return fd; #else - u_char *p, *cp, *end; - ngx_fd_t at_fd; + u_char *p, *cp, *end; + ngx_fd_t at_fd; + ngx_str_t at_name; if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_OFF) { fd = ngx_open_file(name->data, mode, create, access); - if (fd == NGX_FILE_ERROR) { + if (fd == NGX_INVALID_FILE) { of->err = ngx_errno; of->failed = ngx_open_file_n; - return NGX_FILE_ERROR; + return NGX_INVALID_FILE; } return fd; @@ -567,12 +581,15 @@ at_fd = ngx_openat_file(AT_FDCWD, "/", NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, NGX_FILE_OPEN, 0); - if (at_fd == NGX_FILE_ERROR) { + if (at_fd == NGX_INVALID_FILE) { of->err = ngx_errno; of->failed = ngx_openat_file_n; - return NGX_FILE_ERROR; + return NGX_INVALID_FILE; } + at_name = *name; + at_name.len = 1; + end = name->data + name->len; p = name->data + 1; @@ -587,7 +604,7 @@ if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) { fd = ngx_openat_file_owner(at_fd, p, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, - NGX_FILE_OPEN, 0); + NGX_FILE_OPEN, 0, log); } else { fd = ngx_openat_file(at_fd, p, @@ -597,32 +614,41 @@ *cp = '/'; - ngx_close_file(at_fd); - - if (fd == NGX_FILE_ERROR) { + if (fd == NGX_INVALID_FILE) { of->err = ngx_errno; of->failed = ngx_openat_file_n; - return NGX_FILE_ERROR; + goto failed; } + if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, + ngx_close_file_n " \"%V\" failed", at_name); + } + p = cp + 1; at_fd = fd; + at_name.len = cp - at_name.data; } if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) { - fd = ngx_openat_file_owner(at_fd, p, mode, create, access); + fd = ngx_openat_file_owner(at_fd, p, mode, create, access, log); } else { fd = ngx_openat_file(at_fd, p, mode|NGX_FILE_NOFOLLOW, create, access); } - if (fd == NGX_FILE_ERROR) { + if (fd == NGX_INVALID_FILE) { of->err = ngx_errno; of->failed = ngx_openat_file_n; } - ngx_close_file(at_fd); +failed: + if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, + ngx_close_file_n " \"%V\" failed", at_name); + } + return fd; #endif } @@ -630,7 +656,7 @@ static ngx_int_t ngx_file_info_wrapper(ngx_str_t *name, ngx_open_file_info_t *of, - ngx_file_info_t *fi) + ngx_file_info_t *fi, ngx_log_t *log) { ngx_int_t rc; @@ -664,22 +690,25 @@ } fd = ngx_open_file_wrapper(name, of, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, - NGX_FILE_OPEN, 0); + NGX_FILE_OPEN, 0, log); - if (fd == NGX_FILE_ERROR) { + if (fd == NGX_INVALID_FILE) { return NGX_FILE_ERROR; } - if (ngx_fd_info(fd, fi) == NGX_FILE_ERROR) { + rc = ngx_fd_info(fd, fi); + + if (rc == NGX_FILE_ERROR) { of->err = ngx_errno; of->failed = ngx_fd_info_n; - ngx_close_file(fd); - return NGX_FILE_ERROR; } - ngx_close_file(fd); + if (ngx_close_file(fd) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, + ngx_close_file_n " \"%V\" failed", name); + } - return NGX_OK; + return rc; #endif } @@ -693,7 +722,7 @@ if (of->fd != NGX_INVALID_FILE) { - if (ngx_file_info_wrapper(name, of, &fi) == NGX_FILE_ERROR) { + if (ngx_file_info_wrapper(name, of, &fi, log) == NGX_FILE_ERROR) { of->fd = NGX_INVALID_FILE; return NGX_ERROR; } @@ -704,7 +733,7 @@ } else if (of->test_dir) { - if (ngx_file_info_wrapper(name, of, &fi) == NGX_FILE_ERROR) { + if (ngx_file_info_wrapper(name, of, &fi, log) == NGX_FILE_ERROR) { of->fd = NGX_INVALID_FILE; return NGX_ERROR; } @@ -722,12 +751,12 @@ */ fd = ngx_open_file_wrapper(name, of, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, - NGX_FILE_OPEN, 0); + NGX_FILE_OPEN, 0, log); } else { fd = ngx_open_file_wrapper(name, of, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN, - NGX_FILE_DEFAULT_ACCESS); + NGX_FILE_DEFAULT_ACCESS, log); } if (fd == NGX_INVALID_FILE) { From mdounin at mdounin.ru Wed Feb 15 12:18:55 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Wed, 15 Feb 2012 12:18:55 +0000 Subject: [nginx] svn commit: r4481 - trunk/src/core Message-ID: <20120215121855.F40CD3F9C94@mail.nginx.com> Author: mdounin Date: 2012-02-15 12:18:55 +0000 (Wed, 15 Feb 2012) New Revision: 4481 Log: Disable symlinks: fixed edge cases of path handling. This includes non-absolute pathnames, multiple slashes and trailing slashes. In collaboration with Valentin Bartenev. Modified: trunk/src/core/ngx_open_file_cache.c Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-15 12:17:24 UTC (rev 4480) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-15 12:18:55 UTC (rev 4481) @@ -562,9 +562,10 @@ #else - u_char *p, *cp, *end; - ngx_fd_t at_fd; - ngx_str_t at_name; + u_char *p, *cp, *end; + ngx_fd_t at_fd; + ngx_str_t at_name; + ngx_file_info_t fi; if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_OFF) { fd = ngx_open_file(name->data, mode, create, access); @@ -578,27 +579,38 @@ return fd; } - at_fd = ngx_openat_file(AT_FDCWD, "/", NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, - NGX_FILE_OPEN, 0); + p = name->data; + end = p + name->len; - if (at_fd == NGX_INVALID_FILE) { - of->err = ngx_errno; - of->failed = ngx_openat_file_n; - return NGX_INVALID_FILE; - } - + at_fd = AT_FDCWD; at_name = *name; - at_name.len = 1; - end = name->data + name->len; - p = name->data + 1; + if (p[0] == '/') { + at_fd = ngx_openat_file(at_fd, "/", + NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + NGX_FILE_OPEN, 0); + if (at_fd == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_openat_file_n; + return NGX_FILE_ERROR; + } + + at_name.len = 1; + p++; + } + for ( ;; ) { cp = ngx_strlchr(p, end, '/'); if (cp == NULL) { break; } + if (cp == p) { + p++; + continue; + } + *cp = '\0'; if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) { @@ -630,6 +642,40 @@ at_name.len = cp - at_name.data; } + if (p == end && at_fd != AT_FDCWD) { + + /* + * If pathname ends with a trailing slash, check if last path + * component is a directory; if not, fail with ENOTDIR as per + * POSIX. + * + * We use separate check instead of O_DIRECTORY in the loop above, + * as O_DIRECTORY doesn't work on FreeBSD 8. + * + * Note this returns already opened file descriptor, with different + * mode/create/access. This is believed to be safe as we don't + * use this codepath to create directories. + */ + + if (ngx_fd_info(at_fd, &fi) == NGX_FILE_ERROR) { + of->err = ngx_errno; + of->failed = ngx_fd_info_n; + fd = NGX_INVALID_FILE; + + goto failed; + } + + if (ngx_is_dir(&fi)) { + return at_fd; + } + + of->err = ENOTDIR; + of->failed = ngx_openat_file_n; + fd = NGX_INVALID_FILE; + + goto failed; + } + if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) { fd = ngx_openat_file_owner(at_fd, p, mode, create, access, log); From mdounin at mdounin.ru Wed Feb 15 13:26:06 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Wed, 15 Feb 2012 13:26:06 +0000 Subject: [nginx] svn commit: r4482 - trunk/docs/xml/nginx Message-ID: <20120215132606.CF6273F9C68@mail.nginx.com> Author: mdounin Date: 2012-02-15 13:26:06 +0000 (Wed, 15 Feb 2012) New Revision: 4482 Log: nginx-1.1.15-RELEASE Modified: trunk/docs/xml/nginx/changes.xml Modified: trunk/docs/xml/nginx/changes.xml =================================================================== --- trunk/docs/xml/nginx/changes.xml 2012-02-15 12:18:55 UTC (rev 4481) +++ trunk/docs/xml/nginx/changes.xml 2012-02-15 13:26:06 UTC (rev 4482) @@ -9,6 +9,109 @@ nginx changelog + + + + +????????? disable_symlinks. + + +the "disable_symlinks" directive. + + + + + +????????? proxy_cookie_domain ? proxy_cookie_path. + + +the "proxy_cookie_domain" and "proxy_cookie_path" directives. + + + + + +nginx ??? ??????????? ???????? ?? ?????? "upstream prematurely closed +connection" ?????? "upstream sent too big header".
+??????? Feibo Li. +
+ +nginx might log incorrect error "upstream prematurely closed connection" +instead of correct "upstream sent too big header" one.
+Thanks to Feibo Li. +
+
+ + + +nginx ?? ????????? ? ??????? ngx_http_perl_module, +???? ????????????? ???????? --with-openssl. + + +nginx could not be built with the ngx_http_perl_module +if the --with-openssl option was used. + + + + + +?????????? ?????????? ??????????????? ? ??????????? location'? +?? ??????????????. + + +internal redirects to named locations were not limited. + + + + + +????? $r->flush() ????????? ??? ?????? ??? ????????? ? ??????? +? ?????? ngx_http_gzip_filter_module. + + +calling $r->flush() multiple times might cause errors +in the ngx_http_gzip_filter_module. + + + + + +??? ????????????? ????????? proxy_store ? SSI-???????????? +????????? ????? ????? ?? ?????????. + + +temporary files might be not removed +if the "proxy_store" directive were used with SSI includes. + + + + + +? ????????? ??????? ???????????? ?????????? (?????, ??? $args) +?????????? ?????? ?????? ?????????????? ????????. + + +in some cases non-cacheable variables (such as the $args variable) +returned old empty cached value. + + + + + +? ??????? ???????? ??? ????????? segmentation fault, +???? ???????????? ??????????? ??????? ????? SSI-???????????; +?????? ????????? ? 0.7.25. + + +a segmentation fault might occur in a worker process +if too many SSI subrequests were issued simultaneously; +the bug had appeared in 0.7.25. + + + +
+ + From mdounin at mdounin.ru Wed Feb 15 13:26:27 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Wed, 15 Feb 2012 13:26:27 +0000 Subject: [nginx] svn commit: r4483 - tags Message-ID: <20120215132627.A4E743F9CAE@mail.nginx.com> Author: mdounin Date: 2012-02-15 13:26:27 +0000 (Wed, 15 Feb 2012) New Revision: 4483 Log: release-1.1.15 tag Added: tags/release-1.1.15/ From brian at akins.org Sat Feb 11 12:12:17 2012 From: brian at akins.org (Brian Akins) Date: Sat, 11 Feb 2012 07:12:17 -0500 Subject: Can nginx module produce multiple request to upstreams? In-Reply-To: References: Message-ID: <3670DA9A-D8CE-4AC5-99EC-0C5E9F6337AD@akins.org> Easy to do with the Lua module. http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi From gojpeg at gmail.com Fri Feb 17 19:30:29 2012 From: gojpeg at gmail.com (Peter Leonov) Date: Fri, 17 Feb 2012 23:30:29 +0400 Subject: Request inside a timer In-Reply-To: References: <87zkcqqpo1.wl%appa@perusio.net> Message-ID: <8FA5FC67-6F42-4EBA-A47E-C7A525163A60@gmail.com> Well done by the way! :) On 11.02.2012, at 3:04, Alexandr Gomoliako wrote: > On Sat, Feb 11, 2012 at 12:39 AM, Ant?nio P. P. Almeida > wrote: >>> I would like to do a module which, at some interval, refresh part of >>> its configuration getting some values from a external service. So I >>> need to make a GET independent of a user request. >> >> I suggest not doing a module, but instead making use of: >> >> http://wiki.nginx.org/HttpLuaModule >> >> It can do that and more, much more. > > I don't think it can. But pretty easy with Nginx::Perl: > > use Nginx; > use Nginx::HTTP; > > sub init_worker { > ... > my $req = "GET / HTTP/1.1" . "\x0d\x0a" . "Host: foobar" . > "\x0d\x0a\x0d\x0a" ; > > ngx_timer 0, 5, sub { > ngx_http "1.2.3.4:80", $req, sub { > my ($headers, $buf_ref) = @_; > > unless ($headers) { > ngx_log_error $!, "error"; > return; > } > > ngx_log_notice 0, "got $headers->{'_status'}"; > ... > }; > }; > } > > http://zzzcpan.github.com/nginx-perl/ > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From max at mxcrypt.com Sat Feb 18 14:19:18 2012 From: max at mxcrypt.com (Maxim Khitrov) Date: Sat, 18 Feb 2012 09:19:18 -0500 Subject: [PATCH] Allow http_auth_request_module to forward 302 responses Message-ID: Hello Maxim, The attached patch allows your http_auth_request_module to forward a 302 response and the associated "Location" header to the client. The goal is to allow the authentication back end to redirect the client to a login page instead of using WWW-Authenticate header. I'm currently attempting to use your module to authenticate users against an Active Directory server. I have a PHP script that can perform the necessary security checks and cache user credentials for better performance. The problem is that if I rely on HTTP Basic authentication, I lose control over the client's session (timeout, logout, etc.). I know that it is possible to force some browsers to "forget" the credentials in order to log out, but it's a hack that I'd rather avoid. The best solution is to use cookies, but for this I need to be able to redirect the user to the login page when authentication fails. The current behavior of the auth_request module is to return an Internal Server Error for any response code other than 401, 403, or 200. To make this patch, I simply copied your handling of the www_authenticate header. If there is a more elegant solution or some additional logic required, please feel free to change the code as needed. - Max -------------- next part -------------- A non-text attachment was scrubbed... Name: ngx_http_auth_request_module-location.patch Type: application/octet-stream Size: 890 bytes Desc: not available URL: From mdounin at mdounin.ru Sat Feb 18 21:45:42 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 19 Feb 2012 01:45:42 +0400 Subject: [PATCH] Allow http_auth_request_module to forward 302 responses In-Reply-To: References: Message-ID: <20120218214542.GK67687@mdounin.ru> Hello! On Sat, Feb 18, 2012 at 09:19:18AM -0500, Maxim Khitrov wrote: > Hello Maxim, > > The attached patch allows your http_auth_request_module to forward a > 302 response and the associated "Location" header to the client. The > goal is to allow the authentication back end to redirect the client to > a login page instead of using WWW-Authenticate header. You may get the same result by returning 401/403 and using appropriate error_page handler. I don't actually see a reason to handle 302 specially here. Something like this should work (not tested): location / { auth_request /auth; auth_request_set $auth_redirect $upstream_http_location; error_page 401 = /auth_redirect; } location /auth { proxy_pass http://auth_backend; ... } location /auth_redirect { return 302 $auth_redirect; } Maxim Dounin From max at mxcrypt.com Sat Feb 18 23:48:50 2012 From: max at mxcrypt.com (Maxim Khitrov) Date: Sat, 18 Feb 2012 18:48:50 -0500 Subject: [PATCH] Allow http_auth_request_module to forward 302 responses In-Reply-To: <20120218214542.GK67687@mdounin.ru> References: <20120218214542.GK67687@mdounin.ru> Message-ID: On Sat, Feb 18, 2012 at 4:45 PM, Maxim Dounin wrote: > Hello! > > On Sat, Feb 18, 2012 at 09:19:18AM -0500, Maxim Khitrov wrote: > >> Hello Maxim, >> >> The attached patch allows your http_auth_request_module to forward a >> 302 response and the associated "Location" header to the client. The >> goal is to allow the authentication back end to redirect the client to >> a login page instead of using WWW-Authenticate header. > > You may get the same result by returning 401/403 and using > appropriate error_page handler. ?I don't actually see a reason to > handle 302 specially here. Allow me to clarify. I cannot use 401/403 codes, because I need both of those to perform their original function. 403 has to block access without redirecting anywhere and 401 must be used to pass the WWW-Authenticate header. The latter may seem odd, given that I'm using cookies, but I also need the ability to "downgrade" to HTTP Basic authentication for clients that cannot handle cookies properly. I do this by maintaining a whitelist of clients that are known not to support cookies (e.g. mercurial or various scripted clients). When my authentication back-end sees a matching User Agent string, it automatically allows the use of Basic authentication by sending a 401 response. Everyone else will be either denied access or be redirected to provide their credentials via an html form. Even without this scheme, I think allowing the use of a 302 response would be a useful feature. Relying on the error_page configuration, which I did consider before making my patch, increases the complexity of nginx.conf and could lead to unintended behavior. This way, a single "auth_request /auth;" line takes care of all possible decisions (authenticate/allow/deny/redirect). - Max From mdounin at mdounin.ru Sun Feb 19 04:00:19 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 19 Feb 2012 08:00:19 +0400 Subject: [PATCH] Allow http_auth_request_module to forward 302 responses In-Reply-To: References: <20120218214542.GK67687@mdounin.ru> Message-ID: <20120219040018.GR67687@mdounin.ru> Hello! On Sat, Feb 18, 2012 at 06:48:50PM -0500, Maxim Khitrov wrote: > On Sat, Feb 18, 2012 at 4:45 PM, Maxim Dounin wrote: > > Hello! > > > > On Sat, Feb 18, 2012 at 09:19:18AM -0500, Maxim Khitrov wrote: > > > >> Hello Maxim, > >> > >> The attached patch allows your http_auth_request_module to forward a > >> 302 response and the associated "Location" header to the client. The > >> goal is to allow the authentication back end to redirect the client to > >> a login page instead of using WWW-Authenticate header. > > > > You may get the same result by returning 401/403 and using > > appropriate error_page handler. ?I don't actually see a reason to > > handle 302 specially here. > > Allow me to clarify. I cannot use 401/403 codes, because I need both > of those to perform their original function. 403 has to block access > without redirecting anywhere and 401 must be used to pass the > WWW-Authenticate header. Actually you can. You just need to use some additional processing inside error_page handler (or two different error_page handlers, selected based on auth request answer), e.g. location / { auth_request /auth; auth_request_set $auth_redirect $upstream_http_location; error_page 403 = /auth_403; ... } location = /auth { proxy_pass http://auth_backend; ... } location = /auth_403 { if ($auth_redirect) { return 302 $auth_redirect; } return 403; } And then either set Location (or some other arbitrary header) in a 403 response or not. [...] > Even without this scheme, I think allowing the use of a 302 response > would be a useful feature. Relying on the error_page configuration, > which I did consider before making my patch, increases the complexity > of nginx.conf and could lead to unintended behavior. This way, a > single "auth_request /auth;" line takes care of all possible decisions > (authenticate/allow/deny/redirect). I believe the problem here is how one define "all possible decisions". And I'm really sure that if 302 will be allowed - 303 and 307 will appear next to it, and then we'll start discussing which headers should be passed - e.g. Set-Cookie looks like something required in addition to Location. That's why I (intentionally) limited it to only handle 401/403, much like normal auth_basic. I think correct aproach for the future would be to implement some "transparent" mode, much like fastcgi authorizers, where one may return arbitrary answer with any headers and body while rejecting request. This is not something trivial to implement as of now though, mostly because of body. Maxim Dounin From max at mxcrypt.com Sun Feb 19 13:40:45 2012 From: max at mxcrypt.com (Maxim Khitrov) Date: Sun, 19 Feb 2012 08:40:45 -0500 Subject: [PATCH] Allow http_auth_request_module to forward 302 responses In-Reply-To: <20120219040018.GR67687@mdounin.ru> References: <20120218214542.GK67687@mdounin.ru> <20120219040018.GR67687@mdounin.ru> Message-ID: 2012/2/18 Maxim Dounin : > Hello! > > On Sat, Feb 18, 2012 at 06:48:50PM -0500, Maxim Khitrov wrote: > >> On Sat, Feb 18, 2012 at 4:45 PM, Maxim Dounin wrote: >> > Hello! >> > >> > On Sat, Feb 18, 2012 at 09:19:18AM -0500, Maxim Khitrov wrote: >> > >> >> Hello Maxim, >> >> >> >> The attached patch allows your http_auth_request_module to forward a >> >> 302 response and the associated "Location" header to the client. The >> >> goal is to allow the authentication back end to redirect the client to >> >> a login page instead of using WWW-Authenticate header. >> > >> > You may get the same result by returning 401/403 and using >> > appropriate error_page handler. ?I don't actually see a reason to >> > handle 302 specially here. >> >> Allow me to clarify. I cannot use 401/403 codes, because I need both >> of those to perform their original function. 403 has to block access >> without redirecting anywhere and 401 must be used to pass the >> WWW-Authenticate header. > > Actually you can. ?You just need to use some additional processing > inside error_page handler (or two different error_page handlers, > selected based on auth request answer), e.g. > > ? ?location / { > ? ? ? ?auth_request /auth; > ? ? ? ?auth_request_set $auth_redirect $upstream_http_location; > ? ? ? ?error_page 403 = /auth_403; > ? ? ? ?... > ? ?} > > ? ?location = /auth { > ? ? ? ?proxy_pass http://auth_backend; > ? ? ? ?... > ? ?} > > ? ?location = /auth_403 { > ? ? ? ?if ($auth_redirect) { > ? ? ? ? ? ?return 302 $auth_redirect; > ? ? ? ?} > > ? ? ? ?return 403; > ? ?} > > And then either set Location (or some other arbitrary header) in a > 403 response or not. Thanks, I'll use this, but I really don't like this method. It makes testing difficult, because when you call the authentication script directly, which you have to do during the development, you are no longer receiving normal responses. You get a 403 status and a Location header that you must now enter manually. Maybe there is some other way of getting nginx to act on the location, but it just feels like one hack on top of another. > [...] > >> Even without this scheme, I think allowing the use of a 302 response >> would be a useful feature. Relying on the error_page configuration, >> which I did consider before making my patch, increases the complexity >> of nginx.conf and could lead to unintended behavior. This way, a >> single "auth_request /auth;" line takes care of all possible decisions >> (authenticate/allow/deny/redirect). > > I believe the problem here is how one define "all possible > decisions". And I'm really sure that if 302 will be allowed - 303 > and 307 will appear next to it, and then we'll start discussing > which headers should be passed - e.g. Set-Cookie looks like > something required in addition to Location. That's why I > (intentionally) limited it to only handle 401/403, much like > normal auth_basic. Add two extra checks to the outer 'if' statement and 303/307 codes are handled :) In practice, most people will not use these due to the uncertainty in client support and the fact that languages like PHP default to sending a 302 response when the Location header is set. As for auth_basic, I don't think this is a fair comparison. What other things could auth_basic do? It only deals with a single header, which can easily be handled in the context of the current request. Your auth_request module could allow for much more flexibility. > I think correct aproach for the future would be to implement some > "transparent" mode, much like fastcgi authorizers, where one may > return arbitrary answer with any headers and body while rejecting > request. This is not something trivial to implement as of now > though, mostly because of body. Wouldn't redirects take care of this already? You don't need the authentication script to be the source of extra headers or some html content. You just need to give it a way of rejecting the request and pointing the client to a dedicated login page that takes care of everything else. Your solution with error pages works, but I still think that allowing redirects would be cleaner. All you are really gaining with the transparent mode is the ability to keep the same URL and avoid a redirect for the client. Is the increase in complexity really worth it? In any case, thanks for sharing your thoughts on the topic. I'll play with error_page configuration and see how well I can make it work for my needs. - Max From mdounin at mdounin.ru Mon Feb 20 19:12:49 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 20 Feb 2012 19:12:49 +0000 Subject: [nginx] svn commit: r4484 - in trunk/src: core http/modules/perl Message-ID: <20120220191249.189DA3F9CD8@mail.nginx.com> Author: mdounin Date: 2012-02-20 19:12:48 +0000 (Mon, 20 Feb 2012) New Revision: 4484 Log: Version bump. Modified: trunk/src/core/nginx.h trunk/src/http/modules/perl/nginx.pm Modified: trunk/src/core/nginx.h =================================================================== --- trunk/src/core/nginx.h 2012-02-15 13:26:27 UTC (rev 4483) +++ trunk/src/core/nginx.h 2012-02-20 19:12:48 UTC (rev 4484) @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1001015 -#define NGINX_VERSION "1.1.15" +#define nginx_version 1001016 +#define NGINX_VERSION "1.1.16" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" Modified: trunk/src/http/modules/perl/nginx.pm =================================================================== --- trunk/src/http/modules/perl/nginx.pm 2012-02-15 13:26:27 UTC (rev 4483) +++ trunk/src/http/modules/perl/nginx.pm 2012-02-20 19:12:48 UTC (rev 4484) @@ -48,7 +48,7 @@ HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '1.1.15'; +our $VERSION = '1.1.16'; require XSLoader; XSLoader::load('nginx', $VERSION); From mdounin at mdounin.ru Mon Feb 20 19:14:09 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 20 Feb 2012 19:14:09 +0000 Subject: [nginx] svn commit: r4485 - trunk/src/core Message-ID: <20120220191409.92B453F9CD8@mail.nginx.com> Author: mdounin Date: 2012-02-20 19:14:07 +0000 (Mon, 20 Feb 2012) New Revision: 4485 Log: Disable symlinks: error handling cleanup again. Modified: trunk/src/core/ngx_open_file_cache.c Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-20 19:12:48 UTC (rev 4484) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-20 19:14:07 UTC (rev 4485) @@ -590,10 +590,10 @@ NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, NGX_FILE_OPEN, 0); - if (at_fd == NGX_FILE_ERROR) { + if (at_fd == NGX_INVALID_FILE) { of->err = ngx_errno; of->failed = ngx_openat_file_n; - return NGX_FILE_ERROR; + return NGX_INVALID_FILE; } at_name.len = 1; @@ -634,7 +634,7 @@ if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, - ngx_close_file_n " \"%V\" failed", at_name); + ngx_close_file_n " \"%V\" failed", &at_name); } p = cp + 1; @@ -692,7 +692,7 @@ if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, - ngx_close_file_n " \"%V\" failed", at_name); + ngx_close_file_n " \"%V\" failed", &at_name); } return fd; From mdounin at mdounin.ru Mon Feb 20 19:14:35 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 20 Feb 2012 19:14:35 +0000 Subject: [nginx] svn commit: r4486 - in trunk/src: core os/unix Message-ID: <20120220191435.EFC363F9CD8@mail.nginx.com> Author: mdounin Date: 2012-02-20 19:14:35 +0000 (Mon, 20 Feb 2012) New Revision: 4486 Log: Disable symlinks: added explicit cast of AT_FDCWD (ticket #111). Solaris has AT_FDCWD defined to unsigned value, and comparison of a file descriptor with it causes warnings in modern versions of gcc. Explicitly cast AT_FDCWD to ngx_fd_t to resolve these warnings. Modified: trunk/src/core/ngx_open_file_cache.c trunk/src/os/unix/ngx_files.h Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-20 19:14:07 UTC (rev 4485) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-20 19:14:35 UTC (rev 4486) @@ -582,7 +582,7 @@ p = name->data; end = p + name->len; - at_fd = AT_FDCWD; + at_fd = NGX_AT_FDCWD; at_name = *name; if (p[0] == '/') { @@ -632,7 +632,7 @@ goto failed; } - if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { + if (at_fd != NGX_AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, ngx_close_file_n " \"%V\" failed", &at_name); } @@ -642,7 +642,7 @@ at_name.len = cp - at_name.data; } - if (p == end && at_fd != AT_FDCWD) { + if (p == end && at_fd != NGX_AT_FDCWD) { /* * If pathname ends with a trailing slash, check if last path @@ -690,7 +690,7 @@ failed: - if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { + if (at_fd != NGX_AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, ngx_close_file_n " \"%V\" failed", &at_name); } Modified: trunk/src/os/unix/ngx_files.h =================================================================== --- trunk/src/os/unix/ngx_files.h 2012-02-20 19:14:07 UTC (rev 4485) +++ trunk/src/os/unix/ngx_files.h 2012-02-20 19:14:35 UTC (rev 4486) @@ -340,6 +340,8 @@ #define ngx_file_at_info_n "fstatat()" +#define NGX_AT_FDCWD (ngx_fd_t) AT_FDCWD + #endif From sykim at etri.re.kr Tue Feb 21 09:51:19 2012 From: sykim at etri.re.kr (=?ks_c_5601-1987?B?sei89r+1?=) Date: Tue, 21 Feb 2012 18:51:19 +0900 Subject: How can the nginx detect the stale event using 'instance'? Message-ID: <5E11524165CB9F4889E16DC6D29BAAD50257A10F@email2> These days, I am studying the nginx source code.. I think this code is very beautiful, and fully modulized.. BUT so it is difficult to follow the code.-_-; BTW, In struct ngx_event_s, there is ?unsigned instance:1;?.. I can?t understand how can the nginx detect the stale events using it.-_-; Could you please explain the detection mechanism or give me a hint? --------------------------------------------------------------------- SOO-YOUNG KIM Senior Member of Engineering Staff Storage System Research Team Electronics and Telecommunications Research Institute 138 Gajeong-no, Yuseong-gu, Daejeon, 305-700 KOREA Phone : 82-42-860-1682 Fax : 82-42-860-6699 Mobile : 82-10-9696-3032 E-mail : sykim at etri.re.kr ETRI Homepage : www.etri.re.kr --------------------------------------------------------------------- From mdounin at mdounin.ru Tue Feb 21 13:28:07 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 21 Feb 2012 17:28:07 +0400 Subject: How can the nginx detect the stale event using 'instance'? In-Reply-To: <5E11524165CB9F4889E16DC6D29BAAD50257A10F@email2> References: <5E11524165CB9F4889E16DC6D29BAAD50257A10F@email2> Message-ID: <20120221132807.GQ67687@mdounin.ru> Hello! On Tue, Feb 21, 2012 at 06:51:19PM +0900, ??? wrote: > These days, I am studying the nginx source code.. > > I think this code is very beautiful, and fully modulized.. BUT so it is difficult to follow the code.-_-; > > BTW, In struct ngx_event_s, there is ?unsigned instance:1;?.. > > I can?t understand how can the nginx detect the stale events using it.-_-; > > Could you please explain the detection mechanism or give me a hint? The "instance" bit is passed in a event user data to the kernel and when the kernel returns the event it's checked against one recorded in the event structure. If there is no match - this means the event reported by the kernel is stale (i.e. we've already closed the descriptor in the very same event loop iteration). See e.g. src/event/modules/ngx_kqueue_module.c for details, in particular ngx_kqueue_set_event() and ngx_kqueue_process_events(). Maxim Dounin From vbart at nginx.com Tue Feb 21 15:01:26 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Tue, 21 Feb 2012 15:01:26 +0000 Subject: [nginx] svn commit: r4487 - trunk/src/core Message-ID: Author: vbart Date: 2012-02-21 15:01:25 +0000 (Tue, 21 Feb 2012) New Revision: 4487 Modified: trunk/src/core/ngx_open_file_cache.c Log: Disable symlinks: cleanups once again. In collaboration with Ruslan Ermilov. Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-20 19:14:35 UTC (rev 4486) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-21 15:01:25 UTC (rev 4487) @@ -504,8 +504,8 @@ fd = ngx_openat_file(at_fd, name, mode, create, access); - if (fd == NGX_FILE_ERROR) { - return NGX_FILE_ERROR; + if (fd == NGX_INVALID_FILE) { + return NGX_INVALID_FILE; } if (ngx_file_at_info(at_fd, name, &atfi, AT_SYMLINK_NOFOLLOW) @@ -582,13 +582,12 @@ p = name->data; end = p + name->len; - at_fd = NGX_AT_FDCWD; at_name = *name; - if (p[0] == '/') { - at_fd = ngx_openat_file(at_fd, "/", - NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, - NGX_FILE_OPEN, 0); + if (*p == '/') { + at_fd = ngx_open_file("/", + NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + NGX_FILE_OPEN, 0); if (at_fd == NGX_INVALID_FILE) { of->err = ngx_errno; @@ -598,6 +597,9 @@ at_name.len = 1; p++; + + } else { + at_fd = NGX_AT_FDCWD; } for ( ;; ) { @@ -642,7 +644,7 @@ at_name.len = cp - at_name.data; } - if (p == end && at_fd != NGX_AT_FDCWD) { + if (p == end) { /* * If pathname ends with a trailing slash, check if last path From vbart at nginx.com Tue Feb 21 15:04:42 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Tue, 21 Feb 2012 15:04:42 +0000 Subject: [nginx] svn commit: r4488 - trunk/src/core Message-ID: Author: vbart Date: 2012-02-21 15:04:41 +0000 (Tue, 21 Feb 2012) New Revision: 4488 Modified: trunk/src/core/ngx_open_file_cache.c Log: Disable symlinks: don't allow creating or truncating files if "if_not_owner" parameter is used. To prevent race condition we have to open a file before checking its owner and there's no way to change access flags for already opened file descriptor, so we disable symlinks for the last path component at all if flags allow creating or truncating the file. Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-21 15:01:25 UTC (rev 4487) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-21 15:04:41 UTC (rev 4488) @@ -678,7 +678,9 @@ goto failed; } - if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) { + if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER + && !(create & (NGX_FILE_CREATE_OR_OPEN|NGX_FILE_TRUNCATE))) + { fd = ngx_openat_file_owner(at_fd, p, mode, create, access, log); } else { From vbart at nginx.com Tue Feb 21 15:10:14 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Tue, 21 Feb 2012 15:10:14 +0000 Subject: [nginx] svn commit: r4489 - in trunk/src: core os/unix Message-ID: Author: vbart Date: 2012-02-21 15:10:13 +0000 (Tue, 21 Feb 2012) New Revision: 4489 Modified: trunk/src/core/ngx_open_file_cache.c trunk/src/os/unix/ngx_files.h Log: Disable symlinks: use O_SEARCH|O_DIRECTORY to open path components. Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-21 15:04:41 UTC (rev 4488) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-21 15:10:13 UTC (rev 4489) @@ -565,7 +565,6 @@ u_char *p, *cp, *end; ngx_fd_t at_fd; ngx_str_t at_name; - ngx_file_info_t fi; if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_OFF) { fd = ngx_open_file(name->data, mode, create, access); @@ -586,7 +585,7 @@ if (*p == '/') { at_fd = ngx_open_file("/", - NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + NGX_FILE_SEARCH|NGX_FILE_NONBLOCK, NGX_FILE_OPEN, 0); if (at_fd == NGX_INVALID_FILE) { @@ -617,12 +616,12 @@ if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) { fd = ngx_openat_file_owner(at_fd, p, - NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, + NGX_FILE_SEARCH|NGX_FILE_NONBLOCK, NGX_FILE_OPEN, 0, log); } else { fd = ngx_openat_file(at_fd, p, - NGX_FILE_RDONLY|NGX_FILE_NONBLOCK|NGX_FILE_NOFOLLOW, + NGX_FILE_SEARCH|NGX_FILE_NONBLOCK|NGX_FILE_NOFOLLOW, NGX_FILE_OPEN, 0); } @@ -647,35 +646,18 @@ if (p == end) { /* - * If pathname ends with a trailing slash, check if last path - * component is a directory; if not, fail with ENOTDIR as per - * POSIX. + * If pathname ends with a trailing slash, assume the last path + * component is a directory and reopen it with requested flags; + * if not, fail with ENOTDIR as per POSIX. * - * We use separate check instead of O_DIRECTORY in the loop above, - * as O_DIRECTORY doesn't work on FreeBSD 8. - * - * Note this returns already opened file descriptor, with different - * mode/create/access. This is believed to be safe as we don't - * use this codepath to create directories. + * We cannot rely on O_DIRECTORY in the loop above to check + * that the last path component is a directory because + * O_DIRECTORY doesn't work on FreeBSD 8. Fortunately, by + * reopening a directory, we don't depend on it at all. */ - if (ngx_fd_info(at_fd, &fi) == NGX_FILE_ERROR) { - of->err = ngx_errno; - of->failed = ngx_fd_info_n; - fd = NGX_INVALID_FILE; - - goto failed; - } - - if (ngx_is_dir(&fi)) { - return at_fd; - } - - of->err = ENOTDIR; - of->failed = ngx_openat_file_n; - fd = NGX_INVALID_FILE; - - goto failed; + fd = ngx_openat_file(at_fd, ".", mode, create, access); + goto done; } if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER @@ -687,6 +669,8 @@ fd = ngx_openat_file(at_fd, p, mode|NGX_FILE_NOFOLLOW, create, access); } +done: + if (fd == NGX_INVALID_FILE) { of->err = ngx_errno; of->failed = ngx_openat_file_n; Modified: trunk/src/os/unix/ngx_files.h =================================================================== --- trunk/src/os/unix/ngx_files.h 2012-02-21 15:04:41 UTC (rev 4488) +++ trunk/src/os/unix/ngx_files.h 2012-02-21 15:10:13 UTC (rev 4489) @@ -78,8 +78,25 @@ #if (NGX_HAVE_OPENAT) #define NGX_FILE_NOFOLLOW O_NOFOLLOW + +#if defined(O_DIRECTORY) +#define NGX_FILE_DIRECTORY O_DIRECTORY +#else +#define NGX_FILE_DIRECTORY 0 #endif +#if defined(O_SEARCH) +#define NGX_FILE_SEARCH O_SEARCH|NGX_FILE_DIRECTORY + +#elif defined(O_EXEC) +#define NGX_FILE_SEARCH O_EXEC|NGX_FILE_DIRECTORY + +#else +#define NGX_FILE_SEARCH O_RDONLY|NGX_FILE_DIRECTORY +#endif + +#endif /* NGX_HAVE_OPENAT */ + #define NGX_FILE_DEFAULT_ACCESS 0644 #define NGX_FILE_OWNER_ACCESS 0600 From sykim at etri.re.kr Tue Feb 21 23:59:18 2012 From: sykim at etri.re.kr (=?UTF-8?B?6rmA7IiY7JiB?=) Date: Wed, 22 Feb 2012 08:59:18 +0900 Subject: How can the nginx detect the stale event using 'instance'? In-Reply-To: <20120221132807.GQ67687@mdounin.ru> References: <5E11524165CB9F4889E16DC6D29BAAD50257A10F@email2> <20120221132807.GQ67687@mdounin.ru> Message-ID: <5E11524165CB9F4889E16DC6D29BAAD50257A111@email2> Dear Maxim, Thanks for your comments. Could you please explain it more details? I have only seen the epoll module code not kqueue module. The routine is similar to kqueue. ------------- (ngx_epoll_add_event) ee.data.ptr = (void *) ((uintptr_t) c | ev->instance); (ngx_epoll_process_events) instance = (uintptr_t) c & 1; if (c->fd == -1 || rev->instance != instance) {...} ------------- I'm wondering who set the instance bit.. I just found in ngx_event_process_init() and ngx_get_connection(). ------------- (ngx_event_process_init) rev = cycle->read_events; for (i = 0; i < cycle->connection_n; i++) { rev[i].closed = 1; rev[i].instance = 1; #if (NGX_THREADS) rev[i].lock = &c[i].lock; rev[i].own_lock = &c[i].lock; #endif } (ngx_get_connection) instance = rev->instance; ngx_memzero(rev, sizeof(ngx_event_t)); ngx_memzero(wev, sizeof(ngx_event_t)); rev->instance = !instance; wev->instance = !instance; ------------- BUT, I guess that ngx_event_process_init() may be called once and ngx_get_connection() may be called when a new connection is accepted(I'm not sure-_-;). When ngx_event_process_init() is called, instance bit is 1 and then when a new connection is accepted ngx_get_connection(), instance bit is 0. (next ngx_get_connection() will set the instance bit to 1). And then what happen? I can't trace how the nginx handle it, anymore..-_-; Please let me know next scenario..^^ -----Original Message----- From: nginx-devel-bounces at nginx.org [mailto:nginx-devel-bounces at nginx.org] On Behalf Of Maxim Dounin Sent: Tuesday, February 21, 2012 10:28 PM To: nginx-devel at nginx.org Subject: Re: How can the nginx detect the stale event using 'instance'? Hello! On Tue, Feb 21, 2012 at 06:51:19PM +0900, ??? wrote: > These days, I am studying the nginx source code.. > > I think this code is very beautiful, and fully modulized.. BUT so it > is difficult to follow the code.-_-; > > BTW, In struct ngx_event_s, there is ?unsigned instance:1;?.. > > I can?t understand how can the nginx detect the stale events using > it.-_-; > > Could you please explain the detection mechanism or give me a hint? The "instance" bit is passed in a event user data to the kernel and when the kernel returns the event it's checked against one recorded in the event structure. If there is no match - this means the event reported by the kernel is stale (i.e. we've already closed the descriptor in the very same event loop iteration). See e.g. src/event/modules/ngx_kqueue_module.c for details, in particular ngx_kqueue_set_event() and ngx_kqueue_process_events(). Maxim Dounin _______________________________________________ nginx-devel mailing list nginx-devel at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx-devel From sergey.siroezhkin at gmail.com Wed Feb 22 10:30:46 2012 From: sergey.siroezhkin at gmail.com (Sergey Petrov) Date: Wed, 22 Feb 2012 14:30:46 +0400 Subject: ngx_http_complex_value VS ngx_http_script Message-ID: Hi, can somone explain the difference? What's the correct usecase for ngx_http_script? Thank you. From mdounin at mdounin.ru Wed Feb 22 11:28:54 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Wed, 22 Feb 2012 11:28:54 +0000 Subject: [nginx] svn commit: r4490 - trunk/src/event Message-ID: <20120222112854.59BE33F9CF5@mail.nginx.com> Author: mdounin Date: 2012-02-22 11:28:53 +0000 (Wed, 22 Feb 2012) New Revision: 4490 Log: Event pipe: fixed buffer loss in p->length case. With previous code raw buffer might be lost if p->input_filter() was called on a buffer without any data and used ngx_event_pipe_add_free_buf() to return it to the free list. This eventually might cause "all buffers busy" problem, resulting in segmentation fault due to null pointer dereference in ngx_event_pipe_write_chain_to_temp_file(). In ngx_event_pipe_add_free_buf() the buffer was added to the list start due to pos == last, and then "p->free_raw_bufs = cl->next" in ngx_event_pipe_read_upstream() dropped both chain links to the buffer from the p->free_raw_bufs list. Fix is to move "p->free_raw_bufs = cl->next" before calling the p->input_filter(). Modified: trunk/src/event/ngx_event_pipe.c Modified: trunk/src/event/ngx_event_pipe.c =================================================================== --- trunk/src/event/ngx_event_pipe.c 2012-02-21 15:10:13 UTC (rev 4489) +++ trunk/src/event/ngx_event_pipe.c 2012-02-22 11:28:53 UTC (rev 4490) @@ -401,13 +401,14 @@ if (cl->buf->last - cl->buf->pos >= p->length) { + p->free_raw_bufs = cl->next; + /* STUB */ cl->buf->num = p->num++; if (p->input_filter(p, cl->buf) == NGX_ERROR) { return NGX_ABORT; } - p->free_raw_bufs = cl->next; ngx_free_chain(p->pool, cl); } } From mdounin at mdounin.ru Wed Feb 22 14:12:17 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 22 Feb 2012 18:12:17 +0400 Subject: How can the nginx detect the stale event using 'instance'? In-Reply-To: <5E11524165CB9F4889E16DC6D29BAAD50257A111@email2> References: <5E11524165CB9F4889E16DC6D29BAAD50257A10F@email2> <20120221132807.GQ67687@mdounin.ru> <5E11524165CB9F4889E16DC6D29BAAD50257A111@email2> Message-ID: <20120222141217.GY67687@mdounin.ru> Hello! On Wed, Feb 22, 2012 at 08:59:18AM +0900, ??? wrote: > Dear Maxim, > > Thanks for your comments. > > Could you please explain it more details? > > I have only seen the epoll module code not kqueue module. The routine is similar to kqueue. > > ------------- > (ngx_epoll_add_event) > ee.data.ptr = (void *) ((uintptr_t) c | ev->instance); > > (ngx_epoll_process_events) > instance = (uintptr_t) c & 1; > if (c->fd == -1 || rev->instance != instance) {...} > ------------- The same here: instance bit is stored in user data passed to kernel, and when kernel report event the instance bit returned by kernel is checked against one in the event structure. > > I'm wondering who set the instance bit.. I just found in ngx_event_process_init() and ngx_get_connection(). > > ------------- > (ngx_event_process_init) > rev = cycle->read_events; > for (i = 0; i < cycle->connection_n; i++) { > rev[i].closed = 1; > rev[i].instance = 1; > #if (NGX_THREADS) > rev[i].lock = &c[i].lock; > rev[i].own_lock = &c[i].lock; > #endif > } This will initalize instance bit. > > (ngx_get_connection) > instance = rev->instance; > ngx_memzero(rev, sizeof(ngx_event_t)); > ngx_memzero(wev, sizeof(ngx_event_t)); > rev->instance = !instance; > wev->instance = !instance; And this will reverse existing bit when new connection is created. > ------------- > > BUT, I guess that ngx_event_process_init() may be called once > > and ngx_get_connection() may be called when a new connection is accepted(I'm not sure-_-;). > > When ngx_event_process_init() is called, instance bit is 1 > > and then when a new connection is accepted ngx_get_connection(), > instance bit is 0. (next ngx_get_connection() will set the > instance bit to 1). The ngx_get_connection() will always reverse the bit, i.e. on first use of a connection structure it will be set to 0, on second connection structure use it will be set to 1, then again to 0 and so on. On each use of the connection structure instance bit will be different from one used during previous use of the same connection structure (for another connection). > And then what happen? I can't trace how the nginx handle it, anymore..-_-; And then (even if connection isn't closed) if the instance bit returned by kernel doesn't match one stored in the event structure - we may safely drop this event as we are sure the connection structure was reused for another connection. Maxim Dounin > > Please let me know next scenario..^^ > > -----Original Message----- > From: nginx-devel-bounces at nginx.org [mailto:nginx-devel-bounces at nginx.org] On Behalf Of Maxim Dounin > Sent: Tuesday, February 21, 2012 10:28 PM > To: nginx-devel at nginx.org > Subject: Re: How can the nginx detect the stale event using 'instance'? > > Hello! > > On Tue, Feb 21, 2012 at 06:51:19PM +0900, ??? wrote: > > > These days, I am studying the nginx source code.. > > > > I think this code is very beautiful, and fully modulized.. BUT so it > > is difficult to follow the code.-_-; > > > > BTW, In struct ngx_event_s, there is ?unsigned instance:1;?.. > > > > I can?t understand how can the nginx detect the stale events using > > it.-_-; > > > > Could you please explain the detection mechanism or give me a hint? > > The "instance" bit is passed in a event user data to the kernel and when the kernel returns the event it's checked against one recorded in the event structure. If there is no match - this means the event reported by the kernel is stale (i.e. we've already closed the descriptor in the very same event loop iteration). > > See e.g. src/event/modules/ngx_kqueue_module.c for details, in particular ngx_kqueue_set_event() and ngx_kqueue_process_events(). > > Maxim Dounin > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From mdounin at mdounin.ru Wed Feb 22 14:29:33 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 22 Feb 2012 18:29:33 +0400 Subject: ngx_http_complex_value VS ngx_http_script In-Reply-To: References: Message-ID: <20120222142933.GA67687@mdounin.ru> Hello! On Wed, Feb 22, 2012 at 02:30:46PM +0400, Sergey Petrov wrote: > Hi, > can somone explain the difference? What's the correct usecase for > ngx_http_script? The complex value is basically a simplified envelope for script functionality for a simple case of a single string with (optional) variables. In most cases (unless you are targeting your code for old nginx versions) a complex value will be ok for you. Note complex values were introduced relatively recently, so in many cases nginx code still uses script directly. There are also some specific situations though, when you may need to use script functionality directly. E.g. proxy module will do this when evaluating proxy_set_header directives, as this allows flush uncacheable variables only once. Maxim Dounin From ru at nginx.com Wed Feb 22 16:23:29 2012 From: ru at nginx.com (ru at nginx.com) Date: Wed, 22 Feb 2012 16:23:29 +0000 Subject: [nginx] svn commit: r4491 - trunk/src/http Message-ID: <20120222162329.715BB3F9CBC@mail.nginx.com> Author: ru Date: 2012-02-22 16:23:29 +0000 (Wed, 22 Feb 2012) New Revision: 4491 Log: Renamed constants and fixed off-by-one error in "msie_padding on" handling. Modified: trunk/src/http/ngx_http_special_response.c Modified: trunk/src/http/ngx_http_special_response.c =================================================================== --- trunk/src/http/ngx_http_special_response.c 2012-02-22 11:28:53 UTC (rev 4490) +++ trunk/src/http/ngx_http_special_response.c 2012-02-22 16:23:29 UTC (rev 4491) @@ -294,16 +294,16 @@ ngx_null_string, /* 201, 204 */ -#define NGX_HTTP_LAST_LEVEL_200 202 -#define NGX_HTTP_LEVEL_200 (NGX_HTTP_LAST_LEVEL_200 - 201) +#define NGX_HTTP_LAST_2XX 202 +#define NGX_HTTP_OFF_3XX (NGX_HTTP_LAST_2XX - 201) /* ngx_null_string, */ /* 300 */ ngx_string(ngx_http_error_301_page), ngx_string(ngx_http_error_302_page), ngx_string(ngx_http_error_303_page), -#define NGX_HTTP_LAST_LEVEL_300 304 -#define NGX_HTTP_LEVEL_300 (NGX_HTTP_LAST_LEVEL_300 - 301) +#define NGX_HTTP_LAST_3XX 304 +#define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX) ngx_string(ngx_http_error_400_page), ngx_string(ngx_http_error_401_page), @@ -323,8 +323,8 @@ ngx_string(ngx_http_error_415_page), ngx_string(ngx_http_error_416_page), -#define NGX_HTTP_LAST_LEVEL_400 417 -#define NGX_HTTP_LEVEL_400 (NGX_HTTP_LAST_LEVEL_400 - 400) +#define NGX_HTTP_LAST_4XX 417 +#define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX) ngx_string(ngx_http_error_494_page), /* 494, request header too large */ ngx_string(ngx_http_error_495_page), /* 495, https certificate error */ @@ -342,7 +342,7 @@ ngx_null_string, /* 506 */ ngx_string(ngx_http_error_507_page) -#define NGX_HTTP_LAST_LEVEL_500 508 +#define NGX_HTTP_LAST_5XX 508 }; @@ -428,25 +428,22 @@ err = 0; } else if (error >= NGX_HTTP_MOVED_PERMANENTLY - && error < NGX_HTTP_LAST_LEVEL_300) + && error < NGX_HTTP_LAST_3XX) { /* 3XX */ - err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_LEVEL_200; + err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_OFF_3XX; } else if (error >= NGX_HTTP_BAD_REQUEST - && error < NGX_HTTP_LAST_LEVEL_400) + && error < NGX_HTTP_LAST_4XX) { /* 4XX */ - err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_LEVEL_200 - + NGX_HTTP_LEVEL_300; + err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_OFF_4XX; } else if (error >= NGX_HTTP_NGINX_CODES - && error < NGX_HTTP_LAST_LEVEL_500) + && error < NGX_HTTP_LAST_5XX) { /* 49X, 5XX */ - err = error - NGX_HTTP_NGINX_CODES + NGX_HTTP_LEVEL_200 - + NGX_HTTP_LEVEL_300 - + NGX_HTTP_LEVEL_400; + err = error - NGX_HTTP_NGINX_CODES + NGX_HTTP_OFF_5XX; switch (error) { case NGX_HTTP_TO_HTTPS: case NGX_HTTPS_CERT_ERROR: @@ -595,7 +592,7 @@ return ngx_http_send_special_response(r, clcf, r->err_status - NGX_HTTP_MOVED_PERMANENTLY - + NGX_HTTP_LEVEL_200); + + NGX_HTTP_OFF_3XX); } @@ -626,7 +623,7 @@ if (clcf->msie_padding && (r->headers_in.msie || r->headers_in.chrome) && r->http_version >= NGX_HTTP_VERSION_10 - && err >= NGX_HTTP_LEVEL_300) + && err >= NGX_HTTP_OFF_4XX) { r->headers_out.content_length_n += sizeof(ngx_http_msie_padding) - 1; From sergey.siroezhkin at gmail.com Wed Feb 22 16:36:07 2012 From: sergey.siroezhkin at gmail.com (Sergey Petrov) Date: Wed, 22 Feb 2012 20:36:07 +0400 Subject: ngx_http_complex_value VS ngx_http_script In-Reply-To: <20120222142933.GA67687@mdounin.ru> References: <20120222142933.GA67687@mdounin.ru> Message-ID: Thanks a lot for this explicit explanation! On Wed, Feb 22, 2012 at 6:29 PM, Maxim Dounin wrote: > Hello! > > On Wed, Feb 22, 2012 at 02:30:46PM +0400, Sergey Petrov wrote: > >> Hi, >> can somone explain the difference? What's the correct usecase for >> ngx_http_script? > > The complex value is basically a simplified envelope for script > functionality for a simple case of a single string with (optional) > variables. > > In most cases (unless you are targeting your code for old nginx > versions) a complex value will be ok for you. ?Note complex values > were introduced relatively recently, so in many cases nginx code > still uses script directly. > > There are also some specific situations though, when you may need > to use script functionality directly. ?E.g. proxy module will do > this when evaluating proxy_set_header directives, as this allows > flush uncacheable variables only once. > > Maxim Dounin > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From rickytato at r2consulting.it Wed Feb 22 16:44:09 2012 From: rickytato at r2consulting.it (rickytato rickytato) Date: Wed, 22 Feb 2012 17:44:09 +0100 Subject: [nginx] svn commit: r4424 - trunk/src/core In-Reply-To: <20120130125359.8BAA93F9CFD@mail.nginx.com> References: <20120130125359.8BAA93F9CFD@mail.nginx.com> Message-ID: I'm trying to compile Nginx with pcre jit support but I've an error: objs/src/core/ngx_regex.o: In function `ngx_pcre_free_studies': /usr/local/src/nginx-1.1.15/src/core/ngx_regex.c:307: undefined reference to `pcre_free_study' collect2: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 I'v compiled pcre-8.21 with: ./configure --prefix=/usr/local/ --enable-jit --enable-utf8 --enable-unicode-properties but nginx won't compile. rr 2012/1/30 : > Author: vbart > Date: 2012-01-30 12:53:57 +0000 (Mon, 30 Jan 2012) > New Revision: 4424 > > Modified: > ? trunk/src/core/ngx_regex.c > Log: > Fixed memory leak on HUP signal when PCRE JIT was used. > > The PCRE JIT compiler uses mmap to allocate memory for its executable codes, so > we have to explicitly call the pcre_free_study() function to free this memory. > > > Modified: trunk/src/core/ngx_regex.c > =================================================================== > --- trunk/src/core/ngx_regex.c ?2012-01-30 11:22:56 UTC (rev 4423) > +++ trunk/src/core/ngx_regex.c ?2012-01-30 12:53:57 UTC (rev 4424) > @@ -16,6 +16,9 @@ > > ?static void * ngx_libc_cdecl ngx_regex_malloc(size_t size); > ?static void ngx_libc_cdecl ngx_regex_free(void *p); > +#if (NGX_HAVE_PCRE_JIT) > +static void ngx_pcre_free_studies(void *data); > +#endif > > ?static ngx_int_t ngx_regex_module_init(ngx_cycle_t *cycle); > > @@ -274,6 +277,41 @@ > ?} > > > +#if (NGX_HAVE_PCRE_JIT) > + > +static void > +ngx_pcre_free_studies(void *data) > +{ > + ? ?ngx_list_t *studies = data; > + > + ? ?ngx_uint_t ? ? ? ?i; > + ? ?ngx_list_part_t ?*part; > + ? ?ngx_regex_elt_t ?*elts; > + > + ? ?part = &studies->part; > + ? ?elts = part->elts; > + > + ? ?for (i = 0 ; /* void */ ; i++) { > + > + ? ? ? ?if (i >= part->nelts) { > + ? ? ? ? ? ?if (part->next == NULL) { > + ? ? ? ? ? ? ? ?break; > + ? ? ? ? ? ?} > + > + ? ? ? ? ? ?part = part->next; > + ? ? ? ? ? ?elts = part->elts; > + ? ? ? ? ? ?i = 0; > + ? ? ? ?} > + > + ? ? ? ?if (elts[i].regex->extra != NULL) { > + ? ? ? ? ? ?pcre_free_study(elts[i].regex->extra); > + ? ? ? ?} > + ? ?} > +} > + > +#endif > + > + > ?static ngx_int_t > ?ngx_regex_module_init(ngx_cycle_t *cycle) > ?{ > @@ -287,12 +325,27 @@ > > ?#if (NGX_HAVE_PCRE_JIT) > ? ? { > - ? ?ngx_regex_conf_t ?*rcf; > + ? ?ngx_regex_conf_t ? ?*rcf; > + ? ?ngx_pool_cleanup_t ?*cln; > > ? ? rcf = (ngx_regex_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_regex_module); > > ? ? if (rcf->pcre_jit) { > ? ? ? ? opt = PCRE_STUDY_JIT_COMPILE; > + > + ? ? ? ?/* > + ? ? ? ? * The PCRE JIT compiler uses mmap for its executable codes, so we > + ? ? ? ? * have to explicitly call the pcre_free_study() function to free > + ? ? ? ? * this memory. > + ? ? ? ? */ > + > + ? ? ? ?cln = ngx_pool_cleanup_add(cycle->pool, 0); > + ? ? ? ?if (cln == NULL) { > + ? ? ? ? ? ?return NGX_ERROR; > + ? ? ? ?} > + > + ? ? ? ?cln->handler = ngx_pcre_free_studies; > + ? ? ? ?cln->data = ngx_pcre_studies; > ? ? } > ? ? } > ?#endif > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From ne at vbart.ru Wed Feb 22 18:03:54 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 22 Feb 2012 22:03:54 +0400 Subject: [nginx] svn commit: r4424 - trunk/src/core In-Reply-To: References: <20120130125359.8BAA93F9CFD@mail.nginx.com> Message-ID: <201202222203.54682.ne@vbart.ru> On Wednesday 22 February 2012 20:44:09 rickytato rickytato wrote: > I'm trying to compile Nginx with pcre jit support but I've an error: > > > objs/src/core/ngx_regex.o: In function `ngx_pcre_free_studies': > /usr/local/src/nginx-1.1.15/src/core/ngx_regex.c:307: undefined > reference to `pcre_free_study' > collect2: ld returned 1 exit status > make[1]: *** [objs/nginx] Error 1 > > > I'v compiled pcre-8.21 with: ./configure --prefix=/usr/local/ > --enable-jit --enable-utf8 --enable-unicode-properties > but nginx won't compile. > Probably, you have the same problem as mentioned in this ticket: http://trac.nginx.org/nginx/ticket/94 If so, the solution is in the last comment by Maxim Dounin: http://trac.nginx.org/nginx/ticket/94#comment:9 Also, it's possible to compile nginx with pcre from source by using the "--with-pcre=/path/to/pcre/source" and "--with-pcre-jit" configure flags. , see http://nginx.org/en/docs/install.html for more information. wbr, Valentin V. Bartenev From zhuzhaoyuan at gmail.com Thu Feb 23 07:21:05 2012 From: zhuzhaoyuan at gmail.com (Joshua Zhu) Date: Thu, 23 Feb 2012 15:21:05 +0800 Subject: [PATCH] Fix logging keepalive related variables bug In-Reply-To: References: Message-ID: Hi, On Mon, Feb 13, 2012 at 3:08 PM, Joshua Zhu wrote: > Hi, > > A bug was introduced in revision 3181 that r->keepalive was set to 0 > before calling ngx_http_log_reques(), so the $sent_http_connection and > $sent_http_keep_alive variables will not work anymore. Could someone please review this patch? Regards, -- Joshua Zhu Senior Software Engineer Server Platforms Team at Taobao From mdounin at mdounin.ru Fri Feb 24 04:33:34 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 24 Feb 2012 08:33:34 +0400 Subject: [PATCH] Fix logging keepalive related variables bug In-Reply-To: References: Message-ID: <20120224043334.GH67687@mdounin.ru> Hello! On Thu, Feb 23, 2012 at 03:21:05PM +0800, Joshua Zhu wrote: > Hi, > > On Mon, Feb 13, 2012 at 3:08 PM, Joshua Zhu wrote: > > Hi, > > > > A bug was introduced in revision 3181 that r->keepalive was set to 0 > > before calling ngx_http_log_reques(), so the $sent_http_connection and > > $sent_http_keep_alive variables will not work anymore. > > Could someone please review this patch? It's flagged in my mailbox. There is nothing wrong with the patch, but I tend to think that original r3181 is wrong and should be just reverted (or redone properly if it tries to address some valid problem). I've tried to ask Igor about it but he doesn't remember details, so it waits for detailed invesigation. Maxim Dounin From ja.nginx at mailnull.com Sun Feb 26 15:15:33 2012 From: ja.nginx at mailnull.com (SamB) Date: Sun, 26 Feb 2012 16:15:33 +0100 Subject: [PATCH] add xslt_stylesheet_param directive In-Reply-To: <20120209231221.GR67687@mdounin.ru> References: <20120209231221.GR67687@mdounin.ru> Message-ID: Hi, sorry for late response, had no spare time for this. Here is new patch, please review it. I've modified the string_param-enabled - it seems to better fit my usage... Name for CHANGES: Samuel Behan Thanks Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx-1.1.13-xslt-params.patch Type: application/octet-stream Size: 7778 bytes Desc: not available URL: From goelvivek2011 at gmail.com Sun Feb 26 17:45:31 2012 From: goelvivek2011 at gmail.com (vivek goel) Date: Sun, 26 Feb 2012 23:15:31 +0530 Subject: How to parse post data in nginx module ? Message-ID: For reading get request I can use function ngx_http_form_input_arg but I couldn't find any function by using which I can read post data in nginx ? Is there any function in devel module or nginx api I can use to read post data ? regards Vivek Goel -------------- next part -------------- An HTML attachment was scrubbed... URL: From kyprizel at gmail.com Sun Feb 26 17:52:49 2012 From: kyprizel at gmail.com (kyprizel) Date: Sun, 26 Feb 2012 21:52:49 +0400 Subject: How to parse post data in nginx module ? In-Reply-To: References: Message-ID: <4F4A7171.3010003@gmail.com> Hi, Vivek Please, check this one https://github.com/calio/form-input-nginx-module Regards, kyprizel. 26.02.2012 21:45, vivek goel ?????: > For reading get request I can use function ngx_http_form_input_arg but > I couldn't find any function by using which I can read post data in > nginx ? > Is there any function in devel module or nginx api I can use to read > post data ? > > regards > Vivek Goel > > > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From zls.sogou at gmail.com Mon Feb 27 09:52:45 2012 From: zls.sogou at gmail.com (lanshun zhou) Date: Mon, 27 Feb 2012 17:52:45 +0800 Subject: [BUG] memory leak risk in rbtree operation with hash collision Message-ID: The algorithm of many rbtree lookup functions in nginx requires that nodes with the same hash value are linked together, but sometimes this may be broken with the rebalance of the tree after new nodes inserted. See the following example, the number contains hash value and node key, 51 shares the same hash value with 52. After the inserting of 63 and the rebalancing of the tree, they are separated. Then 51 is "lost" from the tree. every lookup for 51 returns null and new nodes are always alloced until one of them is linked with 52 again. [image: ???? 1] rbtree2.diff is a clean diff which ignores white space changes. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: rbtree.png Type: image/png Size: 8401 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: rbtree.diff Type: application/octet-stream Size: 10301 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: rbtree2.diff Type: application/octet-stream Size: 5059 bytes Desc: not available URL: From ru at nginx.com Mon Feb 27 11:43:41 2012 From: ru at nginx.com (ru at nginx.com) Date: Mon, 27 Feb 2012 11:43:41 +0000 Subject: [nginx] svn commit: r4492 - in trunk/src/http: . modules modules/perl Message-ID: <20120227114341.4CF673F9C1E@mail.nginx.com> Author: ru Date: 2012-02-27 11:43:40 +0000 (Mon, 27 Feb 2012) New Revision: 4492 Log: Added support for the 307 Temporary Redirect. Modified: trunk/src/http/modules/ngx_http_headers_filter_module.c trunk/src/http/modules/perl/nginx.pm trunk/src/http/ngx_http_core_module.c trunk/src/http/ngx_http_header_filter_module.c trunk/src/http/ngx_http_request.h trunk/src/http/ngx_http_special_response.c Modified: trunk/src/http/modules/ngx_http_headers_filter_module.c =================================================================== --- trunk/src/http/modules/ngx_http_headers_filter_module.c 2012-02-22 16:23:29 UTC (rev 4491) +++ trunk/src/http/modules/ngx_http_headers_filter_module.c 2012-02-27 11:43:40 UTC (rev 4492) @@ -149,7 +149,9 @@ && r->headers_out.status != NGX_HTTP_PARTIAL_CONTENT && r->headers_out.status != NGX_HTTP_MOVED_PERMANENTLY && r->headers_out.status != NGX_HTTP_MOVED_TEMPORARILY - && r->headers_out.status != NGX_HTTP_NOT_MODIFIED)) + && r->headers_out.status != NGX_HTTP_SEE_OTHER + && r->headers_out.status != NGX_HTTP_NOT_MODIFIED + && r->headers_out.status != NGX_HTTP_TEMPORARY_REDIRECT)) { return ngx_http_next_header_filter(r); } Modified: trunk/src/http/modules/perl/nginx.pm =================================================================== --- trunk/src/http/modules/perl/nginx.pm 2012-02-22 16:23:29 UTC (rev 4491) +++ trunk/src/http/modules/perl/nginx.pm 2012-02-27 11:43:40 UTC (rev 4492) @@ -21,7 +21,9 @@ HTTP_MOVED_PERMANENTLY HTTP_MOVED_TEMPORARILY HTTP_REDIRECT + HTTP_SEE_OTHER HTTP_NOT_MODIFIED + HTTP_TEMPORARY_REDIRECT HTTP_BAD_REQUEST HTTP_UNAUTHORIZED @@ -67,7 +69,9 @@ use constant HTTP_MOVED_PERMANENTLY => 301; use constant HTTP_MOVED_TEMPORARILY => 302; use constant HTTP_REDIRECT => 302; +use constant HTTP_SEE_OTHER => 303; use constant HTTP_NOT_MODIFIED => 304; +use constant HTTP_TEMPORARY_REDIRECT => 307; use constant HTTP_BAD_REQUEST => 400; use constant HTTP_UNAUTHORIZED => 401; Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-02-22 16:23:29 UTC (rev 4491) +++ trunk/src/http/ngx_http_core_module.c 2012-02-27 11:43:40 UTC (rev 4492) @@ -1824,8 +1824,11 @@ return NGX_HTTP_INTERNAL_SERVER_ERROR; } - if (status >= NGX_HTTP_MOVED_PERMANENTLY && status <= NGX_HTTP_SEE_OTHER) { - + if (status == NGX_HTTP_MOVED_PERMANENTLY + || status == NGX_HTTP_MOVED_TEMPORARILY + || status == NGX_HTTP_SEE_OTHER + || status == NGX_HTTP_TEMPORARY_REDIRECT) + { ngx_http_clear_location(r); r->headers_out.location = ngx_list_push(&r->headers_out.headers); Modified: trunk/src/http/ngx_http_header_filter_module.c =================================================================== --- trunk/src/http/ngx_http_header_filter_module.c 2012-02-22 16:23:29 UTC (rev 4491) +++ trunk/src/http/ngx_http_header_filter_module.c 2012-02-27 11:43:40 UTC (rev 4492) @@ -71,12 +71,11 @@ ngx_string("302 Moved Temporarily"), ngx_string("303 See Other"), ngx_string("304 Not Modified"), + ngx_null_string, /* "305 Use Proxy" */ + ngx_null_string, /* "306 unused" */ + ngx_string("307 Temporary Redirect"), - /* ngx_null_string, */ /* "305 Use Proxy" */ - /* ngx_null_string, */ /* "306 unused" */ - /* ngx_null_string, */ /* "307 Temporary Redirect" */ - -#define NGX_HTTP_LAST_3XX 305 +#define NGX_HTTP_LAST_3XX 308 #define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX) ngx_string("400 Bad Request"), Modified: trunk/src/http/ngx_http_request.h =================================================================== --- trunk/src/http/ngx_http_request.h 2012-02-22 16:23:29 UTC (rev 4491) +++ trunk/src/http/ngx_http_request.h 2012-02-27 11:43:40 UTC (rev 4492) @@ -75,6 +75,7 @@ #define NGX_HTTP_MOVED_TEMPORARILY 302 #define NGX_HTTP_SEE_OTHER 303 #define NGX_HTTP_NOT_MODIFIED 304 +#define NGX_HTTP_TEMPORARY_REDIRECT 307 #define NGX_HTTP_BAD_REQUEST 400 #define NGX_HTTP_UNAUTHORIZED 401 Modified: trunk/src/http/ngx_http_special_response.c =================================================================== --- trunk/src/http/ngx_http_special_response.c 2012-02-22 16:23:29 UTC (rev 4491) +++ trunk/src/http/ngx_http_special_response.c 2012-02-27 11:43:40 UTC (rev 4492) @@ -74,6 +74,14 @@ ; +static char ngx_http_error_307_page[] = +"" CRLF +"307 Temporary Redirect" CRLF +"" CRLF +"

307 Temporary Redirect

" CRLF +; + + static char ngx_http_error_400_page[] = "" CRLF "400 Bad Request" CRLF @@ -301,8 +309,12 @@ ngx_string(ngx_http_error_301_page), ngx_string(ngx_http_error_302_page), ngx_string(ngx_http_error_303_page), + ngx_null_string, /* 304 */ + ngx_null_string, /* 305 */ + ngx_null_string, /* 306 */ + ngx_string(ngx_http_error_307_page), -#define NGX_HTTP_LAST_3XX 304 +#define NGX_HTTP_LAST_3XX 308 #define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX) ngx_string(ngx_http_error_400_page), @@ -567,12 +579,11 @@ return NGX_ERROR; } - if (overwrite >= NGX_HTTP_MOVED_PERMANENTLY - && overwrite <= NGX_HTTP_SEE_OTHER) + if (overwrite != NGX_HTTP_MOVED_PERMANENTLY + && overwrite != NGX_HTTP_MOVED_TEMPORARILY + && overwrite != NGX_HTTP_SEE_OTHER + && overwrite != NGX_HTTP_TEMPORARY_REDIRECT) { - r->err_status = overwrite; - - } else { r->err_status = NGX_HTTP_MOVED_TEMPORARILY; } From mdounin at mdounin.ru Mon Feb 27 16:23:44 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 27 Feb 2012 16:23:44 +0000 Subject: [nginx] svn commit: r4493 - trunk/auto/cc Message-ID: <20120227162344.A086F3F9C1E@mail.nginx.com> Author: mdounin Date: 2012-02-27 16:23:44 +0000 (Mon, 27 Feb 2012) New Revision: 4493 Log: Configure: moved icc detection before gcc. New versions of icc confuse auto/cc/name due to introduced handling of a "icc -v": $ icc -v icc version 12.1.3 (gcc version 4.6.0 compatibility) $ icc -V Intel(R) C Compiler XE for applications running on IA-32, Version 12.1.3.293 Build 20120212 Copyright (C) 1985-2012 Intel Corporation. All rights reserved. FOR NON-COMMERCIAL USE ONLY See report here: http://mailman.nginx.org/pipermail/nginx/2012-February/032177.html Modified: trunk/auto/cc/name Modified: trunk/auto/cc/name =================================================================== --- trunk/auto/cc/name 2012-02-27 11:43:40 UTC (rev 4492) +++ trunk/auto/cc/name 2012-02-27 16:23:44 UTC (rev 4493) @@ -64,16 +64,16 @@ echo " + using Borland C++ compiler" else +if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then + NGX_CC_NAME=icc + echo " + using Intel C++ compiler" + +else if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then NGX_CC_NAME=gcc echo " + using GNU C compiler" else -if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then - NGX_CC_NAME=icc - echo " + using Intel C++ compiler" - -else if `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then NGX_CC_NAME=sunc echo " + using Sun C compiler" From vbart at nginx.com Mon Feb 27 16:46:57 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Mon, 27 Feb 2012 16:46:57 +0000 Subject: [nginx] svn commit: r4494 - trunk/src/core Message-ID: Author: vbart Date: 2012-02-27 16:46:57 +0000 (Mon, 27 Feb 2012) New Revision: 4494 Modified: trunk/src/core/ngx_open_file_cache.c trunk/src/core/ngx_open_file_cache.h Log: Disable symlinks: added the "from" parameter support to the open file cache. Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-27 16:23:44 UTC (rev 4493) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-27 16:46:57 UTC (rev 4494) @@ -229,6 +229,7 @@ && now - file->created < of->valid #if (NGX_HAVE_OPENAT) && of->disable_symlinks == file->disable_symlinks + && of->disable_symlinks_from == file->disable_symlinks_from #endif )) { @@ -395,6 +396,7 @@ file->err = of->err; #if (NGX_HAVE_OPENAT) file->disable_symlinks = of->disable_symlinks; + file->disable_symlinks_from = of->disable_symlinks_from; #endif if (of->err == 0) { @@ -583,7 +585,28 @@ at_name = *name; - if (*p == '/') { + if (of->disable_symlinks_from) { + + cp = p + of->disable_symlinks_from; + + *cp = '\0'; + + at_fd = ngx_open_file(p, NGX_FILE_SEARCH|NGX_FILE_NONBLOCK, + NGX_FILE_OPEN, 0); + + *cp = '/'; + + if (at_fd == NGX_INVALID_FILE) { + of->err = ngx_errno; + of->failed = ngx_open_file_n; + return NGX_INVALID_FILE; + } + + at_name.len = of->disable_symlinks_from; + p = cp + 1; + + } else if (*p == '/') { + at_fd = ngx_open_file("/", NGX_FILE_SEARCH|NGX_FILE_NONBLOCK, NGX_FILE_OPEN, 0); Modified: trunk/src/core/ngx_open_file_cache.h =================================================================== --- trunk/src/core/ngx_open_file_cache.h 2012-02-27 16:23:44 UTC (rev 4493) +++ trunk/src/core/ngx_open_file_cache.h 2012-02-27 16:46:57 UTC (rev 4494) @@ -33,6 +33,7 @@ ngx_uint_t min_uses; #if (NGX_HAVE_OPENAT) + size_t disable_symlinks_from; unsigned disable_symlinks:2; #endif @@ -69,6 +70,7 @@ uint32_t uses; #if (NGX_HAVE_OPENAT) + size_t disable_symlinks_from; unsigned disable_symlinks:2; #endif From vbart at nginx.com Mon Feb 27 16:51:29 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Mon, 27 Feb 2012 16:51:29 +0000 Subject: [nginx] svn commit: r4495 - in trunk/src/http: . modules modules/perl Message-ID: Author: vbart Date: 2012-02-27 16:51:28 +0000 (Mon, 27 Feb 2012) New Revision: 4495 Modified: trunk/src/http/modules/ngx_http_flv_module.c trunk/src/http/modules/ngx_http_gzip_static_module.c trunk/src/http/modules/ngx_http_index_module.c trunk/src/http/modules/ngx_http_log_module.c trunk/src/http/modules/ngx_http_mp4_module.c trunk/src/http/modules/ngx_http_static_module.c trunk/src/http/modules/perl/nginx.xs trunk/src/http/ngx_http_core_module.c trunk/src/http/ngx_http_core_module.h trunk/src/http/ngx_http_script.c Log: Disable symlinks: initialization of the "disable_symlinks" field in ngx_open_file_info_t moved to a separate function. This is preparation for the "from=" parameter implementation of the "disabled_symlinks" directive. Modified: trunk/src/http/modules/ngx_http_flv_module.c =================================================================== --- trunk/src/http/modules/ngx_http_flv_module.c 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/modules/ngx_http_flv_module.c 2012-02-27 16:51:28 UTC (rev 4495) @@ -109,10 +109,11 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { Modified: trunk/src/http/modules/ngx_http_gzip_static_module.c =================================================================== --- trunk/src/http/modules/ngx_http_gzip_static_module.c 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/modules/ngx_http_gzip_static_module.c 2012-02-27 16:51:28 UTC (rev 4495) @@ -129,10 +129,11 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { Modified: trunk/src/http/modules/ngx_http_index_module.c =================================================================== --- trunk/src/http/modules/ngx_http_index_module.c 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/modules/ngx_http_index_module.c 2012-02-27 16:51:28 UTC (rev 4495) @@ -209,10 +209,11 @@ of.test_only = 1; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { @@ -307,10 +308,11 @@ of.test_only = 1; of.valid = clcf->open_file_cache_valid; of.errors = clcf->open_file_cache_errors; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &dir, &of) != NGX_OK) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool) != NGX_OK) { Modified: trunk/src/http/modules/ngx_http_log_module.c =================================================================== --- trunk/src/http/modules/ngx_http_log_module.c 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/modules/ngx_http_log_module.c 2012-02-27 16:51:28 UTC (rev 4495) @@ -394,10 +394,12 @@ of.test_only = 1; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { + /* simulate successful logging */ + return len; + } + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { @@ -444,10 +446,12 @@ of.valid = llcf->open_file_cache_valid; of.min_uses = llcf->open_file_cache_min_uses; of.directio = NGX_OPEN_FILE_DIRECTIO_OFF; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &log, &of) != NGX_OK) { + /* simulate successful logging */ + return len; + } + if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) != NGX_OK) { Modified: trunk/src/http/modules/ngx_http_mp4_module.c =================================================================== --- trunk/src/http/modules/ngx_http_mp4_module.c 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/modules/ngx_http_mp4_module.c 2012-02-27 16:51:28 UTC (rev 4495) @@ -440,10 +440,11 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { Modified: trunk/src/http/modules/ngx_http_static_module.c =================================================================== --- trunk/src/http/modules/ngx_http_static_module.c 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/modules/ngx_http_static_module.c 2012-02-27 16:51:28 UTC (rev 4495) @@ -94,10 +94,11 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { Modified: trunk/src/http/modules/perl/nginx.xs =================================================================== --- trunk/src/http/modules/perl/nginx.xs 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/modules/perl/nginx.xs 2012-02-27 16:51:28 UTC (rev 4495) @@ -662,10 +662,11 @@ of.min_uses = clcf->open_file_cache_min_uses; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { + XSRETURN_EMPTY; + } + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/ngx_http_core_module.c 2012-02-27 16:51:28 UTC (rev 4495) @@ -1320,10 +1320,12 @@ of.test_only = 1; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { + ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); + return NGX_OK; + } + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { @@ -2645,6 +2647,18 @@ } +ngx_int_t +ngx_http_set_disable_symlinks(ngx_http_request_t *r, + ngx_http_core_loc_conf_t *clcf, ngx_str_t *path, ngx_open_file_info_t *of) +{ +#if (NGX_HAVE_OPENAT) + of->disable_symlinks = clcf->disable_symlinks; +#endif + + return NGX_OK; +} + + static char * ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) { Modified: trunk/src/http/ngx_http_core_module.h =================================================================== --- trunk/src/http/ngx_http_core_module.h 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/ngx_http_core_module.h 2012-02-27 16:51:28 UTC (rev 4495) @@ -509,6 +509,10 @@ ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *chain); +ngx_int_t ngx_http_set_disable_symlinks(ngx_http_request_t *r, + ngx_http_core_loc_conf_t *clcf, ngx_str_t *path, ngx_open_file_info_t *of); + + extern ngx_module_t ngx_http_core_module; extern ngx_uint_t ngx_http_max_module; Modified: trunk/src/http/ngx_http_script.c =================================================================== --- trunk/src/http/ngx_http_script.c 2012-02-27 16:46:57 UTC (rev 4494) +++ trunk/src/http/ngx_http_script.c 2012-02-27 16:51:28 UTC (rev 4495) @@ -1505,10 +1505,13 @@ of.test_only = 1; of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; -#if (NGX_HAVE_OPENAT) - of.disable_symlinks = clcf->disable_symlinks; -#endif + if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) { + e->ip = ngx_http_script_exit; + e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; + return; + } + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { From vbart at nginx.com Mon Feb 27 16:54:10 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Mon, 27 Feb 2012 16:54:10 +0000 Subject: [nginx] svn commit: r4496 - trunk/src/http Message-ID: Author: vbart Date: 2012-02-27 16:54:10 +0000 (Mon, 27 Feb 2012) New Revision: 4496 Modified: trunk/src/http/ngx_http_core_module.c trunk/src/http/ngx_http_core_module.h Log: Disable symlinks: added the "from=" parameter to the "disable_symlinks" directive. Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-02-27 16:51:28 UTC (rev 4495) +++ trunk/src/http/ngx_http_core_module.c 2012-02-27 16:54:10 UTC (rev 4496) @@ -76,6 +76,10 @@ static char *ngx_http_gzip_disable(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); #endif +#if (NGX_HAVE_OPENAT) +static char *ngx_http_disable_symlinks(ngx_conf_t *cf, ngx_command_t *cmd, + void *conf); +#endif static char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data); static char *ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data); @@ -187,18 +191,6 @@ #endif -#if (NGX_HAVE_OPENAT) - -static ngx_conf_enum_t ngx_http_core_disable_symlinks[] = { - { ngx_string("off"), NGX_DISABLE_SYMLINKS_OFF }, - { ngx_string("if_not_owner"), NGX_DISABLE_SYMLINKS_NOTOWNER }, - { ngx_string("on"), NGX_DISABLE_SYMLINKS_ON }, - { ngx_null_string, 0 } -}; - -#endif - - static ngx_command_t ngx_http_core_commands[] = { { ngx_string("variables_hash_max_size"), @@ -779,11 +771,11 @@ #if (NGX_HAVE_OPENAT) { ngx_string("disable_symlinks"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_conf_set_enum_slot, + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12, + ngx_http_disable_symlinks, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_core_loc_conf_t, disable_symlinks), - &ngx_http_core_disable_symlinks }, + 0, + NULL }, #endif @@ -2652,7 +2644,45 @@ ngx_http_core_loc_conf_t *clcf, ngx_str_t *path, ngx_open_file_info_t *of) { #if (NGX_HAVE_OPENAT) + u_char *p; + ngx_str_t from; + of->disable_symlinks = clcf->disable_symlinks; + + if (clcf->disable_symlinks_from == NULL) { + return NGX_OK; + } + + if (ngx_http_complex_value(r, clcf->disable_symlinks_from, &from) + != NGX_OK) + { + return NGX_ERROR; + } + + if (from.len == 0 + || from.len > path->len + || ngx_memcmp(path->data, from.data, from.len) != 0) + { + return NGX_OK; + } + + if (from.len == path->len) { + of->disable_symlinks = NGX_DISABLE_SYMLINKS_OFF; + return NGX_OK; + } + + p = path->data + from.len; + + if (*p == '/') { + of->disable_symlinks_from = from.len; + return NGX_OK; + } + + p--; + + if (*p == '/') { + of->disable_symlinks_from = from.len - 1; + } #endif return NGX_OK; @@ -3389,6 +3419,7 @@ #if (NGX_HAVE_OPENAT) clcf->disable_symlinks = NGX_CONF_UNSET_UINT; + clcf->disable_symlinks_from = NGX_CONF_UNSET_PTR; #endif return clcf; @@ -3673,6 +3704,8 @@ #if (NGX_HAVE_OPENAT) ngx_conf_merge_uint_value(conf->disable_symlinks, prev->disable_symlinks, NGX_DISABLE_SYMLINKS_OFF); + ngx_conf_merge_ptr_value(conf->disable_symlinks_from, + prev->disable_symlinks_from, NULL); #endif return NGX_CONF_OK; @@ -4808,7 +4841,101 @@ #endif +#if (NGX_HAVE_OPENAT) + static char * +ngx_http_disable_symlinks(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) +{ + ngx_http_core_loc_conf_t *clcf = conf; + + ngx_str_t *value; + ngx_uint_t i; + ngx_http_compile_complex_value_t ccv; + + if (clcf->disable_symlinks != NGX_CONF_UNSET_UINT) { + return "is duplicate"; + } + + value = cf->args->elts; + + for (i = 1; i < cf->args->nelts; i++) { + + if (ngx_strcmp(value[i].data, "off") == 0) { + clcf->disable_symlinks = NGX_DISABLE_SYMLINKS_OFF; + continue; + } + + if (ngx_strcmp(value[i].data, "if_not_owner") == 0) { + clcf->disable_symlinks = NGX_DISABLE_SYMLINKS_NOTOWNER; + continue; + } + + if (ngx_strcmp(value[i].data, "on") == 0) { + clcf->disable_symlinks = NGX_DISABLE_SYMLINKS_ON; + continue; + } + + if (ngx_strncmp(value[i].data, "from=", 5) == 0) { + value[i].len -= 5; + value[i].data += 5; + + ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); + + ccv.cf = cf; + ccv.value = &value[i]; + ccv.complex_value = ngx_palloc(cf->pool, + sizeof(ngx_http_complex_value_t)); + if (ccv.complex_value == NULL) { + return NGX_CONF_ERROR; + } + + if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { + return NGX_CONF_ERROR; + } + + clcf->disable_symlinks_from = ccv.complex_value; + + continue; + } + + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "invalid parameter \"%V\"", &value[i]); + return NGX_CONF_ERROR; + } + + if (clcf->disable_symlinks == NGX_CONF_UNSET_UINT) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "\"%V\" must have \"off\", \"on\" " + "or \"if_not_owner\" parameter", + &cmd->name); + return NGX_CONF_ERROR; + } + + if (cf->args->nelts == 2) { + clcf->disable_symlinks_from = NULL; + return NGX_CONF_OK; + } + + if (clcf->disable_symlinks_from == NGX_CONF_UNSET_PTR) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "duplicate parameters \"%V %V\"", + &value[1], &value[2]); + return NGX_CONF_ERROR; + } + + if (clcf->disable_symlinks == NGX_DISABLE_SYMLINKS_OFF) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "\"from=\" cannot be used with \"off\" parameter"); + return NGX_CONF_ERROR; + } + + return NGX_CONF_OK; +} + +#endif + + +static char * ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data) { #if (NGX_FREEBSD) Modified: trunk/src/http/ngx_http_core_module.h =================================================================== --- trunk/src/http/ngx_http_core_module.h 2012-02-27 16:51:28 UTC (rev 4495) +++ trunk/src/http/ngx_http_core_module.h 2012-02-27 16:54:10 UTC (rev 4496) @@ -406,6 +406,7 @@ #if (NGX_HAVE_OPENAT) ngx_uint_t disable_symlinks; /* disable_symlinks */ + ngx_http_complex_value_t *disable_symlinks_from; #endif ngx_array_t *error_pages; /* error_page */ From mdounin at mdounin.ru Mon Feb 27 16:57:03 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 27 Feb 2012 16:57:03 +0000 Subject: [nginx] svn commit: r4497 - trunk/src/core Message-ID: <20120227165703.4C8283F9CB2@mail.nginx.com> Author: mdounin Date: 2012-02-27 16:57:02 +0000 (Mon, 27 Feb 2012) New Revision: 4497 Log: Fixed null pointer dereference in resolver (ticket #91). The cycle->new_log.file may not be set before config parsing finished if there are no error_log directive defined at global level. Fix is to copy it after config parsing. Patch by Roman Arutyunyan. Modified: trunk/src/core/ngx_resolver.c Modified: trunk/src/core/ngx_resolver.c =================================================================== --- trunk/src/core/ngx_resolver.c 2012-02-27 16:54:10 UTC (rev 4496) +++ trunk/src/core/ngx_resolver.c 2012-02-27 16:57:02 UTC (rev 4497) @@ -189,11 +189,6 @@ uc->sockaddr = u.addrs->sockaddr; uc->socklen = u.addrs->socklen; uc->server = u.addrs->name; - - uc->log = cf->cycle->new_log; - uc->log.handler = ngx_resolver_log_error; - uc->log.data = uc; - uc->log.action = "resolving"; } return r; @@ -876,6 +871,12 @@ } if (uc->connection == NULL) { + + uc->log = *r->log; + uc->log.handler = ngx_resolver_log_error; + uc->log.data = uc; + uc->log.action = "resolving"; + if (ngx_udp_connect(uc) != NGX_OK) { return NGX_ERROR; } From mdounin at mdounin.ru Mon Feb 27 22:15:40 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 27 Feb 2012 22:15:40 +0000 Subject: [nginx] svn commit: r4498 - in trunk/src: core event http http/modules Message-ID: <20120227221540.926373F9D33@mail.nginx.com> Author: mdounin Date: 2012-02-27 22:15:39 +0000 (Mon, 27 Feb 2012) New Revision: 4498 Log: Fix of rbtree lookup on hash collisions. Previous code incorrectly assumed that nodes with identical keys are linked together. This might not be true after tree rebalance. Patch by Lanshun Zhou. Modified: trunk/src/core/ngx_open_file_cache.c trunk/src/core/ngx_resolver.c trunk/src/event/ngx_event_openssl.c trunk/src/http/modules/ngx_http_limit_conn_module.c trunk/src/http/modules/ngx_http_limit_req_module.c trunk/src/http/ngx_http_file_cache.c Modified: trunk/src/core/ngx_open_file_cache.c =================================================================== --- trunk/src/core/ngx_open_file_cache.c 2012-02-27 16:57:02 UTC (rev 4497) +++ trunk/src/core/ngx_open_file_cache.c 2012-02-27 22:15:39 UTC (rev 4498) @@ -1142,20 +1142,15 @@ /* hash == node->key */ - do { - file = (ngx_cached_open_file_t *) node; + file = (ngx_cached_open_file_t *) node; - rc = ngx_strcmp(name->data, file->name); + rc = ngx_strcmp(name->data, file->name); - if (rc == 0) { - return file; - } + if (rc == 0) { + return file; + } - node = (rc < 0) ? node->left : node->right; - - } while (node != sentinel && hash == node->key); - - break; + node = (rc < 0) ? node->left : node->right; } return NULL; Modified: trunk/src/core/ngx_resolver.c =================================================================== --- trunk/src/core/ngx_resolver.c 2012-02-27 16:57:02 UTC (rev 4497) +++ trunk/src/core/ngx_resolver.c 2012-02-27 22:15:39 UTC (rev 4498) @@ -1689,20 +1689,15 @@ /* hash == node->key */ - do { - rn = (ngx_resolver_node_t *) node; + rn = (ngx_resolver_node_t *) node; - rc = ngx_memn2cmp(name->data, rn->name, name->len, rn->nlen); + rc = ngx_memn2cmp(name->data, rn->name, name->len, rn->nlen); - if (rc == 0) { - return rn; - } + if (rc == 0) { + return rn; + } - node = (rc < 0) ? node->left : node->right; - - } while (node != sentinel && hash == node->key); - - break; + node = (rc < 0) ? node->left : node->right; } /* not found */ Modified: trunk/src/event/ngx_event_openssl.c =================================================================== --- trunk/src/event/ngx_event_openssl.c 2012-02-27 16:57:02 UTC (rev 4497) +++ trunk/src/event/ngx_event_openssl.c 2012-02-27 22:15:39 UTC (rev 4498) @@ -1801,44 +1801,39 @@ /* hash == node->key */ - do { - sess_id = (ngx_ssl_sess_id_t *) node; + sess_id = (ngx_ssl_sess_id_t *) node; - rc = ngx_memn2cmp(id, sess_id->id, - (size_t) len, (size_t) node->data); - if (rc == 0) { + rc = ngx_memn2cmp(id, sess_id->id, (size_t) len, (size_t) node->data); - if (sess_id->expire > ngx_time()) { - ngx_memcpy(buf, sess_id->session, sess_id->len); + if (rc == 0) { - ngx_shmtx_unlock(&shpool->mutex); + if (sess_id->expire > ngx_time()) { + ngx_memcpy(buf, sess_id->session, sess_id->len); - p = buf; - sess = d2i_SSL_SESSION(NULL, &p, sess_id->len); + ngx_shmtx_unlock(&shpool->mutex); - return sess; - } + p = buf; + sess = d2i_SSL_SESSION(NULL, &p, sess_id->len); - ngx_queue_remove(&sess_id->queue); + return sess; + } - ngx_rbtree_delete(&cache->session_rbtree, node); + ngx_queue_remove(&sess_id->queue); - ngx_slab_free_locked(shpool, sess_id->session); + ngx_rbtree_delete(&cache->session_rbtree, node); + + ngx_slab_free_locked(shpool, sess_id->session); #if (NGX_PTR_SIZE == 4) - ngx_slab_free_locked(shpool, sess_id->id); + ngx_slab_free_locked(shpool, sess_id->id); #endif - ngx_slab_free_locked(shpool, sess_id); + ngx_slab_free_locked(shpool, sess_id); - sess = NULL; + sess = NULL; - goto done; - } + goto done; + } - node = (rc < 0) ? node->left : node->right; - - } while (node != sentinel && hash == node->key); - - break; + node = (rc < 0) ? node->left : node->right; } done: @@ -1908,31 +1903,26 @@ /* hash == node->key */ - do { - sess_id = (ngx_ssl_sess_id_t *) node; + sess_id = (ngx_ssl_sess_id_t *) node; - rc = ngx_memn2cmp(id, sess_id->id, len, (size_t) node->data); + rc = ngx_memn2cmp(id, sess_id->id, len, (size_t) node->data); - if (rc == 0) { + if (rc == 0) { - ngx_queue_remove(&sess_id->queue); + ngx_queue_remove(&sess_id->queue); - ngx_rbtree_delete(&cache->session_rbtree, node); + ngx_rbtree_delete(&cache->session_rbtree, node); - ngx_slab_free_locked(shpool, sess_id->session); + ngx_slab_free_locked(shpool, sess_id->session); #if (NGX_PTR_SIZE == 4) - ngx_slab_free_locked(shpool, sess_id->id); + ngx_slab_free_locked(shpool, sess_id->id); #endif - ngx_slab_free_locked(shpool, sess_id); + ngx_slab_free_locked(shpool, sess_id); - goto done; - } + goto done; + } - node = (rc < 0) ? node->left : node->right; - - } while (node != sentinel && hash == node->key); - - break; + node = (rc < 0) ? node->left : node->right; } done: Modified: trunk/src/http/modules/ngx_http_limit_conn_module.c =================================================================== --- trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-02-27 16:57:02 UTC (rev 4497) +++ trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-02-27 22:15:39 UTC (rev 4498) @@ -325,20 +325,15 @@ /* hash == node->key */ - do { - lcn = (ngx_http_limit_conn_node_t *) &node->color; + lcn = (ngx_http_limit_conn_node_t *) &node->color; - rc = ngx_memn2cmp(vv->data, lcn->data, - (size_t) vv->len, (size_t) lcn->len); - if (rc == 0) { - return node; - } + rc = ngx_memn2cmp(vv->data, lcn->data, + (size_t) vv->len, (size_t) lcn->len); + if (rc == 0) { + return node; + } - node = (rc < 0) ? node->left : node->right; - - } while (node != sentinel && hash == node->key); - - break; + node = (rc < 0) ? node->left : node->right; } return NULL; Modified: trunk/src/http/modules/ngx_http_limit_req_module.c =================================================================== --- trunk/src/http/modules/ngx_http_limit_req_module.c 2012-02-27 16:57:02 UTC (rev 4497) +++ trunk/src/http/modules/ngx_http_limit_req_module.c 2012-02-27 22:15:39 UTC (rev 4498) @@ -385,47 +385,42 @@ /* hash == node->key */ - do { - lr = (ngx_http_limit_req_node_t *) &node->color; + lr = (ngx_http_limit_req_node_t *) &node->color; - rc = ngx_memn2cmp(data, lr->data, len, (size_t) lr->len); + rc = ngx_memn2cmp(data, lr->data, len, (size_t) lr->len); - if (rc == 0) { - ngx_queue_remove(&lr->queue); - ngx_queue_insert_head(&ctx->sh->queue, &lr->queue); + if (rc == 0) { + ngx_queue_remove(&lr->queue); + ngx_queue_insert_head(&ctx->sh->queue, &lr->queue); - ms = (ngx_msec_int_t) (now - lr->last); + ms = (ngx_msec_int_t) (now - lr->last); - excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000; + excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000; - if (excess < 0) { - excess = 0; - } + if (excess < 0) { + excess = 0; + } - *ep = excess; + *ep = excess; - if ((ngx_uint_t) excess > limit->burst) { - return NGX_BUSY; - } + if ((ngx_uint_t) excess > limit->burst) { + return NGX_BUSY; + } - if (account) { - lr->excess = excess; - lr->last = now; - return NGX_OK; - } - - lr->count++; - - ctx->node = lr; - - return NGX_AGAIN; + if (account) { + lr->excess = excess; + lr->last = now; + return NGX_OK; } - node = (rc < 0) ? node->left : node->right; + lr->count++; - } while (node != sentinel && hash == node->key); + ctx->node = lr; - break; + return NGX_AGAIN; + } + + node = (rc < 0) ? node->left : node->right; } *ep = 0; Modified: trunk/src/http/ngx_http_file_cache.c =================================================================== --- trunk/src/http/ngx_http_file_cache.c 2012-02-27 16:57:02 UTC (rev 4497) +++ trunk/src/http/ngx_http_file_cache.c 2012-02-27 22:15:39 UTC (rev 4498) @@ -799,21 +799,16 @@ /* node_key == node->key */ - do { - fcn = (ngx_http_file_cache_node_t *) node; + fcn = (ngx_http_file_cache_node_t *) node; - rc = ngx_memcmp(&key[sizeof(ngx_rbtree_key_t)], fcn->key, - NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t)); + rc = ngx_memcmp(&key[sizeof(ngx_rbtree_key_t)], fcn->key, + NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t)); - if (rc == 0) { - return fcn; - } + if (rc == 0) { + return fcn; + } - node = (rc < 0) ? node->left : node->right; - - } while (node != sentinel && node_key == node->key); - - break; + node = (rc < 0) ? node->left : node->right; } /* not found */ From mdounin at mdounin.ru Mon Feb 27 22:16:06 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 28 Feb 2012 02:16:06 +0400 Subject: [BUG] memory leak risk in rbtree operation with hash collision In-Reply-To: References: Message-ID: <20120227221606.GR67687@mdounin.ru> Hello! On Mon, Feb 27, 2012 at 05:52:45PM +0800, lanshun zhou wrote: > The algorithm of many rbtree lookup functions in nginx requires > that nodes with the same hash value are linked together, but > sometimes this may be broken with the rebalance of the tree > after new nodes inserted. See the following example, the number > contains hash value and node key, 51 shares the same hash value > with 52. After the inserting of 63 and the rebalancing of the > tree, they are separated. Then 51 is "lost" from the tree. every > lookup for 51 returns null and new nodes are always alloced > until one of them is linked with 52 again. Good catch, thanx. Patch committed with minor style fixes. Maxim Dounin From mdounin at mdounin.ru Tue Feb 28 11:09:03 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Tue, 28 Feb 2012 11:09:03 +0000 Subject: [nginx] svn commit: r4499 - trunk/src/os/unix Message-ID: <20120228110903.774283F9C96@mail.nginx.com> Author: mdounin Date: 2012-02-28 11:09:02 +0000 (Tue, 28 Feb 2012) New Revision: 4499 Log: Workaround for fs_size on ZFS (ticket #46). ZFS reports incorrect st_blocks until file settles on disk, and this may take a while (i.e. just after creation of a file the st_blocks value is incorrect). As a workaround we now use st_blocks only if st_blocks * 512 > st_size, this should fix ZFS problems while still preserving accuracy for other filesystems. The problem had appeared in r3900 (1.0.1). Modified: trunk/src/os/unix/ngx_files.h Modified: trunk/src/os/unix/ngx_files.h =================================================================== --- trunk/src/os/unix/ngx_files.h 2012-02-27 22:15:39 UTC (rev 4498) +++ trunk/src/os/unix/ngx_files.h 2012-02-28 11:09:02 UTC (rev 4499) @@ -180,7 +180,7 @@ #define ngx_is_exec(sb) (((sb)->st_mode & S_IXUSR) == S_IXUSR) #define ngx_file_access(sb) ((sb)->st_mode & 0777) #define ngx_file_size(sb) (sb)->st_size -#define ngx_file_fs_size(sb) ((sb)->st_blocks * 512) +#define ngx_file_fs_size(sb) ngx_max((sb)->st_size, (sb)->st_blocks * 512) #define ngx_file_mtime(sb) (sb)->st_mtime #define ngx_file_uniq(sb) (sb)->st_ino @@ -276,7 +276,8 @@ #define ngx_de_access(dir) (((dir)->info.st_mode) & 0777) #define ngx_de_size(dir) (dir)->info.st_size -#define ngx_de_fs_size(dir) ((dir)->info.st_blocks * 512) +#define ngx_de_fs_size(dir) \ + ngx_max((dir)->info.st_size, (dir)->info.st_blocks * 512) #define ngx_de_mtime(dir) (dir)->info.st_mtime From ru at nginx.com Tue Feb 28 11:31:06 2012 From: ru at nginx.com (ru at nginx.com) Date: Tue, 28 Feb 2012 11:31:06 +0000 Subject: [nginx] svn commit: r4500 - in trunk/src: core event http http/modules mail os/unix os/win32 Message-ID: <20120228113106.62E8E3F9C96@mail.nginx.com> Author: ru Date: 2012-02-28 11:31:05 +0000 (Tue, 28 Feb 2012) New Revision: 4500 Log: Fixed spelling in single-line comments. Modified: trunk/src/core/ngx_times.c trunk/src/event/ngx_event.h trunk/src/event/ngx_event_openssl.c trunk/src/event/ngx_event_pipe.c trunk/src/http/modules/ngx_http_autoindex_module.c trunk/src/http/modules/ngx_http_index_module.c trunk/src/http/modules/ngx_http_limit_conn_module.c trunk/src/http/modules/ngx_http_limit_req_module.c trunk/src/http/modules/ngx_http_log_module.c trunk/src/http/modules/ngx_http_memcached_module.c trunk/src/http/modules/ngx_http_proxy_module.c trunk/src/http/modules/ngx_http_random_index_module.c trunk/src/http/modules/ngx_http_rewrite_module.c trunk/src/http/modules/ngx_http_userid_filter_module.c trunk/src/http/ngx_http_parse_time.c trunk/src/http/ngx_http_upstream.c trunk/src/mail/ngx_mail_pop3_handler.c trunk/src/os/unix/ngx_darwin_sendfile_chain.c trunk/src/os/unix/ngx_freebsd_sendfile_chain.c trunk/src/os/unix/ngx_user.c trunk/src/os/win32/ngx_service.c Modified: trunk/src/core/ngx_times.c =================================================================== --- trunk/src/core/ngx_times.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/core/ngx_times.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -287,7 +287,7 @@ days = n / 86400; - /* Jaunary 1, 1970 was Thursday */ + /* January 1, 1970 was Thursday */ wday = (4 + days) % 7; Modified: trunk/src/event/ngx_event.h =================================================================== --- trunk/src/event/ngx_event.h 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/event/ngx_event.h 2012-02-28 11:31:05 UTC (rev 4500) @@ -83,7 +83,7 @@ #endif #if (NGX_WIN32) - /* setsockopt(SO_UPDATE_ACCEPT_CONTEXT) was succesfull */ + /* setsockopt(SO_UPDATE_ACCEPT_CONTEXT) was successful */ unsigned accept_context_updated:1; #endif Modified: trunk/src/event/ngx_event_openssl.c =================================================================== --- trunk/src/event/ngx_event_openssl.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/event/ngx_event_openssl.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -842,7 +842,7 @@ case NGX_ERROR: c->read->error = 1; - /* fall thruogh */ + /* fall through */ case NGX_AGAIN: return c->ssl->last; Modified: trunk/src/event/ngx_event_pipe.c =================================================================== --- trunk/src/event/ngx_event_pipe.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/event/ngx_event_pipe.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -969,7 +969,7 @@ return NGX_OK; } - /* the first free buf is partialy filled, thus add the free buf after it */ + /* the first free buf is partially filled, thus add the free buf after it */ cl->next = p->free_raw_bufs->next; p->free_raw_bufs->next = cl; Modified: trunk/src/http/modules/ngx_http_autoindex_module.c =================================================================== --- trunk/src/http/modules/ngx_http_autoindex_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_autoindex_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -95,8 +95,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_autoindex_create_loc_conf, /* create location configration */ - ngx_http_autoindex_merge_loc_conf /* merge location configration */ + ngx_http_autoindex_create_loc_conf, /* create location configuration */ + ngx_http_autoindex_merge_loc_conf /* merge location configuration */ }; Modified: trunk/src/http/modules/ngx_http_index_module.c =================================================================== --- trunk/src/http/modules/ngx_http_index_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_index_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -62,8 +62,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_index_create_loc_conf, /* create location configration */ - ngx_http_index_merge_loc_conf /* merge location configration */ + ngx_http_index_create_loc_conf, /* create location configuration */ + ngx_http_index_merge_loc_conf /* merge location configuration */ }; Modified: trunk/src/http/modules/ngx_http_limit_conn_module.c =================================================================== --- trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -118,8 +118,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_limit_conn_create_conf, /* create location configration */ - ngx_http_limit_conn_merge_conf /* merge location configration */ + ngx_http_limit_conn_create_conf, /* create location configuration */ + ngx_http_limit_conn_merge_conf /* merge location configuration */ }; Modified: trunk/src/http/modules/ngx_http_limit_req_module.c =================================================================== --- trunk/src/http/modules/ngx_http_limit_req_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_limit_req_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -121,8 +121,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_limit_req_create_conf, /* create location configration */ - ngx_http_limit_req_merge_conf /* merge location configration */ + ngx_http_limit_req_create_conf, /* create location configuration */ + ngx_http_limit_req_merge_conf /* merge location configuration */ }; Modified: trunk/src/http/modules/ngx_http_log_module.c =================================================================== --- trunk/src/http/modules/ngx_http_log_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_log_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -161,8 +161,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_log_create_loc_conf, /* create location configration */ - ngx_http_log_merge_loc_conf /* merge location configration */ + ngx_http_log_create_loc_conf, /* create location configuration */ + ngx_http_log_merge_loc_conf /* merge location configuration */ }; @@ -377,10 +377,10 @@ if (!r->root_tested) { - /* test root directory existance */ + /* test root directory existence */ if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) { - /* simulate successfull logging */ + /* simulate successful logging */ return len; } @@ -404,14 +404,14 @@ != NGX_OK) { if (of.err == 0) { - /* simulate successfull logging */ + /* simulate successful logging */ return len; } ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, "testing \"%s\" existence failed", path.data); - /* simulate successfull logging */ + /* simulate successful logging */ return len; } @@ -419,7 +419,7 @@ ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR, "testing \"%s\" existence failed", path.data); - /* simulate successfull logging */ + /* simulate successful logging */ return len; } } @@ -428,7 +428,7 @@ script->values->elts) == NULL) { - /* simulate successfull logging */ + /* simulate successful logging */ return len; } @@ -457,7 +457,7 @@ { ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, "%s \"%s\" failed", of.failed, log.data); - /* simulate successfull logging */ + /* simulate successful logging */ return len; } Modified: trunk/src/http/modules/ngx_http_memcached_module.c =================================================================== --- trunk/src/http/modules/ngx_http_memcached_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_memcached_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -115,8 +115,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_memcached_create_loc_conf, /* create location configration */ - ngx_http_memcached_merge_loc_conf /* merge location configration */ + ngx_http_memcached_create_loc_conf, /* create location configuration */ + ngx_http_memcached_merge_loc_conf /* merge location configuration */ }; Modified: trunk/src/http/modules/ngx_http_proxy_module.c =================================================================== --- trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_proxy_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -530,8 +530,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_proxy_create_loc_conf, /* create location configration */ - ngx_http_proxy_merge_loc_conf /* merge location configration */ + ngx_http_proxy_create_loc_conf, /* create location configuration */ + ngx_http_proxy_merge_loc_conf /* merge location configuration */ }; Modified: trunk/src/http/modules/ngx_http_random_index_module.c =================================================================== --- trunk/src/http/modules/ngx_http_random_index_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_random_index_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -49,8 +49,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_random_index_create_loc_conf, /* create location configration */ - ngx_http_random_index_merge_loc_conf /* merge location configration */ + ngx_http_random_index_create_loc_conf, /* create location configuration */ + ngx_http_random_index_merge_loc_conf /* merge location configuration */ }; Modified: trunk/src/http/modules/ngx_http_rewrite_module.c =================================================================== --- trunk/src/http/modules/ngx_http_rewrite_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_rewrite_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -112,8 +112,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_rewrite_create_loc_conf, /* create location configration */ - ngx_http_rewrite_merge_loc_conf /* merge location configration */ + ngx_http_rewrite_create_loc_conf, /* create location configuration */ + ngx_http_rewrite_merge_loc_conf /* merge location configuration */ }; Modified: trunk/src/http/modules/ngx_http_userid_filter_module.c =================================================================== --- trunk/src/http/modules/ngx_http_userid_filter_module.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/modules/ngx_http_userid_filter_module.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -166,8 +166,8 @@ NULL, /* create server configuration */ NULL, /* merge server configuration */ - ngx_http_userid_create_conf, /* create location configration */ - ngx_http_userid_merge_conf /* merge location configration */ + ngx_http_userid_create_conf, /* create location configuration */ + ngx_http_userid_merge_conf /* merge location configuration */ }; Modified: trunk/src/http/ngx_http_parse_time.c =================================================================== --- trunk/src/http/ngx_http_parse_time.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/ngx_http_parse_time.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -242,7 +242,7 @@ year -= 1; } - /* Gauss' formula for Grigorian days since March 1, 1 BC */ + /* Gauss' formula for Gregorian days since March 1, 1 BC */ time = (uint64_t) ( /* days in years including leap years since March 1, 1 BC */ Modified: trunk/src/http/ngx_http_upstream.c =================================================================== --- trunk/src/http/ngx_http_upstream.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/http/ngx_http_upstream.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -2293,7 +2293,7 @@ } if (ngx_event_flags & NGX_USE_AIO_EVENT) { - /* the posted aio operation may currupt a shadow buffer */ + /* the posted aio operation may corrupt a shadow buffer */ p->single_buf = 1; } Modified: trunk/src/mail/ngx_mail_pop3_handler.c =================================================================== --- trunk/src/mail/ngx_mail_pop3_handler.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/mail/ngx_mail_pop3_handler.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -218,7 +218,7 @@ break; - /* suppress warinings */ + /* suppress warnings */ case ngx_pop3_passwd: break; Modified: trunk/src/os/unix/ngx_darwin_sendfile_chain.c =================================================================== --- trunk/src/os/unix/ngx_darwin_sendfile_chain.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/os/unix/ngx_darwin_sendfile_chain.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -173,7 +173,7 @@ if (file && header.nelts == 0) { - /* create the tailer iovec and coalesce the neighbouring bufs */ + /* create the trailer iovec and coalesce the neighbouring bufs */ prev = NULL; iov = NULL; Modified: trunk/src/os/unix/ngx_freebsd_sendfile_chain.c =================================================================== --- trunk/src/os/unix/ngx_freebsd_sendfile_chain.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/os/unix/ngx_freebsd_sendfile_chain.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -178,7 +178,7 @@ if (file) { - /* create the tailer iovec and coalesce the neighbouring bufs */ + /* create the trailer iovec and coalesce the neighbouring bufs */ prev = NULL; iov = NULL; Modified: trunk/src/os/unix/ngx_user.c =================================================================== --- trunk/src/os/unix/ngx_user.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/os/unix/ngx_user.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -67,7 +67,7 @@ #if (NGX_THREADS && NGX_NONREENTRANT_CRYPT) - /* crypt() is a time consuming funtion, so we only try to lock */ + /* crypt() is a time consuming function, so we only try to lock */ if (ngx_mutex_trylock(ngx_crypt_mutex) != NGX_OK) { return NGX_AGAIN; Modified: trunk/src/os/win32/ngx_service.c =================================================================== --- trunk/src/os/win32/ngx_service.c 2012-02-28 11:09:02 UTC (rev 4499) +++ trunk/src/os/win32/ngx_service.c 2012-02-28 11:31:05 UTC (rev 4500) @@ -20,7 +20,7 @@ { /* primary thread */ - /* StartServiceCtrlDispatcher() shouxpdl be called within 30 seconds */ + /* StartServiceCtrlDispatcher() should be called within 30 seconds */ if (StartServiceCtrlDispatcher(st) == 0) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, From mdounin at mdounin.ru Tue Feb 28 11:40:18 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Tue, 28 Feb 2012 11:40:18 +0000 Subject: [nginx] svn commit: r4501 - trunk/src/os/unix Message-ID: <20120228114018.88A8A3FA9C1@mail.nginx.com> Author: mdounin Date: 2012-02-28 11:40:18 +0000 (Tue, 28 Feb 2012) New Revision: 4501 Log: Added msleep() on reload to allow new processes to start. This is expected to ensure smoother operation on reload (and with less chance of listen queue overflows). Prodded by Igor Sysoev. Modified: trunk/src/os/unix/ngx_process_cycle.c Modified: trunk/src/os/unix/ngx_process_cycle.c =================================================================== --- trunk/src/os/unix/ngx_process_cycle.c 2012-02-28 11:31:05 UTC (rev 4500) +++ trunk/src/os/unix/ngx_process_cycle.c 2012-02-28 11:40:18 UTC (rev 4501) @@ -250,6 +250,10 @@ ngx_start_worker_processes(cycle, ccf->worker_processes, NGX_PROCESS_JUST_RESPAWN); ngx_start_cache_manager_processes(cycle, 1); + + /* allow new processes to start */ + ngx_msleep(100); + live = 1; ngx_signal_worker_processes(cycle, ngx_signal_value(NGX_SHUTDOWN_SIGNAL)); From mdounin at mdounin.ru Tue Feb 28 14:54:23 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Tue, 28 Feb 2012 14:54:23 +0000 Subject: [nginx] svn commit: r4502 - trunk/src/http Message-ID: <20120228145424.398F73F9CB5@mail.nginx.com> Author: mdounin Date: 2012-02-28 14:54:23 +0000 (Tue, 28 Feb 2012) New Revision: 4502 Log: Raised simultaneous subrequest limit from 50 to 200. It wasn't enforced for a long time, and there are reports that people use up to 100 simultaneous subrequests now. As this is a safety limit to prevent loops, it's raised accordingly. Modified: trunk/src/http/ngx_http_request.h Modified: trunk/src/http/ngx_http_request.h =================================================================== --- trunk/src/http/ngx_http_request.h 2012-02-28 11:40:18 UTC (rev 4501) +++ trunk/src/http/ngx_http_request.h 2012-02-28 14:54:23 UTC (rev 4502) @@ -10,7 +10,7 @@ #define NGX_HTTP_MAX_URI_CHANGES 10 -#define NGX_HTTP_MAX_SUBREQUESTS 50 +#define NGX_HTTP_MAX_SUBREQUESTS 200 /* must be 2^n */ #define NGX_HTTP_LC_HEADER_LEN 32 From mdounin at mdounin.ru Wed Feb 29 13:45:18 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Wed, 29 Feb 2012 13:45:18 +0000 Subject: [nginx] svn commit: r4503 - trunk/docs/xml/nginx Message-ID: <20120229134518.E0ABA3F9D3C@mail.nginx.com> Author: mdounin Date: 2012-02-29 13:45:18 +0000 (Wed, 29 Feb 2012) New Revision: 4503 Log: nginx-1.1.16-RELEASE Modified: trunk/docs/xml/nginx/changes.xml Modified: trunk/docs/xml/nginx/changes.xml =================================================================== --- trunk/docs/xml/nginx/changes.xml 2012-02-28 14:54:23 UTC (rev 4502) +++ trunk/docs/xml/nginx/changes.xml 2012-02-29 13:45:18 UTC (rev 4503) @@ -9,6 +9,119 @@ nginx changelog + + + + +??????????? ?? ?????????? ????????????? ??????????? ??????? ?? 200. + + +the simultaneous subrequest limit has been raised to 200. + + + + + +???????? from ? ????????? disable_symlinks. + + +the "from" parameter of the "disable_symlinks" directive. + + + + + +????????? return ? error_page ?????? ????? ?????????????? ??? ???????? +??????????????? ? ????? 307. + + +the "return" and "error_page" directives can be used to return 307 +redirections. + + + + + +? ??????? ???????? ??? ????????? segmentation fault, +???? ?????????????? ????????? resolver +? ?? ?????????? ?????? ?? ???? ?????? ????????? error_log.
+??????? ?????? ?????????. +
+ +a segmentation fault might occur in a worker process +if the "resolver" directive was used +and there was no "error_log" directive specified at global level.
+Thanks to Roman Arutyunyan. +
+
+ + + +? ??????? ???????? ??? ????????? segmentation fault, +???? ?????????????? ????????? "proxy_http_version 1.1" ??? +"fastcgi_keep_conn on". + + +a segmentation fault might occur in a worker process +if the "proxy_http_version 1.1" or "fastcgi_keep_conn on" directives +were used. + + + + + +?????? ??????.
+??????? Lanshun Zhou. +
+ +memory leaks.
+Thanks to Lanshun Zhou. +
+
+ + + +? ????????? disable_symlinks. + + +in the "disable_symlinks" directive. + + + + + +??? ????????????? ZFS ?????? ???? ?? ????? ??? ????????? ???????????; +?????? ????????? ? 1.0.1. + + +on ZFS filesystem disk cache size might be calculated incorrectly; +the bug had appeared in 1.0.1. + + + + + +nginx ?? ????????? ???????????? icc 12.1. + + +nginx could not be built by the icc 12.1 compiler. + + + + + +nginx ?? ????????? gcc ?? Solaris; +?????? ????????? ? 1.1.15. + + +nginx could not be built by gcc on Solaris; +the bug had appeared in 1.1.15. + + + +
+ + From mdounin at mdounin.ru Wed Feb 29 13:45:40 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Wed, 29 Feb 2012 13:45:40 +0000 Subject: [nginx] svn commit: r4504 - tags Message-ID: <20120229134540.3F6983F9D6A@mail.nginx.com> Author: mdounin Date: 2012-02-29 13:45:39 +0000 (Wed, 29 Feb 2012) New Revision: 4504 Log: release-1.1.16 tag Added: tags/release-1.1.16/