diff src/http/modules/perl/ngx_http_perl_module.c @ 306:55328d69b335 NGINX_0_5_23

nginx 0.5.23 *) Feature: the ngx_http_ssl_module supports Server Name Indication TLS extension. *) Feature: the "fastcgi_catch_stderr" directive. Thanks to Nick S. Grechukh, OWOX project. *) Bugfix: a segmentation fault occurred in master process if two virtual servers should bind() to the overlapping ports. *) Bugfix: if nginx was built with ngx_http_perl_module and perl supported threads, then during second reconfiguration the error messages "panic: MUTEX_LOCK" and "perl_parse() failed" were issued. *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive.
author Igor Sysoev <http://sysoev.ru>
date Mon, 04 Jun 2007 00:00:00 +0400
parents 2ceaee987f37
children d5ec0be9c835
line wrap: on
line diff
--- a/src/http/modules/perl/ngx_http_perl_module.c
+++ b/src/http/modules/perl/ngx_http_perl_module.c
@@ -67,6 +67,8 @@ static char *ngx_http_perl_set(ngx_conf_
 static void ngx_http_perl_cleanup_perl(void *data);
 #endif
 
+static void ngx_http_perl_exit(ngx_cycle_t *cycle);
+
 
 static ngx_command_t  ngx_http_perl_commands[] = {
 
@@ -128,7 +130,7 @@ ngx_module_t  ngx_http_perl_module = {
     NULL,                                  /* init thread */
     NULL,                                  /* exit thread */
     NULL,                                  /* exit process */
-    NULL,                                  /* exit master */
+    ngx_http_perl_exit,                    /* exit master */
     NGX_MODULE_V1_PADDING
 };
 
@@ -478,12 +480,13 @@ ngx_http_perl_init_interpreter(ngx_conf_
 
 #endif
 
-    PERL_SYS_INIT(&ngx_argc, &ngx_argv);
+    if (nginx_stash == NULL) {
+        PERL_SYS_INIT(&ngx_argc, &ngx_argv);
+    }
 
     pmcf->perl = ngx_http_perl_create_interpreter(cf, pmcf);
 
     if (pmcf->perl == NULL) {
-        PERL_SYS_TERM();
         return NGX_CONF_ERROR;
     }
 
@@ -788,8 +791,6 @@ ngx_http_perl_cleanup_perl(void *data)
     (void) perl_destruct(perl);
 
     perl_free(perl);
-
-    PERL_SYS_TERM();
 }
 
 #endif
@@ -1001,3 +1002,10 @@ ngx_http_perl_set(ngx_conf_t *cf, ngx_co
 
     return NGX_CONF_OK;
 }
+
+
+static void
+ngx_http_perl_exit(ngx_cycle_t *cycle)
+{
+    PERL_SYS_TERM();
+}