removing dead code, using more named constants, checking return values better
This commit is contained in:
parent
c11475c081
commit
113f3891d1
@ -232,7 +232,7 @@ signal_loop (void)
|
|||||||
}
|
}
|
||||||
if (EINTR == errno)
|
if (EINTR == errno)
|
||||||
{
|
{
|
||||||
ret = 2;
|
/* ignore, do the loop again */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
switch (c)
|
switch (c)
|
||||||
|
@ -772,7 +772,7 @@ get_denomination_info_by_hash (const struct GNUNET_HashCode *dh,
|
|||||||
NULL);
|
NULL);
|
||||||
if (qs <= 0)
|
if (qs <= 0)
|
||||||
{
|
{
|
||||||
if (0 == qs)
|
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Denomination %s not found\n",
|
"Denomination %s not found\n",
|
||||||
TALER_B2S (dh));
|
TALER_B2S (dh));
|
||||||
@ -3774,10 +3774,10 @@ refresh_session_cb (void *cls,
|
|||||||
cc->qs = qs;
|
cc->qs = qs;
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
qs = check_known_coin (coin_pub,
|
||||||
check_known_coin (coin_pub,
|
|
||||||
denom_pub,
|
denom_pub,
|
||||||
amount_with_fee))
|
amount_with_fee);
|
||||||
|
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
|
||||||
{
|
{
|
||||||
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
|
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
|
||||||
cc->qs = qs;
|
cc->qs = qs;
|
||||||
@ -4152,10 +4152,10 @@ deposit_cb (void *cls,
|
|||||||
cc->qs = qs;
|
cc->qs = qs;
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
qs = check_known_coin (coin_pub,
|
||||||
check_known_coin (coin_pub,
|
|
||||||
denom_pub,
|
denom_pub,
|
||||||
amount_with_fee))
|
amount_with_fee);
|
||||||
|
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
|
||||||
{
|
{
|
||||||
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
|
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
|
||||||
cc->qs = qs;
|
cc->qs = qs;
|
||||||
|
@ -405,6 +405,7 @@ update_fees (struct WireAccount *wa,
|
|||||||
&p->master_sig);
|
&p->master_sig);
|
||||||
if (qs < 0)
|
if (qs < 0)
|
||||||
{
|
{
|
||||||
|
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
|
||||||
TALER_EXCHANGEDB_fees_free (wa->af);
|
TALER_EXCHANGEDB_fees_free (wa->af);
|
||||||
wa->af = NULL;
|
wa->af = NULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -854,10 +855,9 @@ deposit_cb (void *cls,
|
|||||||
au->session);
|
au->session);
|
||||||
if (NULL == af)
|
if (NULL == af)
|
||||||
{
|
{
|
||||||
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
qs = GNUNET_DB_STATUS_HARD_ERROR;
|
"Could not get or persist wire fees. Aborting run.\n");
|
||||||
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
|
return GNUNET_DB_STATUS_HARD_ERROR;
|
||||||
return qs;
|
|
||||||
}
|
}
|
||||||
au->wire_fee = af->wire_fee;
|
au->wire_fee = af->wire_fee;
|
||||||
}
|
}
|
||||||
|
@ -615,6 +615,8 @@ handle_mhd_request (void *cls,
|
|||||||
/* strange, should start with '/', treat as just "/" */
|
/* strange, should start with '/', treat as just "/" */
|
||||||
url = "/";
|
url = "/";
|
||||||
start = strchr (url + 1, '/');
|
start = strchr (url + 1, '/');
|
||||||
|
if (NULL == start)
|
||||||
|
start = "";
|
||||||
ret = proceed_with_handler (ecls->rh,
|
ret = proceed_with_handler (ecls->rh,
|
||||||
connection,
|
connection,
|
||||||
start,
|
start,
|
||||||
|
@ -2338,7 +2338,7 @@ TEH_KS_sign (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
|
|||||||
/* This *can* happen if the exchange's keys are
|
/* This *can* happen if the exchange's keys are
|
||||||
not properly maintained. */
|
not properly maintained. */
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
_ ("Cannot sign request, no valid keys available\n"));
|
"Cannot sign request, no valid keys available\n");
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
*pub = key_state->current_sign_key_issue.issue.signkey_pub;
|
*pub = key_state->current_sign_key_issue.issue.signkey_pub;
|
||||||
|
@ -434,7 +434,7 @@ track_transfer_transaction (void *cls,
|
|||||||
if (0 >= qs)
|
if (0 >= qs)
|
||||||
{
|
{
|
||||||
if ( (GNUNET_DB_STATUS_HARD_ERROR == qs) ||
|
if ( (GNUNET_DB_STATUS_HARD_ERROR == qs) ||
|
||||||
(GNUNET_DB_STATUS_SUCCESS_NO_RESULTS) )
|
(GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) )
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
*mhd_ret = TALER_MHD_reply_with_error (connection,
|
*mhd_ret = TALER_MHD_reply_with_error (connection,
|
||||||
|
@ -403,7 +403,7 @@ load_terms (struct TALER_MHD_Legal *legal,
|
|||||||
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"fstat",
|
"fstat",
|
||||||
fn);
|
fn);
|
||||||
(void) close (fd);
|
GNUENT_break (0 == close (fd));
|
||||||
GNUNET_free (fn);
|
GNUNET_free (fn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ load_terms (struct TALER_MHD_Legal *legal,
|
|||||||
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"fstat-size",
|
"fstat-size",
|
||||||
fn);
|
fn);
|
||||||
(void) close (fd);
|
GNUNET_break (0 == close (fd));
|
||||||
GNUNET_free (fn);
|
GNUNET_free (fn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -427,7 +427,7 @@ load_terms (struct TALER_MHD_Legal *legal,
|
|||||||
{
|
{
|
||||||
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"malloc");
|
"malloc");
|
||||||
(void) close (fd);
|
GNUNET_break (0 == close (fd));
|
||||||
GNUNET_free (fn);
|
GNUNET_free (fn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -440,12 +440,12 @@ load_terms (struct TALER_MHD_Legal *legal,
|
|||||||
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
|
||||||
"read",
|
"read",
|
||||||
fn);
|
fn);
|
||||||
(void) close (fd);
|
GNUNET_break (0 == close (fd));
|
||||||
GNUNET_free (buf);
|
GNUNET_free (buf);
|
||||||
GNUNET_free (fn);
|
GNUNET_free (fn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
(void) close (fd);
|
GNUNET_break (0 == close (fd));
|
||||||
GNUNET_free (fn);
|
GNUNET_free (fn);
|
||||||
|
|
||||||
/* append to global list of terms of service */
|
/* append to global list of terms of service */
|
||||||
@ -501,7 +501,7 @@ load_language (struct TALER_MHD_Legal *legal,
|
|||||||
continue;
|
continue;
|
||||||
load_terms (legal, path, lang, fn);
|
load_terms (legal, path, lang, fn);
|
||||||
}
|
}
|
||||||
closedir (d);
|
GNUNET_break (0 == closedir (d));
|
||||||
GNUNET_free (dname);
|
GNUNET_free (dname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -577,7 +577,7 @@ TALER_MHD_legal_load (const struct GNUNET_CONFIGURATION_Handle *cfg,
|
|||||||
continue;
|
continue;
|
||||||
load_language (legal, path, lang);
|
load_language (legal, path, lang);
|
||||||
}
|
}
|
||||||
closedir (d);
|
GNUNET_break (0 == closedir (d));
|
||||||
GNUNET_free (path);
|
GNUNET_free (path);
|
||||||
return legal;
|
return legal;
|
||||||
}
|
}
|
||||||
|
@ -248,8 +248,6 @@ qconv_round_time (void *cls,
|
|||||||
GNUNET_assert (sizeof (struct GNUNET_TIME_AbsoluteNBO) == data_len);
|
GNUNET_assert (sizeof (struct GNUNET_TIME_AbsoluteNBO) == data_len);
|
||||||
GNUNET_assert (scratch_length > 0);
|
GNUNET_assert (scratch_length > 0);
|
||||||
GNUNET_break (NULL == cls);
|
GNUNET_break (NULL == cls);
|
||||||
if (1 != param_length)
|
|
||||||
return -1;
|
|
||||||
tmp = *at;
|
tmp = *at;
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
GNUNET_TIME_round_abs (&tmp));
|
GNUNET_TIME_round_abs (&tmp));
|
||||||
@ -316,8 +314,6 @@ qconv_round_time_abs (void *cls,
|
|||||||
GNUNET_assert (1 == param_length);
|
GNUNET_assert (1 == param_length);
|
||||||
GNUNET_assert (sizeof (struct GNUNET_TIME_AbsoluteNBO) == data_len);
|
GNUNET_assert (sizeof (struct GNUNET_TIME_AbsoluteNBO) == data_len);
|
||||||
GNUNET_break (NULL == cls);
|
GNUNET_break (NULL == cls);
|
||||||
if (1 != param_length)
|
|
||||||
return -1;
|
|
||||||
tmp = GNUNET_TIME_absolute_ntoh (*at);
|
tmp = GNUNET_TIME_absolute_ntoh (*at);
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
GNUNET_TIME_round_abs (&tmp));
|
GNUNET_TIME_round_abs (&tmp));
|
||||||
|
@ -430,7 +430,6 @@ TALER_TESTING_prepare_fakebank (const char *config_filename,
|
|||||||
GNUNET_CONFIGURATION_destroy (cfg);
|
GNUNET_CONFIGURATION_destroy (cfg);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
bc->exchange_auth.method = TALER_BANK_AUTH_NONE;
|
|
||||||
{
|
{
|
||||||
char *exchange_xtalerbank_account;
|
char *exchange_xtalerbank_account;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user