force TALER_EXCHANGE_connect() va-list to be actually provided

This commit is contained in:
Christian Grothoff 2018-08-19 12:22:42 +02:00
parent 433fab96c9
commit 6982ccd78b
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
5 changed files with 25 additions and 19 deletions

View File

@ -1,6 +1,6 @@
/*
This file is part of TALER
Copyright (C) 2014-2017 GNUnet e.V.
Copyright (C) 2014-2018 GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@ -117,6 +117,12 @@ struct TALER_EXCHANGE_Handle
*/
struct GNUNET_SCHEDULER_Task *retry_task;
/**
* Raw key data of the exchange, only valid if
* @e handshake_complete is past stage #MHS_CERT.
*/
json_t *key_data_raw;
/**
* Key data of the exchange, only valid if
* @e handshake_complete is past stage #MHS_CERT.
@ -133,12 +139,6 @@ struct TALER_EXCHANGE_Handle
*/
struct GNUNET_TIME_Absolute key_data_expiration;
/**
* Raw key data of the exchange, only valid if
* @e handshake_complete is past stage #MHS_CERT.
*/
json_t *key_data_raw;
/**
* Stage of the exchange's initialization routines.
*/
@ -801,7 +801,7 @@ TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange,
if ( (GNUNET_NO == force_download) &&
(0 < GNUNET_TIME_absolute_get_remaining (exchange->key_data_expiration).rel_value_us) )
return exchange->key_data_expiration;
if (NULL != exchange->retry_task)
if (NULL == exchange->retry_task)
exchange->retry_task = GNUNET_SCHEDULER_add_now (&request_keys,
exchange);
return GNUNET_TIME_UNIT_ZERO_ABS;
@ -1096,8 +1096,10 @@ header_cb (char *buffer,
return total;
}
/* ********************* public API ******************* */
/**
* Initialise a connection to the exchange. Will connect to the
* exchange and obtain information about the exchange's master public
@ -1121,7 +1123,12 @@ TALER_EXCHANGE_connect (struct GNUNET_CURL_Context *ctx,
...)
{
struct TALER_EXCHANGE_Handle *exchange;
va_list ap;
va_start (ap, cert_cb_cls);
GNUNET_assert (TALER_EXCHANGE_OPTION_END ==
va_arg (ap, int));
va_end (ap);
exchange = GNUNET_new (struct TALER_EXCHANGE_Handle);
exchange->ctx = ctx;
exchange->url = GNUNET_strdup (url);

View File

@ -3821,7 +3821,8 @@ run (void *cls)
fakebank = TALER_FAKEBANK_start (8082);
exchange = TALER_EXCHANGE_connect (ctx,
"http://localhost:8081",
&cert_cb, is,
&cert_cb,
is,
TALER_EXCHANGE_OPTION_END);
GNUNET_assert (NULL != exchange);
timeout_task

View File

@ -597,13 +597,15 @@ run (void *cls)
rc = GNUNET_CURL_gnunet_rc_create (ctx);
exchange = TALER_EXCHANGE_connect (ctx,
"http://localhost:8081",
&cert_cb, is,
&cert_cb,
is,
TALER_EXCHANGE_OPTION_END);
GNUNET_assert (NULL != exchange);
timeout_task
= GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 300),
&do_timeout, NULL);
&do_timeout,
NULL);
GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
is);
}

View File

@ -63,28 +63,22 @@ run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct TALER_TESTING_Command commands[] = {
/* Trigger keys reloading from disk. */
TALER_TESTING_cmd_signal ("signal-reaction-1",
is->exchanged,
SIGUSR1),
TALER_TESTING_cmd_check_keys ("check-keys-1",
1,
4,
is->exchange),
/* 1st keyup happens at start-up */
TALER_TESTING_cmd_exec_keyup ("keyup-2",
TALER_TESTING_cmd_exec_keyup ("keyup-2",
CONFIG_FILE_EXTENDED),
TALER_TESTING_cmd_exec_auditor_sign ("sign-keys-1",
CONFIG_FILE),
TALER_TESTING_cmd_signal ("trigger-keys-reload-1",
is->exchanged,
SIGUSR1),
TALER_TESTING_cmd_check_keys ("check-keys-2",
2,
#if TALER_EXCHANGE_API_DISABLE_CHERRYPICKING
@ -99,6 +93,7 @@ run (void *cls,
TALER_TESTING_run (is, commands);
}
int
main (int argc,
char * const *argv)

View File

@ -657,7 +657,8 @@ main_wrapper_exchange_connect (void *cls)
(is->exchange = TALER_EXCHANGE_connect (is->ctx,
exchange_url,
&cert_cb,
main_ctx)));
main_ctx,
TALER_EXCHANGE_OPTION_END)));
GNUNET_free (exchange_url);
GNUNET_CONFIGURATION_destroy (cfg);
}