When ipc-inject injects a message, it uses ipc_endpoint_publish()
to re-publish it in its entirety, including the wrapper it was
received in, causing it to be double-wrapped.
This commit modifies ipc-inject so that it re-publishes only the
data of the received message, instead of the entire message.
handle_ipc_message() {
local endpoint="$1"
- local data="$2"
+ local message="$2"
local topic
+ local data
- if ! topic=$(ipc_msg_get_topic "$data"); then
+ if ! topic=$(ipc_msg_get_topic "$message"); then
log_warn "Dropping message without topic"
return 1
fi
+ if ! data=$(ipc_msg_get_data "$message"); then
+ log_warn "Dropping message without data"
+ return 1
+ fi
+
if ! ipc_endpoint_publish "$endpoint" "$topic" "$data"; then
log_error "Could not publish message for $topic on $endpoint"
return 1