Browse code

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

(cherry picked from commit 63ecb827631189d27da6a85d41149985d95fc479)
(cherry picked from commit 4578fb676177e16324c2241820cf5f8042503a37)
(cherry picked from commit 730167bf4e26ba44bf69275730efbf81e541ad1a)

Daniel-Constantin Mierla authored on 16/09/2021 09:03:52 • Henning Westerholt committed on 22/10/2021 12:13:27
Showing 1 changed files
... ...
@@ -1292,8 +1292,10 @@ char* get_body(sip_msg_t* const msg)
1292 1292
 				(*(msg->unparsed)=='\n' || *(msg->unparsed)=='\r' ) ) {
1293 1293
 		offset = 1;
1294 1294
 	} else {
1295
-		LM_ERR("failed to locate end of headers (%p %p - %d %d [%s])\n",
1296
-				msg->buf, msg->unparsed, msg->len, len, msg->unparsed);
1295
+		LM_ERR("failed to locate end of headers (%p %p - %d %d [%.*s])\n",
1296
+				msg->buf, msg->unparsed, msg->len, len,
1297
+				(len<msg->len)?(msg->len-len):0,
1298
+				(len<msg->len)?msg->unparsed:"");
1297 1299
 		return 0;
1298 1300
 	}
1299 1301