Sfoglia il codice sorgente

Async open and subscribe needed to check for registered call back
functions and retrun an error if there were no assocated callbacks.

(Logical change 1.159)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@551 fd59a12c-fef9-0310-b244-a6a79926bd2f

Mark Haverkamp 21 anni fa
parent
commit
9da13b631e
1 ha cambiato i file con 18 aggiunte e 0 eliminazioni
  1. 18 0
      lib/evt.c

+ 18 - 0
lib/evt.c

@@ -956,6 +956,15 @@ saEvtChannelOpenAsync(SaEvtHandleT evtHandle,
 		goto chan_open_done;
 	}
 
+	/*
+	 * Make sure that an open channel callback has been 
+	 * registered before  allowing the open to continue.
+	 */
+	if (!evti->ei_callback.saEvtChannelOpenCallback) {
+		error = SA_AIS_ERR_INIT;
+		goto chan_open_put;
+	}
+
 	/*
 	 * create a handle for this open channel
 	 */
@@ -1709,6 +1718,15 @@ saEvtEventSubscribe(
 		goto subscribe_put1;
 	}
 
+	/*
+	 * Make sure that a deliver callback has been 
+	 * registered before  allowing the subscribe to continue.
+	 */
+	if (!evti->ei_callback.saEvtEventDeliverCallback) {
+		error = SA_AIS_ERR_INIT;
+		goto subscribe_put2;
+	}
+
 	/*
 	 * See if we can subscribe to this channel
 	 */