Browse code

- try to avoid selecting inactive destination in round robin (reported by Francisco Ivandic)

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2603 689a6050-402a-0410-94f2-e92a70836424

Daniel-Constantin Mierla authored on 15/08/2007 08:11:41
Showing 1 changed files
... ...
@@ -1052,6 +1052,9 @@ int ds_select_dst(struct sip_msg *msg, int set, int alg, int mode)
1052 1052
 		LM_ERR("cannot set dst addr\n");
1053 1053
 		return -1;
1054 1054
 	}
1055
+	/* if alg is round-robin then update the shortcut to next to be used */
1056
+	if(alg==4)
1057
+		idx->last = (hash+1) % idx->nr;
1055 1058
 	
1056 1059
 	LM_DBG("selected [%d-%d/%d] <%.*s>\n", alg, set, hash,
1057 1060
 			idx->dlist[hash].uri.len, idx->dlist[hash].uri.s);