Mercurial > hg > nginx
diff src/http/modules/ngx_http_ssi_filter_module.c @ 635:18268abd340c release-0.3.39
nginx-0.3.39-RELEASE import
*) Feature: the "uninitialized_variable_warn" directive; the logging
level of the "uninitialized variable" message was lowered from
"alert" to "warn".
*) Feature: the "override_charset" directive.
*) Change: now if the unknown variable is used in the "echo" and "if
expr='$name'" SSI-commands, then the "unknown variable" message is
not logged.
*) Bugfix: the active connection counter increased on the exceeding of
the connection limit specified by the "worker_connections"
directive; the bug had appeared in 0.2.0.
*) Bugfix: the limit rate might not work on some condition; the bug had
appeared in 0.3.38.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 17 Apr 2006 19:55:41 +0000 |
parents | 65bf042c0b4f |
children | e60fe4cf1d4e |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -14,6 +14,7 @@ #define NGX_HTTP_SSI_ADD_PREFIX 1 #define NGX_HTTP_SSI_ADD_ZERO 2 +#define NGX_HTTP_SSI_EXPR_TEST 4 typedef struct { @@ -1502,8 +1503,8 @@ ngx_http_ssi_evaluate_string(ngx_http_re val = ngx_http_ssi_get_variable(r, &var, key); if (val == NULL) { - vv = ngx_http_get_variable(r, &var, key); - + vv = ngx_http_get_variable(r, &var, key, + flags & NGX_HTTP_SSI_EXPR_TEST); if (vv == NULL) { return NGX_ERROR; } @@ -1681,7 +1682,7 @@ ngx_http_ssi_echo(ngx_http_request_t *r, value = ngx_http_ssi_get_variable(r, var, key); if (value == NULL) { - vv = ngx_http_get_variable(r, var, key); + vv = ngx_http_get_variable(r, var, key, 1); if (vv == NULL) { return NGX_HTTP_SSI_ERROR; @@ -1873,10 +1874,12 @@ ngx_http_ssi_if(ngx_http_request_t *r, n p++; } + flags = (p == last) ? NGX_HTTP_SSI_EXPR_TEST : 0; + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "left: \"%V\"", &left); - if (ngx_http_ssi_evaluate_string(r, ctx, &left, 0) != NGX_OK) { + if (ngx_http_ssi_evaluate_string(r, ctx, &left, flags) != NGX_OK) { return NGX_HTTP_SSI_ERROR; }