Module: kamailio
Branch: master
Commit: 0a98a0d504f79cc6aa0cac13e2b30a00e6181636
URL:
https://github.com/kamailio/kamailio/commit/0a98a0d504f79cc6aa0cac13e2b30a0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-10-23T10:42:54+02:00
corex: read fmatch as str rpc parameter for shm.rprint
---
Modified: src/modules/corex/corex_mod.c
Modified: src/modules/corex/corex_rpc_shm.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0a98a0d504f79cc6aa0cac13e2b30a0…
Patch:
https://github.com/kamailio/kamailio/commit/0a98a0d504f79cc6aa0cac13e2b30a0…
---
diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c
index bdfcbe71213..ed37b22c757 100644
--- a/src/modules/corex/corex_mod.c
+++ b/src/modules/corex/corex_mod.c
@@ -93,7 +93,7 @@ static int corex_dns_cache_param_add(str *pval);
static int corex_sip_reply_out(sr_event_param_t *evp);
-/*clang-format off*/
+/* clang-format off */
static pv_export_t mod_pvs[] = {
{{"cfg", (sizeof("cfg") - 1)}, PVT_OTHER, pv_get_cfg, 0,
pv_parse_cfg_name, 0, 0, 0},
@@ -196,7 +196,7 @@ struct module_exports exports = {
child_init, /* per-child init function */
mod_destroy /* module destroy function */
};
-/*clang-format on*/
+/* clang-format on */
/**
* init module function
diff --git a/src/modules/corex/corex_rpc_shm.c b/src/modules/corex/corex_rpc_shm.c
index 02fa08f8a36..81866ab2bc8 100644
--- a/src/modules/corex/corex_rpc_shm.c
+++ b/src/modules/corex/corex_rpc_shm.c
@@ -129,7 +129,7 @@ static void corex_rpc_shm_rprint(rpc_t *rpc, void *ctx)
str fmatch = STR_NULL;
FILE *fp = NULL;
- if(rpc->scan(ctx, "ss", &fname, &fmatch) < 2) {
+ if(rpc->scan(ctx, "sS", &fname, &fmatch) < 2) {
rpc->fault(ctx, 400, "Filename and filter not provided");
return;
}
@@ -139,18 +139,20 @@ static void corex_rpc_shm_rprint(rpc_t *rpc, void *ctx)
rpc->fault(ctx, 500, "Cannot open file");
return;
}
+ LM_DBG("matching file name with: %.*s\n", fmatch.len, fmatch.s);
shm_status_filter(&fmatch, fp);
fclose(fp);
}
-/*clang-format off*/
+/* clang-format off */
rpc_export_t corex_rpc_shm_cmds[] = {
- {"shm.info", corex_rpc_shm_info, corex_rpc_shm_info_doc, 0},
- {"shm.report", corex_rpc_shm_report, corex_rpc_shm_report_doc, 0},
- {"shm.stats", corex_rpc_shm_stats, corex_rpc_shm_stats_doc, 0},
- {"shm.rprint", corex_rpc_shm_rprint, corex_rpc_shm_rprint_doc, 0},
- {0, 0, 0, 0}};
-/*clang-format on*/
+ {"shm.info", corex_rpc_shm_info, corex_rpc_shm_info_doc, 0},
+ {"shm.report", corex_rpc_shm_report, corex_rpc_shm_report_doc, 0},
+ {"shm.stats", corex_rpc_shm_stats, corex_rpc_shm_stats_doc, 0},
+ {"shm.rprint", corex_rpc_shm_rprint, corex_rpc_shm_rprint_doc, 0},
+ {0, 0, 0, 0}
+};
+/* clang-format on */
/**
* register RPC shm commands