abroekhuis commented on a change in pull request #181: Updated ZMQ 
implementation to use NULL if scope is not set. Only when…
URL: https://github.com/apache/celix/pull/181#discussion_r400929707
 
 

 ##########
 File path: bundles/pubsub/pubsub_admin_zmq/src/pubsub_zmq_admin.c
 ##########
 @@ -667,13 +667,17 @@ static celix_status_t 
pubsub_zmqAdmin_connectEndpointToReceiver(pubsub_zmq_admin
         const char *eSerializer = celix_properties_get(endpoint, 
PUBSUB_ENDPOINT_SERIALIZER, NULL);
         const char *eProtocol = celix_properties_get(endpoint, 
PUBSUB_ENDPOINT_PROTOCOL, NULL);
 
-        if (scope != NULL && topic != NULL && serializer != NULL && protocol 
!= NULL
-                        && eScope != NULL && eTopic != NULL && eSerializer != 
NULL && eProtocol != NULL
-                        && strncmp(eScope, scope, 1024*1024) == 0
+        if (topic != NULL && serializer != NULL && protocol != NULL
+                        && eTopic != NULL && eSerializer != NULL && eProtocol 
!= NULL
                         && strncmp(eTopic, topic, 1024*1024) == 0
                         && strncmp(eSerializer, serializer, 1024*1024) == 0
                         && strncmp(eProtocol, protocol, 1024*1024) == 0) {
-            pubsub_zmqTopicReceiver_connectTo(receiver, url);
+            // Scope is not required
+            if (scope == NULL && eScope == NULL) {
+                pubsub_zmqTopicReceiver_connectTo(receiver, url);
+            } else if (scope != NULL && eScope != NULL && strncmp(scope, 
eScope, 1024*1024) == 0) {
+                pubsub_zmqTopicReceiver_connectTo(receiver, url);
+            }
 
 Review comment:
   Not needed, since a discovered endpoint might not have a user, and as such, 
no receiver.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to