Module: kamailio
Branch: master
Commit: e6a3b3554af01e5141ba063df408a06b28261927
URL:
https://github.com/kamailio/kamailio/commit/e6a3b3554af01e5141ba063df408a06…
Author: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Committer: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Date: 2024-09-09T14:01:48+03:00
core: parser - use sip_parser_log
Silencing messages that tend to appear when processing HEP.
---
Modified: src/core/parser/msg_parser.c
Modified: src/core/parser/parse_hname2.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e6a3b3554af01e5141ba063df408a06…
Patch:
https://github.com/kamailio/kamailio/commit/e6a3b3554af01e5141ba063df408a06…
---
diff --git a/src/core/parser/msg_parser.c b/src/core/parser/msg_parser.c
index a8504873073..3e094c50907 100644
--- a/src/core/parser/msg_parser.c
+++ b/src/core/parser/msg_parser.c
@@ -95,7 +95,7 @@ char *get_hdr_field(
tmp = parse_hname(buf, end, hdr);
if(hdr->type == HDR_ERROR_T) {
- ERR("bad header\n");
+ LOG(cfg_get(core, core_cfg, sip_parser_log), "bad header\n");
goto error;
}
@@ -336,7 +336,8 @@ int parse_headers(
rest = get_hdr_field(tmp, end, hf);
switch(hf->type) {
case HDR_ERROR_T:
- ERR("bad header field [%.*s]\n",
+ LOG(cfg_get(core, core_cfg, sip_parser_log),
+ "bad header field [%.*s]\n",
(end - tmp > 100) ? 100 : (int)(end - tmp), tmp);
goto error;
case HDR_EOH_T:
diff --git a/src/core/parser/parse_hname2.c b/src/core/parser/parse_hname2.c
index e7d0792e988..49c62d3d181 100644
--- a/src/core/parser/parse_hname2.c
+++ b/src/core/parser/parse_hname2.c
@@ -278,7 +278,8 @@ char *parse_sip_header_name(char *const begin, const char *const end,
if(*p != ' ' && *p != '\t') {
/* no white space - bad header name format */
if(likely(logmode)) {
- LM_ERR("invalid header name for [%.*s]\n", (int)(end - begin),
+ LOG(cfg_get(core, core_cfg, sip_parser_log),
+ "invalid header name for [%.*s]\n", (int)(end - begin),
begin);
}
hdr->type = HDR_ERROR_T;