From 0b20349c487f9a486db7407b3f712ca06531b9d1 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Tue, 15 Sep 2015 13:08:53 +0200 Subject: [PATCH] parse: more log messages in case of errors in parse_hname2_short() (cherry picked from commit 3913cc881030cccc9518733e18363402f2dfb18e) --- parser/parse_hname2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/parser/parse_hname2.c b/parser/parse_hname2.c index ff273d07b8d..9db38afbcaa 100644 --- a/parser/parse_hname2.c +++ b/parser/parse_hname2.c @@ -276,12 +276,18 @@ char* parse_hname2_short(char* const begin, const char* const end, struct hdr_fi return parse_hname2(begin, end, hdr); } /* not enough space */ + LM_ERR("not enough space to parse the header name in [%.*s] (%d)\n", + (int)(end-begin), begin, (int)(end-begin)); return NULL; } /* pad with whitespace - tipycal char after the ':' of the header name */ memset(hbuf, ' ', HBUF_MAX_SIZE); memcpy(hbuf, begin, end-begin); p = parse_hname2(hbuf, hbuf + 4 + (end-begin), hdr); - if(!p) return NULL; + if(!p) { + LM_ERR("failed to parse the header name in [%.*s] (%d)\n", + (int)(end-begin), begin, (int)(end-begin)); + return NULL; + } return begin + (p-hbuf); }