Browse code

- fixed unnecessary error log when all contacts are filtered out - for multiple contacts with the same q, keep the received order. Closes 1570957.

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

Bogdan-Andrei Iancu authored on 21/11/2006 12:13:00
Showing 1 changed files
... ...
@@ -147,7 +147,7 @@ static int sort_contacts(contact_t *ct_list, contact_t **ct_array,
147 147
 		/*insert the contact into the sorted array */
148 148
 		for(i=0;i<n;i++) {
149 149
 			/* keep in mind that the contact list is reversts */
150
-			if (q_array[i]<q)
150
+			if (q_array[i]<=q)
151 151
 				continue;
152 152
 			break;
153 153
 		}
... ...
@@ -260,6 +260,11 @@ static int shmcontact2dset(struct sip_msg *req, struct sip_msg *sh_rpl,
260 260
 		goto restore;
261 261
 	}
262 262
 	n = sort_contacts( contacts, scontacts, sqvalues);
263
+	if (n==0) {
264
+		DBG("DEBUG:uac_redirect:shmcontact2dset: no contacts left "
265
+			"after filtering\n");
266
+		goto restore;
267
+	}
263 268
 
264 269
 	/* to many branches ? */
265 270
 	if (max!=-1 && n>max)