From c0b0b623053f16790d7d675812befe382ebdfd6e Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 16 Dec 2017 01:12:35 +0100 Subject: ctrl: on parse errors, return a detailed message to sender The recently added ctrl_cmd_parse2() returns non-NULL cmd with error messages upon parsing errors. In handle_control_read(), use ctrl_cmd_parse2() and send those back to the CTRL command sender as reply. Retain the previous "Command parser error" reply only in case ctrl_cmd_parse2() should return NULL, which shouldn't actually happen at all. Change-Id: Ie35a02555b76913bb12734a76fc40fde7ffb244d --- tests/ctrl/ctrl_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/ctrl/ctrl_test.c') diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c index b1d4f237..39ec61a8 100644 --- a/tests/ctrl/ctrl_test.c +++ b/tests/ctrl/ctrl_test.c @@ -76,7 +76,7 @@ static void assert_test(struct ctrl_handle *ctrl, struct ctrl_connection *ccon, printf("test: '%s'\n", osmo_escape_str(t->cmd_str, -1)); printf("parsing:\n"); - cmd = ctrl_cmd_parse(ctx, msg); + cmd = ctrl_cmd_parse2(ctx, msg); OSMO_ASSERT(cmd); OSMO_ASSERT(t->expect_parsed.type == cmd->type); -- cgit v1.2.3