comparison src/http/ngx_http_script.c @ 172:1b490fc19afa NGINX_0_3_33

nginx 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.
author Igor Sysoev <http://sysoev.ru>
date Wed, 15 Mar 2006 00:00:00 +0300
parents 50bd986c5d63
children 4cd3e70c4d60
comparison
equal deleted inserted replaced
171:d4717557d48d 172:1b490fc19afa
289 invalid_variable: 289 invalid_variable:
290 290
291 ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0, "invalid variable name"); 291 ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0, "invalid variable name");
292 292
293 return NGX_ERROR; 293 return NGX_ERROR;
294 }
295
296
297 u_char *
298 ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
299 void *code_lengths, size_t len, void *code_values)
300 {
301 ngx_http_script_code_pt code;
302 ngx_http_script_len_code_pt lcode;
303 ngx_http_script_engine_t e;
304
305 ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
306
307 e.ip = code_lengths;
308 e.request = r;
309 e.flushed = 1;
310
311 while (*(uintptr_t *) e.ip) {
312 lcode = *(ngx_http_script_len_code_pt *) e.ip;
313 len += lcode(&e);
314 }
315
316
317 value->len = len;
318 value->data = ngx_palloc(r->pool, len);
319 if (value->data == NULL) {
320 return NULL;
321 }
322
323 e.ip = code_values;
324 e.pos = value->data;
325
326 while (*(uintptr_t *) e.ip) {
327 code = *(ngx_http_script_code_pt *) e.ip;
328 code((ngx_http_script_engine_t *) &e);
329 }
330
331 return e.pos;
294 } 332 }
295 333
296 334
297 void 335 void
298 ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r, 336 ngx_http_script_flush_no_cachable_variables(ngx_http_request_t *r,