[sr-dev] git:master:3d4f5fca: core: kemi - proper conditions for operators in sr_kemi_hdr_match_content()

Daniel-Constantin Mierla miconda at gmail.com
Mon Oct 19 12:59:49 CEST 2020


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-10-19T12:59:15+02:00

core: kemi - proper conditions for operators in sr_kemi_hdr_match_content()

---

Modified: src/core/kemi.c

---

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

---

diff --git a/src/core/kemi.c b/src/core/kemi.c
index 1072846290..b69499dfb5 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -2441,13 +2441,13 @@ static int sr_kemi_hdr_match_content(sip_msg_t *msg, str *hname, str *op,
 	if(op->len == 2) {
 		if(strncasecmp(op->s, "eq", 2) == 0) {
 			opval = 1;
-		} if(strncasecmp(op->s, "ne", 2) == 0) {
+		} else if(strncasecmp(op->s, "ne", 2) == 0) {
 			opval = 2;
-		} if(strncasecmp(op->s, "sw", 2) == 0) {
+		} else if(strncasecmp(op->s, "sw", 2) == 0) {
 			opval = 3;
-		} if(strncasecmp(op->s, "in", 2) == 0) {
+		} else if(strncasecmp(op->s, "in", 2) == 0) {
 			opval = 4;
-		} if(strncasecmp(op->s, "re", 2) == 0) {
+		} else if(strncasecmp(op->s, "re", 2) == 0) {
 			opval = 5;
 			LM_ERR("operator not implemented: %.*s\n", op->len, op->s);
 			return SR_KEMI_FALSE;
@@ -2468,7 +2468,7 @@ static int sr_kemi_hdr_match_content(sip_msg_t *msg, str *hname, str *op,
 		} else if(hidx->s[0]=='l' || hidx->s[0]=='L') {
 			/* last */
 			hidxval = 2;
-		} else if(hidx->s[0]=='a' || hidx->s[0]=='a') {
+		} else if(hidx->s[0]=='a' || hidx->s[0]=='A') {
 			/* all */
 			hidxval = 3;
 		} else if(hidx->s[0]=='o' || hidx->s[0]=='O') {




More information about the sr-dev mailing list