core: parser - print what is left in buffer if no EoH in get_body()
authorDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 16 Sep 2021 09:03:52 +0000 (11:03 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 16 Sep 2021 09:03:52 +0000 (11:03 +0200)
src/core/parser/msg_parser.c

index 795c96a..5b7fab5 100644 (file)
@@ -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;
        }