Module: kamailio
Branch: master
Commit: 82ae289d8f549b142aa0631b6225838bbbc1f446
URL:
https://github.com/kamailio/kamailio/commit/82ae289d8f549b142aa0631b6225838…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-01-15T10:00:34+01:00
sanity: prefix global variables with short name
---
Modified: src/modules/sanity/sanity.c
Modified: src/modules/sanity/sanity_mod.c
Modified: src/modules/sanity/sanity_mod.h
---
Diff:
https://github.com/kamailio/kamailio/commit/82ae289d8f549b142aa0631b6225838…
Patch:
https://github.com/kamailio/kamailio/commit/82ae289d8f549b142aa0631b6225838…
---
diff --git a/src/modules/sanity/sanity.c b/src/modules/sanity/sanity.c
index 7ec9fc6c26b..fa3d0493883 100644
--- a/src/modules/sanity/sanity.c
+++ b/src/modules/sanity/sanity.c
@@ -81,12 +81,13 @@ int ki_sanity_reply(sip_msg_t *msg)
|| msg->id != _ksr_sanity_info.msgid
|| msg->pid != _ksr_sanity_info.msgpid) {
LM_INFO("no sanity reply info set - sending 500\n");
- if(slb.zreply(msg, 500, "Server Sanity Failure") < 0) {
+ if(_sanity_slb.zreply(msg, 500, "Server Sanity Failure") < 0) {
return -1;
}
return 1;
}
- if(slb.zreply(msg, _ksr_sanity_info.code, _ksr_sanity_info.reason)
+ if(_sanity_slb.zreply(
+ msg, _ksr_sanity_info.code, _ksr_sanity_info.reason)
< 0) {
return -1;
}
@@ -120,7 +121,7 @@ int sanity_reply(sip_msg_t *msg, int code, char *reason)
_ksr_sanity_info.msgpid = msg->pid;
} else {
if(!(msg->msg_flags & FL_MSG_NOREPLY)) {
- if(slb.zreply(msg, code, reason) < 0) {
+ if(_sanity_slb.zreply(msg, code, reason) < 0) {
return -1;
}
}
diff --git a/src/modules/sanity/sanity_mod.c b/src/modules/sanity/sanity_mod.c
index 7a496ca2a83..99f64fbf082 100644
--- a/src/modules/sanity/sanity_mod.c
+++ b/src/modules/sanity/sanity_mod.c
@@ -34,7 +34,7 @@ MODULE_VERSION
#define PROXY_REQUIRE_DEF ""
-str pr_str = STR_STATIC_INIT(PROXY_REQUIRE_DEF);
+static str _sanity_prval = STR_STATIC_INIT(PROXY_REQUIRE_DEF);
int default_msg_checks = SANITY_DEFAULT_CHECKS;
int default_uri_checks = SANITY_DEFAULT_URI_CHECKS;
@@ -43,7 +43,7 @@ int ksr_sanity_noreply = 0;
str_list_t *proxyrequire_list = NULL;
-sl_api_t slb;
+sl_api_t _sanity_slb;
static int mod_init(void);
static int w_sanity_check(sip_msg_t *_msg, char *_msg_check, char *_uri_check);
@@ -70,7 +70,7 @@ static cmd_export_t cmds[] = {{"sanity_check",
(cmd_function)w_sanity_check, 0,
static param_export_t params[] = {
{"default_checks", PARAM_INT, &default_msg_checks},
{"uri_checks", PARAM_INT, &default_uri_checks},
- {"proxy_require", PARAM_STR, &pr_str},
+ {"proxy_require", PARAM_STR, &_sanity_prval},
{"autodrop", PARAM_INT, &_sanity_drop},
{"noreply", PARAM_INT, &ksr_sanity_noreply}, {0, 0, 0}};
@@ -102,13 +102,13 @@ static int mod_init(void)
ksr_sanity_info_init();
/* bind the SL API */
- if(sl_load_api(&slb) != 0) {
+ if(sl_load_api(&_sanity_slb) != 0) {
LM_ERR("cannot bind to SL API\n");
return -1;
}
LM_DBG("parsing proxy requires string:\n");
- ptr = parse_str_list(&pr_str);
+ ptr = parse_str_list(&_sanity_prval);
proxyrequire_list = ptr;
diff --git a/src/modules/sanity/sanity_mod.h b/src/modules/sanity/sanity_mod.h
index 4ad92850e15..41e13359eb2 100644
--- a/src/modules/sanity/sanity_mod.h
+++ b/src/modules/sanity/sanity_mod.h
@@ -72,6 +72,6 @@
extern int default_checks;
extern str_list_t *proxyrequire_list;
-extern sl_api_t slb;
+extern sl_api_t _sanity_slb;
#endif /* MOD_SANITY_CHK_H */