Browse code

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

Daniel-Constantin Mierla authored on 16/09/2021 09:03:52
Showing 1 changed files
... ...
@@ -1356,8 +1356,10 @@ char* get_body(sip_msg_t* const msg)
1356 1356
 				(*(msg->unparsed)=='\n' || *(msg->unparsed)=='\r' ) ) {
1357 1357
 		offset = 1;
1358 1358
 	} else {
1359
-		LM_ERR("failed to locate end of headers (%p %p - %d %d [%s])\n",
1360
-				msg->buf, msg->unparsed, msg->len, len, msg->unparsed);
1359
+		LM_ERR("failed to locate end of headers (%p %p - %d %d [%.*s])\n",
1360
+				msg->buf, msg->unparsed, msg->len, len,
1361
+				(len<msg->len)?(msg->len-len):0,
1362
+				(len<msg->len)?msg->unparsed:"");
1361 1363
 		return 0;
1362 1364
 	}
1363 1365