[sr-dev] git:master:3ccb1b83: core: add header helper uses after lump anchor insert

Daniel-Constantin Mierla miconda at gmail.com
Wed Jul 13 10:19:35 CEST 2016


Module: kamailio
Branch: master
Commit: 3ccb1b83216b874405b7a63a73b2966aa7f91253
URL: https://github.com/kamailio/kamailio/commit/3ccb1b83216b874405b7a63a73b2966aa7f91253

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-07-13T10:18:49+02:00

core: add header helper uses after lump anchor insert

---

Modified: data_lump.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3ccb1b83216b874405b7a63a73b2966aa7f91253.diff
Patch: https://github.com/kamailio/kamailio/commit/3ccb1b83216b874405b7a63a73b2966aa7f91253.patch

---

diff --git a/data_lump.c b/data_lump.c
index 19a6b90..5d085ec 100644
--- a/data_lump.c
+++ b/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);




More information about the sr-dev mailing list