Module: kamailio Branch: master Commit: 153fc0febcc7d2096199e4ac42c7ecd3e0159edd URL: https://github.com/kamailio/kamailio/commit/153fc0febcc7d2096199e4ac42c7ecd3...
Author: Henning Westerholt hw@skalatan.de Committer: Henning Westerholt hw@skalatan.de Date: 2020-01-25T19:20:34+01:00
xhttp: convert to memory logging helper
---
Modified: src/modules/xhttp/xhttp_mod.c Modified: src/modules/xhttp/xhttp_trans.c
---
Diff: https://github.com/kamailio/kamailio/commit/153fc0febcc7d2096199e4ac42c7ecd3... Patch: https://github.com/kamailio/kamailio/commit/153fc0febcc7d2096199e4ac42c7ecd3...
---
diff --git a/src/modules/xhttp/xhttp_mod.c b/src/modules/xhttp/xhttp_mod.c index 22815d82ab..78abf55030 100644 --- a/src/modules/xhttp/xhttp_mod.c +++ b/src/modules/xhttp/xhttp_mod.c @@ -220,7 +220,7 @@ static char* xhttp_to_sip(sip_msg_t* msg, int* new_msg_len) p = new_msg = pkg_malloc(len + 1); if (new_msg == 0) { - LM_DBG("memory allocation failure (%d bytes)\n", len); + PKG_MEM_ERROR_FMT(" (%d bytes)\n", len); pkg_free(via); return 0; } @@ -412,7 +412,7 @@ static int xhttp_send_reply(sip_msg_t *msg, int code, str *reason,
if (tbuf.s==0) { - LM_ERR("out of pkg memory\n"); + PKG_MEM_ERROR; return -1; } memcpy(tbuf.s, "Content-Type: ", sizeof("Content-Type: ") - 1); diff --git a/src/modules/xhttp/xhttp_trans.c b/src/modules/xhttp/xhttp_trans.c index 1dfb2f822b..22e5647883 100644 --- a/src/modules/xhttp/xhttp_trans.c +++ b/src/modules/xhttp/xhttp_trans.c @@ -56,7 +56,7 @@ int xhttp_tr_eval_xhttpurl(struct sip_msg *msg, tr_param_t *tp, int subtype, (val->rs.len + 1) * sizeof(char)); if (_httpurl_str.s == NULL) { - LM_ERR("allocating package memory\n"); + PKG_MEM_ERROR; memset(&_httpurl_str.s, 0, sizeof(str)); return -1; }