Mercurial > hg > nginx-mail
comparison src/http/modules/perl/ngx_http_perl_module.c @ 593:697030d79811 NGINX_0_8_27
nginx 0.8.27
*) Bugfix: regular expressions did work in nginx/Windows; the bug had
appeared in 0.8.25.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 17 Nov 2009 00:00:00 +0300 |
parents | f7ec98e3caeb |
children | da3c99095432 |
comparison
equal
deleted
inserted
replaced
592:04cfef16b736 | 593:697030d79811 |
---|---|
150 }; | 150 }; |
151 | 151 |
152 #endif | 152 #endif |
153 | 153 |
154 | 154 |
155 static ngx_str_t ngx_null_name = ngx_null_string; | 155 static ngx_str_t ngx_null_name = ngx_null_string; |
156 | 156 static HV *nginx_stash; |
157 static HV *nginx_stash; | |
158 | 157 |
159 #if (NGX_HAVE_PERL_MULTIPLICITY) | 158 #if (NGX_HAVE_PERL_MULTIPLICITY) |
160 static ngx_uint_t ngx_perl_term; | 159 static ngx_uint_t ngx_perl_term; |
160 #else | |
161 static PerlInterpreter *perl; | |
161 #endif | 162 #endif |
162 | 163 |
163 | 164 |
164 static void | 165 static void |
165 ngx_http_perl_xs_init(pTHX) | 166 ngx_http_perl_xs_init(pTHX) |
459 | 460 |
460 | 461 |
461 static char * | 462 static char * |
462 ngx_http_perl_init_interpreter(ngx_conf_t *cf, ngx_http_perl_main_conf_t *pmcf) | 463 ngx_http_perl_init_interpreter(ngx_conf_t *cf, ngx_http_perl_main_conf_t *pmcf) |
463 { | 464 { |
464 ngx_str_t *m; | 465 ngx_str_t *m; |
465 ngx_uint_t i; | 466 ngx_uint_t i; |
466 #if (NGX_HAVE_PERL_MULTIPLICITY) | 467 #if (NGX_HAVE_PERL_MULTIPLICITY) |
467 ngx_pool_cleanup_t *cln; | 468 ngx_pool_cleanup_t *cln; |
468 | 469 |
469 cln = ngx_pool_cleanup_add(cf->pool, 0); | 470 cln = ngx_pool_cleanup_add(cf->pool, 0); |
470 if (cln == NULL) { | 471 if (cln == NULL) { |
471 return NGX_CONF_ERROR; | 472 return NGX_CONF_ERROR; |
472 } | 473 } |
473 | 474 |
474 #else | |
475 static PerlInterpreter *perl; | |
476 #endif | 475 #endif |
477 | 476 |
478 #ifdef NGX_PERL_MODULES | 477 #ifdef NGX_PERL_MODULES |
479 if (pmcf->modules == NGX_CONF_UNSET_PTR) { | 478 if (pmcf->modules == NGX_CONF_UNSET_PTR) { |
480 | 479 |
1062 static void | 1061 static void |
1063 ngx_http_perl_exit(ngx_cycle_t *cycle) | 1062 ngx_http_perl_exit(ngx_cycle_t *cycle) |
1064 { | 1063 { |
1065 #if (NGX_HAVE_PERL_MULTIPLICITY) | 1064 #if (NGX_HAVE_PERL_MULTIPLICITY) |
1066 | 1065 |
1066 /* | |
1067 * the master exit hook is run before global pool cleanup, | |
1068 * therefore just set flag here | |
1069 */ | |
1070 | |
1067 ngx_perl_term = 1; | 1071 ngx_perl_term = 1; |
1068 | 1072 |
1069 #else | 1073 #else |
1070 ngx_http_perl_main_conf_t *pmcf; | 1074 |
1071 | 1075 if (nginx_stash) { |
1072 pmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_perl_module); | |
1073 | |
1074 if (pmcf && nginx_stash) { | |
1075 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cycle->log, 0, "perl term"); | 1076 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cycle->log, 0, "perl term"); |
1076 | 1077 |
1077 (void) perl_destruct(pmcf->perl); | 1078 (void) perl_destruct(perl); |
1078 | 1079 |
1079 perl_free(pmcf->perl); | 1080 perl_free(perl); |
1080 | 1081 |
1081 PERL_SYS_TERM(); | 1082 PERL_SYS_TERM(); |
1082 } | 1083 } |
1083 | 1084 |
1084 #endif | 1085 #endif |