Ver Fonte

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)
(cherry picked from commit 50e69e9a269e5d5dba0251f893abc34907a12970)
Daniel-Constantin Mierla há 8 meses atrás
pai
commit
b01dcd5b4d
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      src/modules/sanity/sanity.c

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

@@ -624,7 +624,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;