[sr-dev] git:master:e9cfb2bf: dispatcher: log messages for hashing auth username

Daniel-Constantin Mierla miconda at gmail.com
Tue Jul 4 12:18:56 CEST 2017


Module: kamailio
Branch: master
Commit: e9cfb2bf5012cdbde36559f615b58e3a556bfc2d
URL: https://github.com/kamailio/kamailio/commit/e9cfb2bf5012cdbde36559f615b58e3a556bfc2d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-07-04T11:52:53+02:00

dispatcher: log messages for hashing auth username

---

Modified: src/modules/dispatcher/dispatch.c

---

Diff:  https://github.com/kamailio/kamailio/commit/e9cfb2bf5012cdbde36559f615b58e3a556bfc2d.diff
Patch: https://github.com/kamailio/kamailio/commit/e9cfb2bf5012cdbde36559f615b58e3a556bfc2d.patch

---

diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c
index 38a6213de1..155be57ca5 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -1214,12 +1214,16 @@ int ds_hash_authusername(struct sip_msg *msg, unsigned int *hash)
 		LM_ERR("bad parameters\n");
 		return -1;
 	}
+	*hash = 0;
 	if(parse_headers(msg, HDR_PROXYAUTH_F, 0) == -1) {
 		LM_ERR("error parsing headers!\n");
 		return -1;
 	}
-	if(msg->proxy_auth && !msg->proxy_auth->parsed)
-		parse_credentials(msg->proxy_auth);
+	if(msg->proxy_auth && !msg->proxy_auth->parsed) {
+		if(parse_credentials(msg->proxy_auth)!=0) {
+			LM_DBG("no parsing for proxy-auth header\n");
+		}
+	}
 	if(msg->proxy_auth && msg->proxy_auth->parsed) {
 		h = msg->proxy_auth;
 	}
@@ -1228,8 +1232,11 @@ int ds_hash_authusername(struct sip_msg *msg, unsigned int *hash)
 			LM_ERR("error parsing headers!\n");
 			return -1;
 		}
-		if(msg->authorization && !msg->authorization->parsed)
-			parse_credentials(msg->authorization);
+		if(msg->authorization && !msg->authorization->parsed) {
+			if(parse_credentials(msg->authorization)!=0) {
+				LM_DBG("no parsing for auth header\n");
+			}
+		}
 		if(msg->authorization && msg->authorization->parsed) {
 			h = msg->authorization;
 		}




More information about the sr-dev mailing list