Browse code

xhttp: convert to memory logging helper

Henning Westerholt authored on 25/01/2020 18:20:34
Showing 2 changed files
... ...
@@ -220,7 +220,7 @@ static char* xhttp_to_sip(sip_msg_t* msg, int* new_msg_len)
220 220
 	p = new_msg = pkg_malloc(len + 1);
221 221
 	if (new_msg == 0)
222 222
 	{
223
-		LM_DBG("memory allocation failure (%d bytes)\n", len);
223
+		PKG_MEM_ERROR_FMT(" (%d bytes)\n", len);
224 224
 		pkg_free(via);
225 225
 		return 0;
226 226
 	}
... ...
@@ -412,7 +412,7 @@ static int xhttp_send_reply(sip_msg_t *msg, int code, str *reason,
412 412
 
413 413
 		if (tbuf.s==0)
414 414
 		{
415
-			LM_ERR("out of pkg memory\n");
415
+			PKG_MEM_ERROR;
416 416
 			return -1;
417 417
 		}
418 418
 		memcpy(tbuf.s, "Content-Type: ", sizeof("Content-Type: ") - 1);
... ...
@@ -56,7 +56,7 @@ int xhttp_tr_eval_xhttpurl(struct sip_msg *msg, tr_param_t *tp, int subtype,
56 56
 					(val->rs.len + 1) * sizeof(char));
57 57
 			if (_httpurl_str.s == NULL)
58 58
 			{
59
-				LM_ERR("allocating package memory\n");
59
+				PKG_MEM_ERROR;
60 60
 				memset(&_httpurl_str.s, 0, sizeof(str));
61 61
 				return -1;
62 62
 			}