Преглед изворни кода

app_perl: print the error string if execution of perl script sets it

Daniel-Constantin Mierla пре 3 година
родитељ
комит
8c910452cf
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      src/modules/app_perl/perlfunc.c

+ 5 - 0
src/modules/app_perl/perlfunc.c

@@ -147,6 +147,11 @@ int perl_exec2(struct sip_msg* _msg, char* fnc, char* mystr) {
 	PUTBACK;			/* make local stack pointer global */
 
 	call_pv(fnc, G_EVAL|G_SCALAR);		/* call the function     */
+
+	if(SvTRUE(ERRSV)) {
+		LM_WARN("perl error: %s\n", SvPV_nolen(ERRSV));
+	}
+
 	SPAGAIN;			/* refresh stack pointer         */
 	/* pop the return value from stack */
 	retval = POPi;