From 7394b1efbd0dbd071ca3d05fc13cdb5b6677e965 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 20 May 2024 08:50:05 +0200 Subject: [PATCH] pjsip_find_msg: Log warning if Content-Length field not found (#3960) --- pjsip/src/pjsip/sip_parser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c index 24966b6586..54ba6dbba1 100644 --- a/pjsip/src/pjsip/sip_parser.c +++ b/pjsip/src/pjsip/sip_parser.c @@ -937,6 +937,8 @@ PJ_DEF(pj_status_t) pjsip_find_msg( const char *buf, pj_size_t size, /* Found Content-Length? */ if (content_length == -1) { + /* As per RFC3261 7.4.2, 7.5, 20.14, Content-Length is mandatory over TCP. */ + PJ_LOG(2, (THIS_FILE, "Field Content-Length not found!")); return status; }