nicer reports
-fix leak -fix leaks
This commit is contained in:
parent
0c3f6dde25
commit
754c4ef24c
@ -253,7 +253,9 @@ static unsigned int num_invalid_coins;
|
|||||||
static int run_exchange;
|
static int run_exchange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables printing of "-" and "." to indicate progress.
|
* Enables printing of "C" and "W" to indicate progress (warm/cold)
|
||||||
|
* every 50 iterations. Also includes how long the iteration took,
|
||||||
|
* so we can see if it is stable.
|
||||||
*/
|
*/
|
||||||
static int be_verbose;
|
static int be_verbose;
|
||||||
|
|
||||||
@ -686,7 +688,7 @@ refresh_coin (struct Coin *coin)
|
|||||||
keys = TALER_EXCHANGE_get_keys (exchange);
|
keys = TALER_EXCHANGE_get_keys (exchange);
|
||||||
for (curr.value = COIN_VALUE >> 1; curr.value > 0; curr.value = curr.value >> 1)
|
for (curr.value = COIN_VALUE >> 1; curr.value > 0; curr.value = curr.value >> 1)
|
||||||
{
|
{
|
||||||
if (acc_value + curr.value <= coin->left.value)
|
while (acc_value + curr.value <= coin->left.value)
|
||||||
{
|
{
|
||||||
GNUNET_array_append (denoms,
|
GNUNET_array_append (denoms,
|
||||||
ndenoms,
|
ndenoms,
|
||||||
@ -710,6 +712,9 @@ refresh_coin (struct Coin *coin)
|
|||||||
dpks,
|
dpks,
|
||||||
&blob_size);
|
&blob_size);
|
||||||
invalidate_coin (coin);
|
invalidate_coin (coin);
|
||||||
|
GNUNET_array_grow (denoms,
|
||||||
|
ndenoms,
|
||||||
|
0);
|
||||||
GNUNET_array_grow (dpks,
|
GNUNET_array_grow (dpks,
|
||||||
ndenoms2,
|
ndenoms2,
|
||||||
0);
|
0);
|
||||||
@ -1091,10 +1096,22 @@ benchmark_run (void *cls)
|
|||||||
}
|
}
|
||||||
warm++;
|
warm++;
|
||||||
if ( be_verbose &&
|
if ( be_verbose &&
|
||||||
(0 == (warm % 10)) )
|
(0 == (warm % 50)) )
|
||||||
|
{
|
||||||
|
static struct GNUNET_TIME_Absolute last;
|
||||||
|
struct GNUNET_TIME_Relative duration;
|
||||||
|
|
||||||
|
if (0 != last.abs_value_us)
|
||||||
|
duration = GNUNET_TIME_absolute_get_duration (last);
|
||||||
|
else
|
||||||
|
duration = GNUNET_TIME_UNIT_FOREVER_REL;
|
||||||
|
last = GNUNET_TIME_absolute_get ();
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"%s",
|
"%s - %s\n",
|
||||||
WARM_THRESHOLD < warm ? "." : "-");
|
WARM_THRESHOLD < warm ? "WARM" : "COLD",
|
||||||
|
GNUNET_STRINGS_relative_time_to_string (duration,
|
||||||
|
GNUNET_YES));
|
||||||
|
}
|
||||||
if (WARM_THRESHOLD == warm)
|
if (WARM_THRESHOLD == warm)
|
||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
@ -1345,7 +1362,7 @@ do_shutdown (void *cls)
|
|||||||
num_deposit,
|
num_deposit,
|
||||||
num_refresh,
|
num_refresh,
|
||||||
GNUNET_STRINGS_relative_time_to_string (duration,
|
GNUNET_STRINGS_relative_time_to_string (duration,
|
||||||
GNUNET_NO));
|
GNUNET_YES));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1406,6 +1423,7 @@ run (void *cls)
|
|||||||
bank_details = json_load_file (bank_details_filename,
|
bank_details = json_load_file (bank_details_filename,
|
||||||
JSON_REJECT_DUPLICATES,
|
JSON_REJECT_DUPLICATES,
|
||||||
NULL);
|
NULL);
|
||||||
|
GNUNET_free (bank_details_filename);
|
||||||
if (NULL == bank_details)
|
if (NULL == bank_details)
|
||||||
{
|
{
|
||||||
fail ("Failed to parse file with BANK_DETAILS");
|
fail ("Failed to parse file with BANK_DETAILS");
|
||||||
@ -1426,6 +1444,7 @@ run (void *cls)
|
|||||||
merchant_details = json_load_file (merchant_details_filename,
|
merchant_details = json_load_file (merchant_details_filename,
|
||||||
JSON_REJECT_DUPLICATES,
|
JSON_REJECT_DUPLICATES,
|
||||||
NULL);
|
NULL);
|
||||||
|
GNUNET_free (merchant_details_filename);
|
||||||
if (NULL == merchant_details)
|
if (NULL == merchant_details)
|
||||||
{
|
{
|
||||||
fail ("Failed to parse file with MERCHANT_DETAILS");
|
fail ("Failed to parse file with MERCHANT_DETAILS");
|
||||||
|
@ -807,13 +807,14 @@ exchange_keys_update_cointype (void *cls,
|
|||||||
&denomkey_issue);
|
&denomkey_issue);
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_EXCHANGEDB_denomination_key_write (dkf,
|
TALER_EXCHANGEDB_denomination_key_write (dkf,
|
||||||
&denomkey_issue))
|
&denomkey_issue))
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"Failed to write denomination key information to file `%s'.\n",
|
"Failed to write denomination key information to file `%s'.\n",
|
||||||
dkf);
|
dkf);
|
||||||
*ret = GNUNET_SYSERR;
|
*ret = GNUNET_SYSERR;
|
||||||
GNUNET_CRYPTO_rsa_private_key_free (denomkey_issue.denom_priv.rsa_private_key);
|
GNUNET_CRYPTO_rsa_private_key_free (denomkey_issue.denom_priv.rsa_private_key);
|
||||||
|
GNUNET_CRYPTO_rsa_public_key_free (denomkey_issue.denom_pub.rsa_public_key);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( (NULL != auditor_output_file) &&
|
if ( (NULL != auditor_output_file) &&
|
||||||
@ -828,9 +829,12 @@ exchange_keys_update_cointype (void *cls,
|
|||||||
auditorrequestfile,
|
auditorrequestfile,
|
||||||
STRERROR (errno));
|
STRERROR (errno));
|
||||||
*ret = GNUNET_SYSERR;
|
*ret = GNUNET_SYSERR;
|
||||||
|
GNUNET_CRYPTO_rsa_private_key_free (denomkey_issue.denom_priv.rsa_private_key);
|
||||||
|
GNUNET_CRYPTO_rsa_public_key_free (denomkey_issue.denom_pub.rsa_public_key);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GNUNET_CRYPTO_rsa_private_key_free (denomkey_issue.denom_priv.rsa_private_key);
|
GNUNET_CRYPTO_rsa_private_key_free (denomkey_issue.denom_priv.rsa_private_key);
|
||||||
|
GNUNET_CRYPTO_rsa_public_key_free (denomkey_issue.denom_pub.rsa_public_key);
|
||||||
p.anchor = GNUNET_TIME_absolute_add (p.anchor,
|
p.anchor = GNUNET_TIME_absolute_add (p.anchor,
|
||||||
p.duration_spend);
|
p.duration_spend);
|
||||||
p.anchor = GNUNET_TIME_absolute_subtract (p.anchor,
|
p.anchor = GNUNET_TIME_absolute_subtract (p.anchor,
|
||||||
|
Loading…
Reference in New Issue
Block a user