From dev-return-1816-apmail-celix-dev-archive=celix.apache.org@celix.apache.org Tue Mar 31 13:51:18 2020 Return-Path: X-Original-To: apmail-celix-dev-archive@www.apache.org Delivered-To: apmail-celix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id E52F419AF5 for ; Tue, 31 Mar 2020 13:51:17 +0000 (UTC) Received: (qmail 37996 invoked by uid 500); 31 Mar 2020 13:51:17 -0000 Delivered-To: apmail-celix-dev-archive@celix.apache.org Received: (qmail 37981 invoked by uid 500); 31 Mar 2020 13:51:17 -0000 Mailing-List: contact dev-help@celix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@celix.apache.org Delivered-To: mailing list dev@celix.apache.org Received: (qmail 37961 invoked by uid 99); 31 Mar 2020 13:51:17 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2020 13:51:17 +0000 From: GitBox To: dev@celix.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bcelix=5D_abroekhuis_commented_on_a_change_in_pu?= =?utf-8?q?ll_request_=23181=3A_Updated_ZMQ_implementation_to_use_NULL_if_?= =?utf-8?q?scope_is_not_set=2E_Only_when=E2=80=A6?= Message-ID: <158566267732.8041.15197599668744656019.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Tue, 31 Mar 2020 13:51:17 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: users@infra.apache.org With regards, Apache Git Services