Browse Source

sanity: log as debug when Content-Length is missing for datagram protocols

- the header is optional for datagram protocols (RFC3261, 20.14)

(cherry picked from commit e38c7f8bac1aef9890d266fa466cea1561346732)
Daniel-Constantin Mierla 8 months ago
parent
commit
50e69e9a26
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/modules/sanity/sanity.c

+ 5 - 1
src/modules/sanity/sanity.c

@@ -625,7 +625,11 @@ int check_cl(sip_msg_t *msg)
 		}
 		LM_DBG("check_cl passed\n");
 	} else {
-		LM_WARN("content length header missing in request\n");
+		if(msg->rcv.proto != PROTO_UDP && msg->rcv.proto != PROTO_SCTP) {
+			LM_WARN("content length header missing in request\n");
+		} else {
+			LM_DBG("content length header missing in request\n");
+		}
 	}
 
 	return SANITY_CHECK_PASSED;