Module: kamailio
Branch: master
Commit: 6f68f55c1c654e3cb120c10eb6999d538d943ca2
URL:
https://github.com/kamailio/kamailio/commit/6f68f55c1c654e3cb120c10eb6999d5…
Author: Pantelis Kolatsis <pk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-04-24T19:20:16Z
qos: convert to memory logging helper
---
Modified: src/modules/qos/qos_cb.c
Modified: src/modules/qos/qos_ctx_helpers.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6f68f55c1c654e3cb120c10eb6999d5…
Patch:
https://github.com/kamailio/kamailio/commit/6f68f55c1c654e3cb120c10eb6999d5…
---
diff --git a/src/modules/qos/qos_cb.c b/src/modules/qos/qos_cb.c
index e2b0c0f9aee..6c81411d6f0 100644
--- a/src/modules/qos/qos_cb.c
+++ b/src/modules/qos/qos_cb.c
@@ -34,7 +34,7 @@ int init_qos_callbacks(void)
{
create_cbs = (struct qos_head_cbl*)shm_malloc(sizeof(struct qos_head_cbl));
if (create_cbs==0) {
- LM_ERR("no more shm mem\n");
+ SHM_MEM_ERROR;
return -1;
}
create_cbs->first = 0;
@@ -88,7 +88,7 @@ int register_qoscb(qos_ctx_t *qos, int types, qos_cb f, void *param )
}
cb = (struct qos_callback*)shm_malloc(sizeof(struct qos_callback));
if (cb==0) {
- LM_ERR("no more shm mem\n");
+ SHM_MEM_ERROR;
return -1;
}
diff --git a/src/modules/qos/qos_ctx_helpers.c b/src/modules/qos/qos_ctx_helpers.c
index f36193cf6ce..25143dfdb4d 100644
--- a/src/modules/qos/qos_ctx_helpers.c
+++ b/src/modules/qos/qos_ctx_helpers.c
@@ -52,7 +52,7 @@ qos_ctx_t *build_new_qos_ctx(void) {
if (ctx!=NULL) {
memset(ctx, 0, sizeof(qos_ctx_t));
} else {
- LM_ERR("No enough shared memory\n");
+ SHM_MEM_ERROR;
return NULL;
}
if (!lock_init(&ctx->lock)) {
@@ -342,7 +342,7 @@ int add_pending_sdp_session(qos_ctx_t *qos_ctx, unsigned int dir, str
*cseq_numb
qos_sdp = (qos_sdp_t *)shm_malloc(len);
LM_DBG("alloc qos_sdp: %p\n", qos_sdp);
if (qos_sdp==NULL) {
- LM_ERR("oom %d\n", len);
+ SHM_MEM_ERROR_FMT("missing %d\n", len);
return -1;
} else {
memset(qos_sdp, 0, len);