changeset 908:82adc19b4b4d

axe ngx_http_perl_cleanup_sv(): all SVs should be freed by perl_free() in ngx_http_perl_cleanup_perl()
author Igor Sysoev <igor@sysoev.ru>
date Tue, 12 Dec 2006 20:06:04 +0000
parents 424636f52f44
children f01e6664f9be
files src/http/modules/perl/ngx_http_perl_module.c
diffstat 1 files changed, 0 insertions(+), 37 deletions(-) [+]
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
@@ -62,7 +62,6 @@ static char *ngx_http_perl_require(ngx_c
     void *conf);
 static char *ngx_http_perl(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 static char *ngx_http_perl_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static void ngx_http_perl_cleanup_sv(void *data);
 
 #if (NGX_HAVE_PERL_MULTIPLICITY)
 static void ngx_http_perl_cleanup_perl(void *data);
@@ -758,18 +757,6 @@ ngx_http_perl_cleanup_perl(void *data)
 #endif
 
 
-static void
-ngx_http_perl_cleanup_sv(void *data)
-{
-    ngx_http_perl_cleanup_t  *cln = data;
-
-    dTHXa(cln->perl);
-    PERL_SET_CONTEXT(cln->perl);
-
-    SvREFCNT_dec(cln->sv);
-}
-
-
 static ngx_int_t
 ngx_http_perl_preconfiguration(ngx_conf_t *cf)
 {
@@ -860,8 +847,6 @@ ngx_http_perl(ngx_conf_t *cf, ngx_comman
     ngx_http_perl_loc_conf_t *plcf = conf;
 
     ngx_str_t                  *value;
-    ngx_pool_cleanup_t         *cln;
-    ngx_http_perl_cleanup_t    *pcln;
     ngx_http_core_loc_conf_t   *clcf;
     ngx_http_perl_main_conf_t  *pmcf;
 
@@ -881,11 +866,6 @@ ngx_http_perl(ngx_conf_t *cf, ngx_comman
         }
     }
 
-    cln = ngx_pool_cleanup_add(cf->pool, sizeof(ngx_http_perl_cleanup_t));
-    if (cln == NULL) {
-        return NGX_CONF_ERROR;
-    }
-
     plcf->handler = value[1];
 
     {
@@ -907,11 +887,6 @@ ngx_http_perl(ngx_conf_t *cf, ngx_comman
 
     }
 
-    cln->handler = ngx_http_perl_cleanup_sv;
-    pcln = cln->data;
-    pcln->sv = plcf->sub;
-    pcln->perl = pmcf->perl;
-
     clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
     clcf->handler = ngx_http_perl_handler;
 
@@ -924,9 +899,7 @@ ngx_http_perl_set(ngx_conf_t *cf, ngx_co
 {
     ngx_int_t                   index;
     ngx_str_t                  *value;
-    ngx_pool_cleanup_t         *cln;
     ngx_http_variable_t        *v;
-    ngx_http_perl_cleanup_t    *pcln;
     ngx_http_perl_variable_t   *pv;
     ngx_http_perl_main_conf_t  *pmcf;
 
@@ -964,11 +937,6 @@ ngx_http_perl_set(ngx_conf_t *cf, ngx_co
         }
     }
 
-    cln = ngx_pool_cleanup_add(cf->pool, sizeof(ngx_http_perl_cleanup_t));
-    if (cln == NULL) {
-        return NGX_CONF_ERROR;
-    }
-
     pv->handler = value[2];
 
     {
@@ -990,11 +958,6 @@ ngx_http_perl_set(ngx_conf_t *cf, ngx_co
 
     }
 
-    cln->handler = ngx_http_perl_cleanup_sv;
-    pcln = cln->data;
-    pcln->sv = pv->sub;
-    pcln->perl = pmcf->perl;
-
     v->get_handler = ngx_http_perl_variable;
     v->data = (uintptr_t) pv;