summaryrefslogtreecommitdiff
path: root/src/http/ngx_http_script.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-10-04 10:35:33 +0000
committerJonathan Kolb <jon@b0g.us>2005-10-04 10:35:33 +0000
commit3d5736770305c42dd10030969b18107abd2ae36a (patch)
treed4de10e58322f224bd3d2310d875b568b88fcfcb /src/http/ngx_http_script.c
parentfeec6759eab3fa301e1695038c95c608e4b16c1c (diff)
downloadnginx-0.2.5.tar.gz
Changes with nginx 0.2.5 04 Oct 2005v0.2.5
*) Change: the duplicate value of the ngx_http_geo_module variable now causes the warning and changes old value. *) Feature: the ngx_http_ssi_module supports the "set" command. *) Feature: the ngx_http_ssi_module supports the "file" parameter in the "include" command. *) Feature: the ngx_http_ssi_module supports the variable value substitutions in epxiressions of the "if" command.
Diffstat (limited to 'src/http/ngx_http_script.c')
-rw-r--r--src/http/ngx_http_script.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index 27c9ce045..a8272ec67 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -361,11 +361,11 @@ ngx_http_script_copy_var_len_code(ngx_http_script_engine_t *e)
value = ngx_http_get_indexed_variable(e->request, code->index);
- if (value == NULL || value == NGX_HTTP_VAR_NOT_FOUND) {
- return 0;
+ if (value && value != NGX_HTTP_VAR_NOT_FOUND) {
+ return value->text.len;
}
- return value->text.len;
+ return 0;
}
@@ -382,15 +382,14 @@ ngx_http_script_copy_var_code(ngx_http_script_engine_t *e)
if (!e->skip) {
value = ngx_http_get_indexed_variable(e->request, code->index);
- if (value == NULL || value == NGX_HTTP_VAR_NOT_FOUND) {
- return;
- }
+ if (value && value != NGX_HTTP_VAR_NOT_FOUND) {
+ e->pos = ngx_cpymem(e->pos, value->text.data, value->text.len);
- e->pos = ngx_cpymem(e->pos, value->text.data, value->text.len);
-
- if (e->log) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script var: \"%V\"", &e->buf);
+ if (e->log) {
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP,
+ e->request->connection->log, 0,
+ "http script var: \"%V\"", &e->buf);
+ }
}
}
}
@@ -879,19 +878,18 @@ ngx_http_script_var_code(ngx_http_script_engine_t *e)
value = ngx_http_get_indexed_variable(e->request, code->index);
- if (value == NULL || value == NGX_HTTP_VAR_NOT_FOUND) {
- e->sp->value = 0;
- e->sp->text.len = 0;
- e->sp->text.data = (u_char *) "";
+ if (value && value != NGX_HTTP_VAR_NOT_FOUND) {
+ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
+ "http script var: %ui, \"%V\"", value->value, &value->text);
+ *e->sp = *value;
e->sp++;
return;
}
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script var: %ui, \"%V\"", value->value, &value->text);
-
- *e->sp = *value;
+ e->sp->value = 0;
+ e->sp->text.len = 0;
+ e->sp->text.data = (u_char *) "";
e->sp++;
}