Browse code

dispatcher: adjustments to ds_list_exist()

- info log messages made debug
- return -2 if evaluating the fixup param fails

Daniel-Constantin Mierla authored on 18/10/2019 06:48:27
Showing 2 changed files
... ...
@@ -1482,16 +1482,16 @@ static inline int ds_get_index(int group, int ds_list_idx, ds_set_t **index)
1482 1482
 int ds_list_exist(int set)
1483 1483
 {
1484 1484
 	ds_set_t *si = NULL;
1485
-	LM_DBG("-- Looking for set %d\n", set);
1485
+	LM_DBG("looking for destination set [%d]\n", set);
1486 1486
 
1487 1487
 	/* get the index of the set */
1488 1488
 	si = ds_avl_find(_ds_list, set);
1489 1489
 
1490 1490
 	if(si == NULL) {
1491
-		LM_INFO("destination set [%d] not found\n", set);
1491
+		LM_DBG("destination set [%d] not found\n", set);
1492 1492
 		return -1; /* False */
1493 1493
 	}
1494
-	LM_INFO("destination set [%d] found\n", set);
1494
+	LM_DBG("destination set [%d] found\n", set);
1495 1495
 	return 1; /* True */
1496 1496
 }
1497 1497
 
... ...
@@ -1025,9 +1025,8 @@ static int w_ds_list_exist(struct sip_msg *msg, char *param, char *p2)
1025 1025
 
1026 1026
 	if(fixup_get_ivalue(msg, (gparam_p)param, &set) != 0) {
1027 1027
 		LM_ERR("cannot get set id param value\n");
1028
-		return -1;
1028
+		return -2;
1029 1029
 	}
1030
-	LM_DBG("--- Looking for dispatcher set %d\n", set);
1031 1030
 	return ds_list_exist(set);
1032 1031
 }
1033 1032