Module: kamailio
Branch: master
Commit: 74c9f53aa736b9d2581666a8a75bc685156447f4
URL:
https://github.com/kamailio/kamailio/commit/74c9f53aa736b9d2581666a8a75bc68…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-01-17T22:23:35+01:00
exec: more info in log messages when uri parsing fails
---
Modified: src/modules/exec/exec_hf.c
---
Diff:
https://github.com/kamailio/kamailio/commit/74c9f53aa736b9d2581666a8a75bc68…
Patch:
https://github.com/kamailio/kamailio/commit/74c9f53aa736b9d2581666a8a75bc68…
---
diff --git a/src/modules/exec/exec_hf.c b/src/modules/exec/exec_hf.c
index 9b5a54a955..5f79441e6a 100644
--- a/src/modules/exec/exec_hf.c
+++ b/src/modules/exec/exec_hf.c
@@ -78,9 +78,9 @@ static int insert_hf(struct hf_wrapper **list, struct hdr_field *hf)
/* if it is OTHER, check name too */
if(hf->type == HDR_OTHER_T
&& (hf->name.len != i->u.hf->name.len
- || strncasecmp(i->u.hf->name.s, hf->name.s,
- hf->name.len)
- != 0))
+ || strncasecmp(i->u.hf->name.s, hf->name.s,
+ hf->name.len)
+ != 0))
continue;
/* yes, we found a hf of same type */
w->next_same = i->next_same;
@@ -472,14 +472,14 @@ static int append_fixed_vars(struct sip_msg *msg, struct hf_wrapper
**list)
}
/* request URI */
uri = msg->new_uri.s && msg->new_uri.len ? &msg->new_uri
- : &msg->first_line.u.request.uri;
+ : &msg->first_line.u.request.uri;
if(!append_var(EV_RURI, uri->s, uri->len, list)) {
LM_ERR("append_var URI failed\n");
return 0;
}
/* userpart of request URI */
if(parse_uri(uri->s, uri->len, &parsed_uri) < 0) {
- LM_WARN("uri not parsed\n");
+ LM_WARN("uri not parsed (%.*s)\n", uri->len, ZSW(uri->s));
} else {
if(!append_var(EV_USER, parsed_uri.user.s, parsed_uri.user.len, list)) {
LM_ERR("append_var USER failed\n");
@@ -488,18 +488,19 @@ static int append_fixed_vars(struct sip_msg *msg, struct hf_wrapper
**list)
}
/* original URI */
if(!append_var(EV_ORURI, msg->first_line.u.request.uri.s,
- msg->first_line.u.request.uri.len, list)) {
+ msg->first_line.u.request.uri.len, list)) {
LM_ERR("append_var O-URI failed\n");
goto error;
}
/* userpart of request URI */
if(parse_uri(msg->first_line.u.request.uri.s,
- msg->first_line.u.request.uri.len, &oparsed_uri)
- < 0) {
- LM_WARN("orig URI not parsed\n");
+ msg->first_line.u.request.uri.len, &oparsed_uri) < 0) {
+ LM_WARN("orig URI not parsed (%.*s)\n",
+ msg->first_line.u.request.uri.len,
+ ZSW( msg->first_line.u.request.uri.s));
} else {
if(!append_var(
- EV_OUSER, oparsed_uri.user.s, oparsed_uri.user.len, list)) {
+ EV_OUSER, oparsed_uri.user.s, oparsed_uri.user.len, list)) {
LM_ERR("append_var OUSER failed\n");
goto error;
}