mirror of
https://github.com/nginx/nginx.git
synced 2025-06-09 02:42:48 +08:00
use global perl variable in perl_destruct()/perl_free()
for non-mulitiplicity perl
This commit is contained in:
parent
69061b73ef
commit
889fa8debb
@ -152,12 +152,13 @@ static ngx_http_ssi_command_t ngx_http_perl_ssi_command = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static ngx_str_t ngx_null_name = ngx_null_string;
|
static ngx_str_t ngx_null_name = ngx_null_string;
|
||||||
|
static HV *nginx_stash;
|
||||||
static HV *nginx_stash;
|
|
||||||
|
|
||||||
#if (NGX_HAVE_PERL_MULTIPLICITY)
|
#if (NGX_HAVE_PERL_MULTIPLICITY)
|
||||||
static ngx_uint_t ngx_perl_term;
|
static ngx_uint_t ngx_perl_term;
|
||||||
|
#else
|
||||||
|
static PerlInterpreter *perl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -461,18 +462,16 @@ ngx_http_perl_ssi(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ssi_ctx,
|
|||||||
static char *
|
static char *
|
||||||
ngx_http_perl_init_interpreter(ngx_conf_t *cf, ngx_http_perl_main_conf_t *pmcf)
|
ngx_http_perl_init_interpreter(ngx_conf_t *cf, ngx_http_perl_main_conf_t *pmcf)
|
||||||
{
|
{
|
||||||
ngx_str_t *m;
|
ngx_str_t *m;
|
||||||
ngx_uint_t i;
|
ngx_uint_t i;
|
||||||
#if (NGX_HAVE_PERL_MULTIPLICITY)
|
#if (NGX_HAVE_PERL_MULTIPLICITY)
|
||||||
ngx_pool_cleanup_t *cln;
|
ngx_pool_cleanup_t *cln;
|
||||||
|
|
||||||
cln = ngx_pool_cleanup_add(cf->pool, 0);
|
cln = ngx_pool_cleanup_add(cf->pool, 0);
|
||||||
if (cln == NULL) {
|
if (cln == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
static PerlInterpreter *perl;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NGX_PERL_MODULES
|
#ifdef NGX_PERL_MODULES
|
||||||
@ -1067,16 +1066,12 @@ ngx_http_perl_exit(ngx_cycle_t *cycle)
|
|||||||
ngx_perl_term = 1;
|
ngx_perl_term = 1;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
ngx_http_perl_main_conf_t *pmcf;
|
if (nginx_stash) {
|
||||||
|
|
||||||
pmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_perl_module);
|
|
||||||
|
|
||||||
if (pmcf && nginx_stash) {
|
|
||||||
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cycle->log, 0, "perl term");
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cycle->log, 0, "perl term");
|
||||||
|
|
||||||
(void) perl_destruct(pmcf->perl);
|
(void) perl_destruct(perl);
|
||||||
|
|
||||||
perl_free(pmcf->perl);
|
perl_free(perl);
|
||||||
|
|
||||||
PERL_SYS_TERM();
|
PERL_SYS_TERM();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user