diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2019-01-21 15:48:34 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2019-01-21 15:48:34 +0100 |
commit | c9eab0f5a5ceca381a330f38bc153b89c3892003 (patch) | |
tree | 93d09692a437c915f7595d228454a78b01ebc1b7 /src | |
parent | 544a8edc8cfd50fa716467302ba8996f18be808f (diff) |
Adapt serialized reconnect to use public cert_cb.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/testing_api_cmd_serialize_keys.c | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/src/lib/testing_api_cmd_serialize_keys.c b/src/lib/testing_api_cmd_serialize_keys.c index 38d32eadd..585c5cad8 100644 --- a/src/lib/testing_api_cmd_serialize_keys.c +++ b/src/lib/testing_api_cmd_serialize_keys.c @@ -98,6 +98,7 @@ serialize_keys_run (void *cls, (TALER_EXCHANGE_get_base_url (is->exchange)); TALER_EXCHANGE_disconnect (is->exchange); is->exchange = NULL; + is->working = GNUNET_NO; TALER_TESTING_interpreter_next (is); } @@ -155,36 +156,6 @@ serialize_keys_traits (void *cls, index); } -/** - * /keys callback. Just checks HTTP status is OK, - * and step forward to next command. - * - * @param cls closure - * @param keys information about the various keys used - * by the exchange, NULL if /keys failed - * @param compat protocol compatibility information* - */ -static void -cb (void *cls, - const struct TALER_EXCHANGE_Keys *keys, - enum TALER_EXCHANGE_VersionCompatibility compat) -{ - struct ConnectWithStateState *cwss = cls; - - if (GNUNET_YES == cwss->consumed) - { - TALER_LOG_DEBUG ("Reconnection /keys 'cb' invoked already," - " nothing to do\n"); - return; - } - - cwss->consumed = GNUNET_YES; - if (NULL == keys) - TALER_TESTING_interpreter_fail (cwss->is); - - TALER_LOG_DEBUG ("reconnect next CMD\n"); - TALER_TESTING_interpreter_next (cwss->is); -} /** * Run the command. @@ -203,6 +174,12 @@ connect_with_state_run (void *cls, const json_t *serialized_keys; const char *exchange_url; + + /* This command usually gets rescheduled after serialized + * reconnection. */ + if (GNUNET_YES == cwss->consumed) + TALER_TESTING_interpreter_next (is); + cwss->is = is; state_cmd = TALER_TESTING_interpreter_lookup_command (is, cwss->state_reference); @@ -234,11 +211,13 @@ connect_with_state_run (void *cls, is->exchange = TALER_EXCHANGE_connect (is->ctx, exchange_url, - cb, + TALER_TESTING_cert_cb, cwss, TALER_EXCHANGE_OPTION_DATA, serialized_keys, TALER_EXCHANGE_OPTION_END); + + cwss->consumed = GNUNET_YES; } |