浏览代码

pv(k): don't use CL for body PV

- size of body is computed from size of sip message
Daniel-Constantin Mierla 15 年之前
父节点
当前提交
a82617e71d
共有 1 个文件被更改,包括 5 次插入10 次删除
  1. 5 10
      modules_k/pv/pv_core.c

+ 5 - 10
modules_k/pv/pv_core.c

@@ -945,23 +945,18 @@ int pv_get_msg_body(struct sip_msg *msg, pv_param_t *param,
 		pv_value_t *res)
 {
 	str s;
-    if(msg==NULL)
+	if(msg==NULL)
 		return -1;
-    
+
 	s.s = get_body( msg );
 
-	if (s.s == NULL)
+	if(s.s == NULL)
 	{
 		LM_DBG("no message body\n");
 		return pv_get_null(msg, param, res);
-    }    
+	}    
+	s.len = msg->buf + msg->len - s.s;
 
-	if (!msg->content_length) 
-	{
-		LM_ERR("no Content-Length header found\n");
-		return pv_get_null(msg, param, res);
-	}
-    s.len = get_content_length(msg);
 	return pv_get_strval(msg, param, res, &s);
 }