Mercurial > hg > nginx
comparison src/http/ngx_http_variables.c @ 4470:d9bf6caf0371
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).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 13 Feb 2012 15:31:07 +0000 |
parents | d620f497c50f |
children | cab9aa79256c |
comparison
equal
deleted
inserted
replaced
4469:24c0dca04eb9 | 4470:d9bf6caf0371 |
---|---|
430 { | 430 { |
431 ngx_http_variable_value_t *v; | 431 ngx_http_variable_value_t *v; |
432 | 432 |
433 v = &r->variables[index]; | 433 v = &r->variables[index]; |
434 | 434 |
435 if (v->valid) { | 435 if (v->valid || v->not_found) { |
436 if (!v->no_cacheable) { | 436 if (!v->no_cacheable) { |
437 return v; | 437 return v; |
438 } | 438 } |
439 | 439 |
440 v->valid = 0; | 440 v->valid = 0; |