浏览代码

dispatcher: rename interal define to reflect better is a mix of matching

- rather than a full address matching
Daniel-Constantin Mierla 1 年之前
父节点
当前提交
7e22636bb2
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 5 5
      src/modules/dispatcher/dispatch.c
  2. 1 1
      src/modules/dispatcher/dispatch.h

+ 5 - 5
src/modules/dispatcher/dispatch.c

@@ -3605,9 +3605,9 @@ int ds_is_addr_from_set(sip_msg_t *_m, struct ip_addr *pipaddr,
 		if(ip_addr_cmp(pipaddr, ipa)
 		if(ip_addr_cmp(pipaddr, ipa)
 				&& ((mode & DS_MATCH_NOPORT) || node->dlist[j].port == 0
 				&& ((mode & DS_MATCH_NOPORT) || node->dlist[j].port == 0
 						|| tport == node->dlist[j].port
 						|| tport == node->dlist[j].port
-						|| (mode & DS_MATCH_TRY_FULLADDRSOCK))
+						|| (mode & DS_MATCH_MIXSOCKPRPORT))
 				&& ((mode & DS_MATCH_NOPROTO) || tproto == node->dlist[j].proto
 				&& ((mode & DS_MATCH_NOPROTO) || tproto == node->dlist[j].proto
-						|| (mode & DS_MATCH_TRY_FULLADDRSOCK))
+						|| (mode & DS_MATCH_MIXSOCKPRPORT))
 				&& (((mode & DS_MATCH_ACTIVE)
 				&& (((mode & DS_MATCH_ACTIVE)
 							&& !ds_skip_dst(node->dlist[j].flags))
 							&& !ds_skip_dst(node->dlist[j].flags))
 						|| !(mode & DS_MATCH_ACTIVE))
 						|| !(mode & DS_MATCH_ACTIVE))
@@ -3615,7 +3615,7 @@ int ds_is_addr_from_set(sip_msg_t *_m, struct ip_addr *pipaddr,
 							&& node->dlist[j].sock == _m->rcv.bind_address)
 							&& node->dlist[j].sock == _m->rcv.bind_address)
 						|| !node->dlist[j].sock || !(mode & DS_MATCH_SOCKET))) {
 						|| !node->dlist[j].sock || !(mode & DS_MATCH_SOCKET))) {
 
 
-			if(mode & DS_MATCH_TRY_FULLADDRSOCK) {
+			if(mode & DS_MATCH_MIXSOCKPRPORT) {
 				node_strictness = DS_MATCHED_ADDR;
 				node_strictness = DS_MATCHED_ADDR;
 				if(node->dlist[j].port) {
 				if(node->dlist[j].port) {
 					if(tport != node->dlist[j].port)
 					if(tport != node->dlist[j].port)
@@ -3738,7 +3738,7 @@ int ds_is_addr_from_list(sip_msg_t *_m, int group, str *uri, int mode)
 	}
 	}
 
 
 
 
-	if(mode & DS_MATCH_TRY_FULLADDRSOCK) {
+	if(mode & DS_MATCH_MIXSOCKPRPORT) {
 		ds_strictness = 0;
 		ds_strictness = 0;
 		ds_strictest_node = NULL;
 		ds_strictest_node = NULL;
 	}
 	}
@@ -3753,7 +3753,7 @@ int ds_is_addr_from_list(sip_msg_t *_m, int group, str *uri, int mode)
 		}
 		}
 	}
 	}
 
 
-	if(rc == -1 && mode & DS_MATCH_TRY_FULLADDRSOCK && ds_strictest_node) {
+	if(rc == -1 && (mode & DS_MATCH_MIXSOCKPRPORT) && ds_strictest_node) {
 		rc = ds_set_vars(
 		rc = ds_set_vars(
 				_m, ds_strictest_node, ds_strictest_idx, group == -1 ? 1 : 0);
 				_m, ds_strictest_node, ds_strictest_idx, group == -1 ? 1 : 0);
 	}
 	}

+ 1 - 1
src/modules/dispatcher/dispatch.h

@@ -60,7 +60,7 @@
 #define DS_MATCH_NOPROTO		2
 #define DS_MATCH_NOPROTO		2
 #define DS_MATCH_ACTIVE			4
 #define DS_MATCH_ACTIVE			4
 #define DS_MATCH_SOCKET			8
 #define DS_MATCH_SOCKET			8
-#define DS_MATCH_TRY_FULLADDRSOCK	16
+#define DS_MATCH_MIXSOCKPRPORT	16
 
 
 #define DS_SETOP_DSTURI		0
 #define DS_SETOP_DSTURI		0
 #define DS_SETOP_RURI		1
 #define DS_SETOP_RURI		1