Module: kamailio
Branch: 4.3
Commit: 0b20349c487f9a486db7407b3f712ca06531b9d1
URL:
https://github.com/kamailio/kamailio/commit/0b20349c487f9a486db7407b3f712ca…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-09-15T13:13:01+02:00
parse: more log messages in case of errors in parse_hname2_short()
(cherry picked from commit 3913cc881030cccc9518733e18363402f2dfb18e)
---
Modified: parser/parse_hname2.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0b20349c487f9a486db7407b3f712ca…
Patch:
https://github.com/kamailio/kamailio/commit/0b20349c487f9a486db7407b3f712ca…
---
diff --git a/parser/parse_hname2.c b/parser/parse_hname2.c
index ff273d0..9db38af 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);
}