fix recursive perl_set variable call
Igor Sysoev
15 years ago
299 | 299 | ngx_http_perl_variable_t *pv = (ngx_http_perl_variable_t *) data; |
300 | 300 | |
301 | 301 | ngx_int_t rc; |
302 | ngx_uint_t recursive; | |
302 | 303 | ngx_str_t value; |
303 | 304 | ngx_http_perl_ctx_t *ctx; |
304 | 305 | ngx_http_perl_main_conf_t *pmcf; |
315 | 316 | } |
316 | 317 | |
317 | 318 | ngx_http_set_ctx(r, ctx, ngx_http_perl_module); |
318 | } | |
319 | ||
320 | pmcf = ngx_http_get_module_main_conf(r, ngx_http_perl_module); | |
321 | ||
322 | rc = ngx_http_perl_get_interpreter(pmcf, &ctx->perl, r->connection->log); | |
323 | ||
324 | if (rc != NGX_OK) { | |
325 | return rc; | |
319 | ||
320 | pmcf = ngx_http_get_module_main_conf(r, ngx_http_perl_module); | |
321 | ||
322 | rc = ngx_http_perl_get_interpreter(pmcf, &ctx->perl, | |
323 | r->connection->log); | |
324 | ||
325 | if (rc != NGX_OK) { | |
326 | return rc; | |
327 | } | |
328 | ||
329 | recursive = 0; | |
330 | ||
331 | } else { | |
332 | pmcf = NULL; | |
333 | recursive = 1; | |
326 | 334 | } |
327 | 335 | |
328 | 336 | value.data = NULL; |
336 | 344 | |
337 | 345 | } |
338 | 346 | |
339 | ngx_http_perl_free_interpreter(pmcf, ctx->perl); | |
347 | if (recursive == 0) { | |
348 | ngx_http_perl_free_interpreter(pmcf, ctx->perl); | |
349 | } | |
340 | 350 | |
341 | 351 | if (value.data) { |
342 | 352 | v->len = value.len; |