Sfoglia il codice sorgente

Look for SA_EVT_EVENTID_LOST when receiving an event.

(Logical change 1.138)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@497 fd59a12c-fef9-0310-b244-a6a79926bd2f
Mark Haverkamp 21 anni fa
parent
commit
5bdbdd2235
1 ha cambiato i file con 13 aggiunte e 4 eliminazioni
  1. 13 4
      test/subscription.c

+ 13 - 4
test/subscription.c

@@ -270,10 +270,15 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 		dprintf("publisher name content: \"%s\"\n", 
 				publisher_name.value); 
 	}
-	if (evt_pat_get_array.patternsNumber > 0) {
-		if (strcmp(evt_pat_get_array.patterns[0].pattern, SA_EVT_LOST_EVENT) == 0) {
-			dprintf("*** Events have been dropped at %s",
-				ais_time_str(publish_time));
+
+	if (event_id == SA_EVT_EVENTID_LOST) {
+		dprintf("*** Events have been dropped at %s",
+			ais_time_str(publish_time));
+
+		if ((evt_pat_get_array.patternsNumber == 0)|| 
+			(strcmp(evt_pat_get_array.patterns[0].pattern, SA_EVT_LOST_EVENT) != 0)) {
+			dprintf("*** Received SA_EVT_EVENTID_LOST but pattern is wrong: %s\n",
+				evt_pat_get_array.patterns[0].pattern);
 		}
 	}
 	if (quiet < 2) {
@@ -286,6 +291,10 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 		}
 	}
 
+	if (event_id == SA_EVT_EVENTID_LOST) {
+		return;
+	}
+
 #ifdef TEST_EVENT_ORDER
 	for (idx = 0; idx < MAX_NODES; idx++) {
 		if (last_event_id[idx] == 0) {