exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit ae4b240ec29803be6bd56caecf8df413d7bf3851
parent e235945df9eefc32265053d8527f4bd15d47ab6d
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 13 Mar 2019 04:11:35 +0100

return proper error message instead of aborting, fix a few minor memory leaks in taler-exchange-benchmark

Diffstat:
Msrc/benchmark/benchmark.conf | 3+++
Msrc/benchmark/taler-exchange-benchmark.c | 38++++++++++++++++++++++++++++++--------
2 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/src/benchmark/benchmark.conf b/src/benchmark/benchmark.conf @@ -29,6 +29,9 @@ base_url = "http://localhost:8081/" # Keep it short so the test runs fast. lookahead_sign = 12 h +[auditor] +BASE_URL = "http://localhost:8085/" + [exchangedb-postgres] config = "postgres:///talercheck" diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c @@ -908,20 +908,42 @@ main (int argc, GNUNET_CONFIGURATION_iterate_sections (cfg, - pick_exchange_account_cb, + &pick_exchange_account_cb, &bank_details_section); - GNUNET_assert (NULL != bank_details_section); - GNUNET_assert - (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string + if (NULL == bank_details_section) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + _("Missing specification of bank account in configuration\n")); + return BAD_CONFIG_FILE; + } + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_string (cfg, bank_details_section, "url", - &exchange_payto_url)); + &exchange_payto_url)) + { + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + bank_details_section, + "url"); + GNUNET_free (bank_details_section); + return BAD_CONFIG_FILE; + } - GNUNET_assert - (TALER_EC_NONE == parse_payto (exchange_payto_url, - &exchange_bank_account)); + if (TALER_EC_NONE != + parse_payto (exchange_payto_url, + &exchange_bank_account)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + _("Malformed payto:// URL `%s' in configuration\n"), + exchange_payto_url); + GNUNET_free (exchange_payto_url); + GNUNET_free (bank_details_section); + return BAD_CONFIG_FILE; + } + GNUNET_free (exchange_payto_url); + GNUNET_free (bank_details_section); } if ( (MODE_EXCHANGE == mode) || (MODE_BOTH == mode) ) {