From 93a6bbfc58ec48c774ecf475ec7e58184504bbc4 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 8 Jan 2019 15:59:14 +0100 Subject: 5136: fix multiple invocations of /keys callback. Basically, we allow such a callback to be invoked only once. Subsequent invocations (due to keys updates / whatever) cause the callback to simply return in a do-nothing fashion. Also: adding a /wire CMD - that uses /keys - after serilized keys have been loaded. --- src/exchange-lib/testing_api_loop.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/exchange-lib/testing_api_loop.c') diff --git a/src/exchange-lib/testing_api_loop.c b/src/exchange-lib/testing_api_loop.c index f81bb75c..3e7e3643 100644 --- a/src/exchange-lib/testing_api_loop.c +++ b/src/exchange-lib/testing_api_loop.c @@ -237,6 +237,8 @@ struct TALER_TESTING_Command TALER_TESTING_cmd_end (void) { static struct TALER_TESTING_Command cmd; + cmd.label = NULL; + return cmd; } @@ -269,13 +271,18 @@ interpreter_run (void *cls) if (NULL == cmd->label) { + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Running command END\n"); is->result = GNUNET_OK; GNUNET_SCHEDULER_shutdown (); return; } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Running command `%s'\n", cmd->label); + cmd->run (cmd->cls, cmd, is); @@ -293,10 +300,16 @@ do_shutdown (void *cls) { struct TALER_TESTING_Interpreter *is = cls; struct TALER_TESTING_Command *cmd; + const char *label; + + label = is->commands[is->ip].label; + if (NULL == label) + label = "END"; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Executing shutdown at `%s'\n", - is->commands[is->ip].label); + label); + for (unsigned int j=0;NULL != (cmd = &is->commands[j])->label;j++) cmd->cleanup (cmd->cls, cmd); -- cgit v1.2.3