aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_script.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-04-26 09:52:47 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-04-26 09:52:47 +0000
commit7f7846d8208c9179b7632eddc4a3165b3b10afbb (patch)
treed3255703d466de2d0e9199cad9186b227798d7cc /src/http/ngx_http_script.c
parent5026d3799b88b715bfe12c836d4263e861822cad (diff)
downloadnginx-7f7846d8208c9179b7632eddc4a3165b3b10afbb.tar.gz
nginx-7f7846d8208c9179b7632eddc4a3165b3b10afbb.zip
nginx-0.3.42-RELEASE importrelease-0.3.42
*) Feature: the "bind" option of the "listen" directive in IMAP/POP3 proxy. *) Bugfix: if the same capture in the "rewrite" directive was used more then once. *) Bugfix: the $sent_http_content_type, $sent_http_content_length, $sent_http_last_modified, $sent_http_connection, $sent_http_keep_alive, and $sent_http_transfer_encoding variables were not written to access log. *) Bugfix: the $sent_http_cache_control returned value of the single "Cache-Control" response header line.
Diffstat (limited to 'src/http/ngx_http_script.c')
-rw-r--r--src/http/ngx_http_script.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index 5a5245667..9826ecea5 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -91,6 +91,14 @@ ngx_http_script_compile(ngx_http_script_compile_t *sc)
if (sc->source->data[i] >= '1' && sc->source->data[i] <= '9') {
+ n = sc->source->data[i] - '0';
+
+ if (sc->captures_mask & (1 << n)) {
+ sc->dup_capture = 1;
+ }
+
+ sc->captures_mask |= 1 << n;
+
copy_capture = ngx_http_script_add_code(*sc->lengths,
sizeof(ngx_http_script_copy_capture_code_t),
NULL);
@@ -100,7 +108,8 @@ ngx_http_script_compile(ngx_http_script_compile_t *sc)
copy_capture->code = (ngx_http_script_code_pt)
ngx_http_script_copy_capture_len_code;
- copy_capture->n = 2 * (sc->source->data[i] - '0');
+ copy_capture->n = 2 * n;
+
copy_capture = ngx_http_script_add_code(*sc->values,
sizeof(ngx_http_script_copy_capture_code_t),
@@ -110,14 +119,12 @@ ngx_http_script_compile(ngx_http_script_compile_t *sc)
}
copy_capture->code = ngx_http_script_copy_capture_code;
- copy_capture->n = sc->source->data[i] - '0';
+ copy_capture->n = 2 * n;
- if (sc->ncaptures < copy_capture->n) {
- sc->ncaptures = copy_capture->n;
+ if (sc->ncaptures < n) {
+ sc->ncaptures = n;
}
- copy_capture->n *= 2;
-
i++;
continue;