[sr-dev] git:master: modules_k/xcap_server: Added explicit parsing of headers before looking for HTTP ETag and Host headers

Peter Dunkley peter.dunkley at crocodile-rcs.com
Thu Oct 25 21:35:30 CEST 2012


Module: sip-router
Branch: master
Commit: a4f28b9707b2c55af87138cca531fdb1badd7023
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a4f28b9707b2c55af87138cca531fdb1badd7023

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Thu Oct 25 20:17:48 2012 +0100

modules_k/xcap_server: Added explicit parsing of headers before looking for HTTP ETag and Host headers

---

 modules_k/xcap_server/xcap_server.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/modules_k/xcap_server/xcap_server.c b/modules_k/xcap_server/xcap_server.c
index 3d0be18..8a8b228 100644
--- a/modules_k/xcap_server/xcap_server.c
+++ b/modules_k/xcap_server/xcap_server.c
@@ -915,6 +915,12 @@ static int xcaps_get_directory(struct sip_msg *msg, str *user, str *domain, str
 	if (db_res == NULL)
 		goto error;
 
+	if (parse_headers(msg, HDR_EOH_F, 0) < 0)
+	{
+		LM_ERR("error parsing headers\n");
+		goto error;
+	}
+
 	while (hdr != NULL)
 	{
 		if (cmp_hdrname_strzn(&hdr->name, "Host", 4) == 0)
@@ -1490,6 +1496,12 @@ static int check_preconditions(sip_msg_t *msg, str etag_hdr)
 	int matched_matched=0;
 	int matched_nonematched=0;
 
+	if (parse_headers(msg, HDR_EOH_F, 0) < 0)
+	{
+		LM_ERR("error parsing headers\n");
+		return 1;
+	}
+
 	if (etag_hdr.len > 0)
 	{
 		str etag;




More information about the sr-dev mailing list