[sr-dev] git:master:875ac29b: core: tcp - print first characters if matching hep3 header fails

Daniel-Constantin Mierla miconda at gmail.com
Sun Nov 5 13:45:06 CET 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-11-05T13:44:45+01:00

core: tcp - print first characters if matching hep3 header fails

---

Modified: src/core/tcp_read.c

---

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

---

diff --git a/src/core/tcp_read.c b/src/core/tcp_read.c
index 18868f1d7a..c3e87ee34d 100644
--- a/src/core/tcp_read.c
+++ b/src/core/tcp_read.c
@@ -1273,7 +1273,8 @@ static int tcp_read_hep3(struct tcp_connection *c, int* read_flags)
 
 	if(p[0]!='H' || p[1]!='E' || p[2]!='P' || p[3]=='3') {
 		/* not hep3 */
-		LM_DBG("not HEP3 packet header\n");
+		LM_DBG("not HEP3 packet header (%u): %c %c %c %c / %x %x %x %x\n",
+				size, p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3]);
 		goto skip;
 	}
 	r->flags |= F_TCP_REQ_HEP3;
@@ -1293,7 +1294,7 @@ static int tcp_read_hep3(struct tcp_connection *c, int* read_flags)
 	}
 
 	r->flags |= F_TCP_REQ_COMPLETE;
-	r->parsed = &p[len];
+	r->parsed = p + len;
 	LM_DBG("reading of HEP3 packet is complete (%u / %u)\n", len, size);
 
 skip:




More information about the sr-dev mailing list