[sr-dev] git:master:63ecb827: core: parser - print what is left in buffer if no EoH in get_body()

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 16 11:04:54 CEST 2021


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-09-16T11:03:52+02:00

core: parser - print what is left in buffer if no EoH in get_body()

---

Modified: src/core/parser/msg_parser.c

---

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

---

diff --git a/src/core/parser/msg_parser.c b/src/core/parser/msg_parser.c
index 795c96a350..5b7fab524d 100644
--- a/src/core/parser/msg_parser.c
+++ b/src/core/parser/msg_parser.c
@@ -1356,8 +1356,10 @@ char* get_body(sip_msg_t* const msg)
 				(*(msg->unparsed)=='\n' || *(msg->unparsed)=='\r' ) ) {
 		offset = 1;
 	} else {
-		LM_ERR("failed to locate end of headers (%p %p - %d %d [%s])\n",
-				msg->buf, msg->unparsed, msg->len, len, msg->unparsed);
+		LM_ERR("failed to locate end of headers (%p %p - %d %d [%.*s])\n",
+				msg->buf, msg->unparsed, msg->len, len,
+				(len<msg->len)?(msg->len-len):0,
+				(len<msg->len)?msg->unparsed:"");
 		return 0;
 	}
 




More information about the sr-dev mailing list