aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_script.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-03-15 09:53:04 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-03-15 09:53:04 +0000
commit8fea885cbf8d63d67ee6b7ea82e3e0438182ac36 (patch)
tree232fb0db90b71aeb124c970bf619f3dd1de19aac /src/http/ngx_http_script.c
parent5e40d785cbb896a9ed218c6a599863f2a82aa721 (diff)
downloadnginx-release-0.3.33.tar.gz
nginx-release-0.3.33.zip
nginx-0.3.33-RELEASE importrelease-0.3.33
*) Feature: the "http_503" parameter of the "proxy_next_upstream" or "fastcgi_next_upstream" directives. *) Bugfix: ngx_http_perl_module did not work with inlined in the configuration code, if it was not started with the "sub" word. *) Bugfix: in the "post_action" directive.
Diffstat (limited to 'src/http/ngx_http_script.c')
-rw-r--r--src/http/ngx_http_script.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index b46c9bb35..dc7b89538 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -294,6 +294,44 @@ invalid_variable:
}
+u_char *
+ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
+ void *code_lengths, size_t len, void *code_values)
+{
+ ngx_http_script_code_pt code;
+ ngx_http_script_len_code_pt lcode;
+ ngx_http_script_engine_t e;
+
+ ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
+
+ e.ip = code_lengths;
+ e.request = r;
+ e.flushed = 1;
+
+ while (*(uintptr_t *) e.ip) {
+ lcode = *(ngx_http_script_len_code_pt *) e.ip;
+ len += lcode(&e);
+ }
+
+
+ value->len = len;
+ value->data = ngx_palloc(r->pool, len);
+ if (value->data == NULL) {
+ return NULL;
+ }
+
+ e.ip = code_values;
+ e.pos = value->data;
+
+ while (*(uintptr_t *) e.ip) {
+ code = *(ngx_http_script_code_pt *) e.ip;
+ code((ngx_http_script_engine_t *) &e);
+ }
+
+ return e.pos;
+}
+
+
void
ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r,
ngx_array_t *indices)