diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2019-01-08 15:59:14 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2019-01-08 15:59:14 +0100 |
commit | 93a6bbfc58ec48c774ecf475ec7e58184504bbc4 (patch) | |
tree | 96a3688eb6ee3afc713fbce605f559e7dc2b3c12 /src/exchange-lib/testing_api_loop.c | |
parent | 00596e245eaa8a242769fc844c9d600e874bbfaa (diff) | |
download | exchange-93a6bbfc58ec48c774ecf475ec7e58184504bbc4.tar.gz exchange-93a6bbfc58ec48c774ecf475ec7e58184504bbc4.tar.bz2 exchange-93a6bbfc58ec48c774ecf475ec7e58184504bbc4.zip |
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.
Diffstat (limited to 'src/exchange-lib/testing_api_loop.c')
-rw-r--r-- | src/exchange-lib/testing_api_loop.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/exchange-lib/testing_api_loop.c b/src/exchange-lib/testing_api_loop.c index f81bb75c4..3e7e36432 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); |