Module: kamailio
Branch: master
Commit: ec78caf6e0efffcc8f4f78954ae88d083734c442
URL:
https://github.com/kamailio/kamailio/commit/ec78caf6e0efffcc8f4f78954ae88d0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-07-11T08:55:30+02:00
app_perl: new parameter to set warn flag for perl parse
---
Modified: src/modules/app_perl/app_perl_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ec78caf6e0efffcc8f4f78954ae88d0…
Patch:
https://github.com/kamailio/kamailio/commit/ec78caf6e0efffcc8f4f78954ae88d0…
---
diff --git a/src/modules/app_perl/app_perl_mod.c b/src/modules/app_perl/app_perl_mod.c
index ce3eff3699..67120d49e4 100644
--- a/src/modules/app_perl/app_perl_mod.c
+++ b/src/modules/app_perl/app_perl_mod.c
@@ -72,6 +72,7 @@ int _ap_reset_cycles_init = 0;
int _ap_exec_cycles = 0;
int *_ap_reset_cycles = 0;
int _ap_parse_mode = 0;
+static int _ap_warn_mode = 0;
/* Reference to the running Perl interpreter instance */
PerlInterpreter *my_perl = NULL;
@@ -125,6 +126,7 @@ static param_export_t params[] = {
{"reset_cycles", INT_PARAM, &_ap_reset_cycles_init},
{"perl_destroy_func", PARAM_STRING, &perl_destroy_func},
{"parse_mode", PARAM_INT, &_ap_parse_mode},
+ {"warn_mode", PARAM_INT, &_ap_warn_mode},
{ 0, 0, 0 }
};
@@ -185,7 +187,7 @@ EXTERN_C void xs_init(pTHX) {
*/
int parser_init(void) {
int argc = 0;
- char *argv[MAX_LIB_PATHS + 3];
+ char *argv[MAX_LIB_PATHS + 6];
char *entry, *stop, *end;
int modpathset_start = 0;
int modpathset_end = 0;
@@ -208,6 +210,10 @@ int parser_init(void) {
argv[0] = ""; argc++; /* First param _needs_ to be empty */
+ if(_ap_warn_mode==1) {
+ argv[argc] = "-w"; argc++;
+ }
+
/* Possible Include path extension by modparam */
if (modpath && (strlen(modpath) > 0)) {
modpathset_start = argc;