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)

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