pnoltes commented on code in PR #470: URL: https://github.com/apache/celix/pull/470#discussion_r1377967375
########## bundles/pubsub/pubsub_protocol/pubsub_protocol_lib/src/pubsub_wire_protocol_common.c: ########## @@ -101,19 +101,17 @@ celix_status_t pubsubProtocol_encodeMetadata(pubsub_protocol_message_t* message, *bufferInOut = newBuffer; *bufferLengthInOut = newLength; } - const char* key; if (metadataSize == 0) { encoded = true; continue; } celix_status_t status = CELIX_SUCCESS; - CELIX_PROPERTIES_FOR_EACH(message->metadata.metadata, key) { - const char *val = celix_properties_get(message->metadata.metadata, key, ""); + CELIX_PROPERTIES_ITERATE(message->metadata.metadata, iter) { if (status == CELIX_SUCCESS) { - status = pubsubProtocol_addNetstringEntryToBuffer(*bufferInOut, *bufferLengthInOut, &offset, key); + status = pubsubProtocol_addNetstringEntryToBuffer(*bufferInOut, *bufferLengthInOut, &offset, iter.key); Review Comment: A value cannot be NULL (see previous comment) and a NULL value as key is also not accepted: ``` static celix_status_t celix_properties_createAndSetEntry(celix_properties_t* properties, const char* key, const char** strValue, const long* longValue, const double* doubleValue, const bool* boolValue, celix_version_t* versionValue) { if (!properties) { return CELIX_SUCCESS; // silently ignore } if (!key) { celix_err_push("Cannot set property with NULL key"); return CELIX_SUCCESS; // print error and ignore } ``` -- 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