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


##########
bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_import_registration.c:
##########
@@ -63,34 +64,16 @@ celix_status_t 
importRegistration_create(celix_bundle_context_t *context,
     import->rpcFac = NULL;
     import->proxySvcId = -1;
 
-    const char *serviceImportedConfigs = 
celix_properties_get(endpointDesc->properties,
-            OSGI_RSA_SERVICE_IMPORTED_CONFIGS, NULL);
-    if (serviceImportedConfigs == NULL) {
-        celix_logHelper_error(logHelper,"RSA import reg: 
service.imported.configs property is not exist.");
-        return CELIX_ILLEGAL_ARGUMENT;
-    }
-    char *rsaRpcType = NULL;
-    celix_autofree char *icCopy = strdup(serviceImportedConfigs);
-    const char delimiter[2] = ",";
-    char *token, *savePtr;
-    token = strtok_r(icCopy, delimiter, &savePtr);
-    while (token != NULL) {
-        rsaRpcType = celix_utils_trimInPlace(token);
-        if (strncmp(rsaRpcType, RSA_RPC_TYPE_PREFIX, 
sizeof(RSA_RPC_TYPE_PREFIX) - 1) == 0) {
-            break;
-        }
-        rsaRpcType = NULL;
-        token = strtok_r(NULL, delimiter, &savePtr);
-    }
-    if (rsaRpcType == NULL) {
-        celix_logHelper_error(logHelper,"RSA import reg: %s property is not 
exist.", RSA_RPC_TYPE_KEY);
+    const char *rsaShmRpcType = celix_properties_get(endpointDesc->properties, 
RSA_SHM_RPC_TYPE_KEY, NULL);
+    if (rsaShmRpcType == NULL) {
+        celix_logHelper_error(logHelper,"RSA import reg: %s property is not 
exist.", RSA_SHM_RPC_TYPE_KEY);
         return CELIX_ILLEGAL_ARGUMENT;
     }
 
     char filter[128] = {0};
-    int bytes = snprintf(filter, sizeof(filter), "(%s=%s)", RSA_RPC_TYPE_KEY, 
rsaRpcType);
+    int bytes = snprintf(filter, sizeof(filter), "(%s=%s)", RSA_RPC_TYPE_KEY, 
rsaShmRpcType);
     if (bytes >= sizeof(filter)) {
-     celix_logHelper_error(logHelper,"RSA import reg: The value(%s) of %s is 
too long.", rsaRpcType, RSA_RPC_TYPE_KEY);
+     celix_logHelper_error(logHelper,"RSA import reg: The value(%s) of %s is 
too long.", rsaShmRpcType, RSA_RPC_TYPE_KEY);

Review Comment:
   nitpick: incorrect indentation



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