Added additional fix for #348 - each instance will have its own interp and this way...
authorbjordanov <bjordanov>
Tue, 4 Apr 2006 14:16:57 +0000 (14:16 +0000)
committerbjordanov <bjordanov>
Tue, 4 Apr 2006 14:16:57 +0000 (14:16 +0000)
src/modules/rlm_perl/rlm_perl.c

index 45e8711..8bd6a7c 100644 (file)
@@ -592,17 +592,7 @@ static int init_pool (CONF_SECTION *conf, PERL_INST *inst) {
  */
 static int perl_init(void)
 {
-#ifdef USE_ITHREADS
-       if ((interp = perl_alloc()) == NULL) {
-               radlog(L_DBG, "rlm_perl: No memory for allocating new perl !");
-               return -1;
-       }
-
-       perl_construct(interp);
-       PL_perl_destruct_level = 2;
-#endif
        return 0;
-
 }
 
 static void xs_init(pTHX)
@@ -779,6 +769,15 @@ static int perl_instantiate(CONF_SECTION *conf, void **instance)
 
 #ifdef USE_ITHREADS
        inst->perl = interp;
+       
+       if ((inst->perl = perl_alloc()) == NULL) {
+               radlog(L_DBG, "rlm_perl: No memory for allocating new perl !");
+               return (-1);
+       }
+
+       perl_construct(inst->perl);
+       PL_perl_destruct_level = 2;
+
        {
        dTHXa(inst->perl);
        }