瀏覽代碼

core: add header helper uses after lump anchor insert

Daniel-Constantin Mierla 9 年之前
父節點
當前提交
3ccb1b8321
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      data_lump.c

+ 2 - 2
data_lump.c

@@ -743,7 +743,7 @@ int sr_hdr_add(sip_msg_t *msg, str *sname, str *sbody)
 	struct lump* anchor;
 	str h;
 
-	h.len = sname->len + 2 + sbody->len + 1 + CRLF_LEN;
+	h.len = sname->len + 2 + sbody->len + CRLF_LEN;
 	h.s = (char*)pkg_malloc(h.len+1);
 	if(h.s == 0) {
 		LM_ERR("no more pkg\n");
@@ -761,7 +761,7 @@ int sr_hdr_add(sip_msg_t *msg, str *sname, str *sbody)
 	memcpy(h.s+sname->len+2, sbody->s, sbody->len);
 	memcpy(h.s+sname->len+2+sbody->len, CRLF, CRLF_LEN);
 	h.s[h.len] = '\0';
-	if (insert_new_lump_before(anchor, h.s, h.len, 0) == 0)
+	if (insert_new_lump_after(anchor, h.s, h.len, 0) == 0)
 	{
 		LM_ERR("cannot insert lump\n");
 		pkg_free(h.s);