PengZheng commented on code in PR #710:
URL: https://github.com/apache/celix/pull/710#discussion_r1443934898


##########
bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c:
##########
@@ -1016,7 +1080,27 @@ static celix_status_t remoteServiceAdmin_send(void 
*handle, endpoint_description
         if (rsa->curlShareEnabled) {
             curl_easy_setopt(curl, CURLOPT_SHARE, rsa->curlShare);
         }
-        res = curl_easy_perform(curl);
+        if (ipAddressMap == NULL || celix_stringHashMap_size(ipAddressMap) == 
0) {//no zeroconf addresses found, use org.amdatu.remote.admin.http.url
+            curl_easy_setopt(curl, CURLOPT_URL, url);
+            res = curl_easy_perform(curl);
+        } else {
+            const char *port = 
celix_properties_get(endpointDescription->properties, (char*) 
CELIX_RSA_DFI_ZEROCONF_ENDPOINT_PORT, "");
+            const char *path = 
celix_properties_get(endpointDescription->properties, (char*) 
CELIX_RSA_DFI_ZEROCONF_ENDPOINT_PATH, "");
+            CELIX_STRING_HASH_MAP_ITERATE(ipAddressMap, iter) {
+                const char *ip = iter.key;
+                bool ipv4 = iter.value.boolValue;
+                if (ipv4) {
+                    snprintf(url, sizeof(url), "http://%s:%s%s";, ip, port, 
path);

Review Comment:
   IP should be dealt within service discovery, RSA should only deal with URL.



-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to