diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-06-06 22:40:33 +0200 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-06-06 22:40:33 +0200 |
commit | 8c120f30f4a0310a18053e16aa734c1ad78ba5cd (patch) | |
tree | c549a5254f7fdcb29ef15250a0dd102568c12147 /src/benchmark/taler-exchange-benchmark.c | |
parent | 2f6c57f35150481d214fb393073bc0d2fc3e2e92 (diff) |
fixing segfault when shutting down benchmark, but now it hangs..
Diffstat (limited to 'src/benchmark/taler-exchange-benchmark.c')
-rw-r--r-- | src/benchmark/taler-exchange-benchmark.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c index 4202e72e4..5b4f1f5ef 100644 --- a/src/benchmark/taler-exchange-benchmark.c +++ b/src/benchmark/taler-exchange-benchmark.c @@ -177,7 +177,7 @@ static struct TALER_MerchantPrivateKeyP merchant_priv; * Large enough value to allow having 12 coins per reserve without parsing * /keys in the first place */ -#define RESERVE_AMOUNT "KUDOS:1000" +#define RESERVE_AMOUNT "PUDOS:1000" /** * Probability a coin can be spent @@ -226,6 +226,7 @@ deposit_cb (void *cls, unsigned int coin_index = (unsigned int) cls; + coins[coin_index].dh = NULL; if (MHD_HTTP_OK != http_status) { fail ("At least one coin has not been deposited, status: %d\n"); @@ -238,6 +239,7 @@ deposit_cb (void *cls, /** * Function called upon completion of our /reserve/withdraw request. + * This is merely the function which spends withdrawn coins * * @param cls closure with the interpreter state * @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request @@ -254,6 +256,7 @@ reserve_withdraw_cb (void *cls, unsigned int coin_index = (unsigned int) cls; + coins[coin_index].wsh = NULL; if (MHD_HTTP_OK != http_status) fail ("At least one coin has not correctly been withdrawn\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%d-th coin withdrawn\n", coin_index); @@ -501,21 +504,7 @@ do_shutdown (void *cls) { unsigned int i; - if (NULL != exchange) - { - TALER_EXCHANGE_disconnect (exchange); - exchange = NULL; - } - if (NULL != ctx) - { - GNUNET_CURL_fini (ctx); - ctx = NULL; - } - if (NULL != rc) - { - GNUNET_CURL_gnunet_rc_destroy (rc); - rc = NULL; - } + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "shutting down..\n"); /** * WARNING: all the non NULL handles must correspond to non completed @@ -551,6 +540,24 @@ do_shutdown (void *cls) GNUNET_free_non_null (reserves); GNUNET_free_non_null (coins); GNUNET_free_non_null (spent_coins); + + if (NULL != exchange) + { + TALER_EXCHANGE_disconnect (exchange); + exchange = NULL; + } + if (NULL != ctx) + { + GNUNET_CURL_fini (ctx); + ctx = NULL; + } + if (NULL != rc) + { + GNUNET_CURL_gnunet_rc_destroy (rc); + rc = NULL; + } + + } /** |