This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a commit to branch
feature/685-update-container-config-properties-usage
in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to
refs/heads/feature/685-update-container-config-properties-usage by this push:
new 55b3ae817 gh-685: Fix properties encoding usage in rsa shm
55b3ae817 is described below
commit 55b3ae81784151f31c0aad1f367783e214f46430
Author: Pepijn Noltes <[email protected]>
AuthorDate: Thu May 30 20:09:04 2024 +0200
gh-685: Fix properties encoding usage in rsa shm
---
.../remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_client.c | 8 ++++++--
.../remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_server.c | 6 +++---
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git
a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_client.c
b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_client.c
index 7c236f7a8..aa5a480b5 100644
---
a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_client.c
+++
b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_client.c
@@ -278,8 +278,12 @@ celix_status_t
rsaShmClientManager_sendMsgTo(rsa_shm_client_manager_t *clientMan
return CELIX_ERROR_MAKE(CELIX_FACILITY_CERRNO, errno);
}
if (metadata != NULL) {
- CELIX_PROPERTIES_ITERATE(metadata, iter) {
- fprintf(fp,"%s=%s\n", iter.key, iter.entry.value);
+ status = celix_properties_saveToStream(metadata, fp, 0);
+ if (status != CELIX_SUCCESS) {
+ celix_logHelper_error(
+ clientManager->logHelper, "RsaShmClient: Error encoding
metadata to memory stream. %d.", status);
+ celix_logHelper_logTssErrors(clientManager->logHelper,
CELIX_LOG_LEVEL_ERROR);
+ return status;
}
}
fclose(fp);
diff --git
a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_server.c
b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_server.c
index 4a8da5240..aaebbb368 100644
---
a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_server.c
+++
b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/src/rsa_shm_server.c
@@ -167,7 +167,7 @@ static void
rsaShmServer_terminateMsgHandling(rsa_shm_msg_control_t *ctrl) {
static void rsaShmServer_msgHandlingWork(void *data) {
assert(data != NULL);
- int status = CELIX_SUCCESS;
+ int status = CELIX_SUCCESS;
struct rsa_shm_server_thpool_work_data *workData = data;
rsa_shm_server_t *server = workData->server;
assert(server != NULL);
@@ -179,9 +179,9 @@ static void rsaShmServer_msgHandlingWork(void *data) {
celix_properties_t *metadataProps = NULL;
if (workData->metadataSize != 0) {
- metadataProps = celix_properties_loadFromString(metaDataString);
- if (metadataProps == NULL) {
+ if (celix_properties_loadFromString(metaDataString, 0, &metadataProps)
!= CELIX_SUCCESS) {
celix_logHelper_warning(server->loghelper, "RsaShmServer: Parse
metadata failed.");
+ celix_logHelper_logTssErrors(server->loghelper,
CELIX_LOG_LEVEL_WARNING);
}
}