Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 6c8b4c6

Browse files
committed
modules/console: send error packet
In case of unknown packet type, send an error packet. If unhandled (which is the most common case) the flow will emit a warning. Adapted from a patch by Tomaz Canabrava. Signed-off-by: Caio Marcelo de Oliveira Filho <[email protected]>
1 parent 3692259 commit 6c8b4c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/modules/flow/console/console.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ console_in_process(struct sol_flow_node *node, void *data, uint16_t port, uint16
137137
fprintf(mdata->fp, "%s#%02x (error)%s - %s\n",
138138
mdata->prefix, code, mdata->suffix, msg ? : "");
139139
} else {
140-
SOL_WRN("Unsupported packet=%p type=%p (%s)",
140+
sol_flow_send_error_packet(node, -EINVAL, "Unsupported packet=%p type=%p (%s)",
141141
packet, sol_flow_packet_get_type(packet), sol_flow_packet_get_type(packet)->name);
142-
return -EINVAL;
142+
return 0;
143143
}
144144

145145
if (mdata->flush)

0 commit comments

Comments
 (0)