Skip to content

Commit

Permalink
core: parser - use sip_parser_log
Browse files Browse the repository at this point in the history
Silencing messages that tend to appear when processing HEP.
  • Loading branch information
lbalaceanu committed Sep 4, 2024
1 parent 637d53f commit 27c1935
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/core/parser/msg_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/core/parser/parse_hname2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27c1935

Please sign in to comment.