浏览代码

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 月之前
父节点
当前提交
50e69e9a26
共有 1 个文件被更改,包括 5 次插入1 次删除
  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;