Module: kamailio
Branch: master
Commit: 63ecb827631189d27da6a85d41149985d95fc479
URL:
https://github.com/kamailio/kamailio/commit/63ecb827631189d27da6a85d4114998…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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/63ecb827631189d27da6a85d4114998…
Patch:
https://github.com/kamailio/kamailio/commit/63ecb827631189d27da6a85d4114998…
---
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;
}