Browse code

dmq: check for duplicate nodes when multi_notify enabled

- also avoids adding self if we are one of the resolved IPs

Charles Chance authored on 21/04/2015 21:13:19
Showing 1 changed files
... ...
@@ -315,9 +315,11 @@ dmq_node_t* add_server_and_notify(str *paddr)
315 315
 		for (index = 0; index < host_cnt; index++) {
316 316
 			pstr->s = puri_list [index];
317 317
 			pstr->len = strlen (puri_list [index]);
318
-			pnode = add_dmq_node (node_list, pstr);
319
-			if (pnode && !pfirst)
320
-				{ pfirst = pnode; }
318
+			if (!find_dmq_node_uri(node_list, pstr)) { // check for duplicates
319
+				pnode = add_dmq_node (node_list, pstr);
320
+				if (pnode && !pfirst)
321
+					{ pfirst = pnode; }
322
+			}
321 323
 		}
322 324
 	}
323 325