[sr-dev] git:master:7f4d7725: textopsx: return false on iterator end of headers

Daniel-Constantin Mierla miconda at gmail.com
Wed Jul 7 12:39:23 CEST 2021


Module: kamailio
Branch: master
Commit: 7f4d7725a55379ef0e7ee5c5a2050d3b1d4565bc
URL: https://github.com/kamailio/kamailio/commit/7f4d7725a55379ef0e7ee5c5a2050d3b1d4565bc

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-07-07T12:39:06+02:00

textopsx: return false on iterator end of headers

---

Modified: src/modules/textopsx/textopsx.c

---

Diff:  https://github.com/kamailio/kamailio/commit/7f4d7725a55379ef0e7ee5c5a2050d3b1d4565bc.diff
Patch: https://github.com/kamailio/kamailio/commit/7f4d7725a55379ef0e7ee5c5a2050d3b1d4565bc.patch

---

diff --git a/src/modules/textopsx/textopsx.c b/src/modules/textopsx/textopsx.c
index ee220fbb82..d3295bf02c 100644
--- a/src/modules/textopsx/textopsx.c
+++ b/src/modules/textopsx/textopsx.c
@@ -93,7 +93,7 @@ static int pv_get_hf_iterator_hbody(sip_msg_t *msg, pv_param_t *param,
 static pv_export_t mod_pvs[] = {
 	{ {"hfitname", sizeof("hfitname")-1}, PVT_OTHER, pv_get_hf_iterator_hname, 0,
 		pv_parse_hf_iterator_name, 0, 0, 0 },
-	{ {"hfitbody", sizeof("hfitname")-1}, PVT_OTHER, pv_get_hf_iterator_hbody, 0,
+	{ {"hfitbody", sizeof("hfitbody")-1}, PVT_OTHER, pv_get_hf_iterator_hbody, 0,
 		pv_parse_hf_iterator_name, 0, 0, 0 },
 	{ {0, 0}, 0, 0, 0, 0, 0, 0, 0 }
 };
@@ -1924,6 +1924,10 @@ static int ki_hf_iterator_next(sip_msg_t *msg, str *iname)
 		LM_ERR("iterator not available [%.*s]\n", iname->len, iname->s);
 		return -1;
 	}
+	if(_hf_iterators[k].eoh == 1) {
+		return -1;
+	}
+
 	if(_hf_iterators[k].it == NULL) {
 		_hf_iterators[k].it = msg->headers;
 	} else {
@@ -1931,6 +1935,7 @@ static int ki_hf_iterator_next(sip_msg_t *msg, str *iname)
 	}
 	if(_hf_iterators[k].it == NULL) {
 		_hf_iterators[k].eoh = 1;
+		return -1;
 	}
 	return 1;
 }




More information about the sr-dev mailing list