diff options
Diffstat (limited to 'src/exchange')
8 files changed, 97 insertions, 97 deletions
diff --git a/src/exchange/taler-exchange-httpd_auditors.c b/src/exchange/taler-exchange-httpd_auditors.c index 62bfc304..f3c061e3 100644 --- a/src/exchange/taler-exchange-httpd_auditors.c +++ b/src/exchange/taler-exchange-httpd_auditors.c @@ -209,27 +209,22 @@ TEH_handler_auditors ( &awc.auditor_sig), GNUNET_JSON_spec_end () }; - enum GNUNET_DB_QueryStatus qs; MHD_RESULT res; - - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_json_data (connection, - root, - spec); - if (GNUNET_SYSERR == res) - return MHD_NO; /* hard failure */ - if (GNUNET_NO == res) - return MHD_YES; /* failure */ - } - - qs = TEH_DB_run_transaction (connection, - "add auditor denom sig", - &res, - &add_auditor_denom_sig, - &awc); - if (qs < 0) + enum GNUNET_GenericReturnValue ret; + + ret = TALER_MHD_parse_json_data (connection, + root, + spec); + if (GNUNET_SYSERR == ret) + return MHD_NO; /* hard failure */ + if (GNUNET_NO == ret) + return MHD_YES; /* failure */ + ret = TEH_DB_run_transaction (connection, + "add auditor denom sig", + &res, + &add_auditor_denom_sig, + &awc); + if (GNUNET_SYSERR == ret) return res; return TALER_MHD_reply_static ( connection, diff --git a/src/exchange/taler-exchange-httpd_db.h b/src/exchange/taler-exchange-httpd_db.h index bc127b27..7e73340b 100644 --- a/src/exchange/taler-exchange-httpd_db.h +++ b/src/exchange/taler-exchange-httpd_db.h @@ -73,7 +73,7 @@ typedef enum GNUNET_DB_QueryStatus * * @param connection MHD connection to run @a cb for, can be NULL * @param name name of the transaction (for debugging) - * @param[out] mhd_ret set to MHD response code, if transaction failed; + * @param[out] mhd_ret set to MHD response code, if transaction failed (returned #GNUNET_SYSERR); * NULL if we are not running with a @a connection and thus * must not queue MHD replies * @param cb callback implementing transaction logic diff --git a/src/exchange/taler-exchange-httpd_management_auditors.c b/src/exchange/taler-exchange-httpd_management_auditors.c index f69580ec..77e7d865 100644 --- a/src/exchange/taler-exchange-httpd_management_auditors.c +++ b/src/exchange/taler-exchange-httpd_management_auditors.c @@ -164,20 +164,16 @@ TEH_handler_management_auditors ( &aac.validity_start), GNUNET_JSON_spec_end () }; - enum GNUNET_DB_QueryStatus qs; MHD_RESULT res; - - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_json_data (connection, - root, - spec); - if (GNUNET_SYSERR == res) - return MHD_NO; /* hard failure */ - if (GNUNET_NO == res) - return MHD_YES; /* failure */ - } + enum GNUNET_GenericReturnValue ret; + + ret = TALER_MHD_parse_json_data (connection, + root, + spec); + if (GNUNET_SYSERR == ret) + return MHD_NO; /* hard failure */ + if (GNUNET_NO == ret) + return MHD_YES; /* failure */ if (GNUNET_OK != TALER_exchange_offline_auditor_add_verify ( &aac.auditor_pub, @@ -194,12 +190,12 @@ TEH_handler_management_auditors ( NULL); } - qs = TEH_DB_run_transaction (connection, - "add auditor", - &res, - &add_auditor, - &aac); - if (qs < 0) + ret = TEH_DB_run_transaction (connection, + "add auditor", + &res, + &add_auditor, + &aac); + if (GNUNET_SYSERR == ret) return res; return TALER_MHD_reply_static ( connection, diff --git a/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c b/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c index 7fb02283..382b0f6b 100644 --- a/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c +++ b/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c @@ -153,20 +153,16 @@ TEH_handler_management_auditors_AP_disable ( &dac.validity_end), GNUNET_JSON_spec_end () }; - enum GNUNET_DB_QueryStatus qs; MHD_RESULT res; - - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_json_data (connection, - root, - spec); - if (GNUNET_SYSERR == res) - return MHD_NO; /* hard failure */ - if (GNUNET_NO == res) - return MHD_YES; /* failure */ - } + enum GNUNET_GenericReturnValue ret; + + ret = TALER_MHD_parse_json_data (connection, + root, + spec); + if (GNUNET_SYSERR == ret) + return MHD_NO; /* hard failure */ + if (GNUNET_NO == ret) + return MHD_YES; /* failure */ if (GNUNET_OK != TALER_exchange_offline_auditor_del_verify ( auditor_pub, @@ -182,12 +178,12 @@ TEH_handler_management_auditors_AP_disable ( NULL); } - qs = TEH_DB_run_transaction (connection, - "del auditor", - &res, - &del_auditor, - &dac); - if (qs < 0) + ret = TEH_DB_run_transaction (connection, + "del auditor", + &res, + &del_auditor, + &dac); + if (GNUNET_SYSERR == ret) return res; return TALER_MHD_reply_static ( connection, diff --git a/src/exchange/taler-exchange-httpd_management_post_keys.c b/src/exchange/taler-exchange-httpd_management_post_keys.c index 4fb65d41..0e4eb989 100644 --- a/src/exchange/taler-exchange-httpd_management_post_keys.c +++ b/src/exchange/taler-exchange-httpd_management_post_keys.c @@ -336,7 +336,6 @@ TEH_handler_management_post_keys ( &signkey_sigs), GNUNET_JSON_spec_end () }; - enum GNUNET_DB_QueryStatus qs; bool ok; MHD_RESULT ret; @@ -444,16 +443,20 @@ TEH_handler_management_post_keys ( "Received %u denomination and %u signing key signatures\n", akc.nd_sigs, akc.ns_sigs); - qs = TEH_DB_run_transaction (connection, - "add keys", - &ret, - &add_keys, - &akc); - GNUNET_free (akc.d_sigs); - GNUNET_free (akc.s_sigs); - GNUNET_JSON_parse_free (spec); - if (qs < 0) - return ret; + { + enum GNUNET_GenericReturnValue res; + + res = TEH_DB_run_transaction (connection, + "add keys", + &ret, + &add_keys, + &akc); + GNUNET_free (akc.d_sigs); + GNUNET_free (akc.s_sigs); + GNUNET_JSON_parse_free (spec); + if (GNUNET_SYSERR == res) + return ret; + } TEH_keys_update_states (); return TALER_MHD_reply_static ( connection, diff --git a/src/exchange/taler-exchange-httpd_management_wire.c b/src/exchange/taler-exchange-httpd_management_wire.c index 83c3bbed..e3a31c1e 100644 --- a/src/exchange/taler-exchange-httpd_management_wire.c +++ b/src/exchange/taler-exchange-httpd_management_wire.c @@ -156,8 +156,6 @@ TEH_handler_management_denominations_wire ( &awc.validity_start), GNUNET_JSON_spec_end () }; - enum GNUNET_DB_QueryStatus qs; - MHD_RESULT ret; { enum GNUNET_GenericReturnValue res; @@ -213,13 +211,18 @@ TEH_handler_management_denominations_wire ( GNUNET_free (wire_method); } - qs = TEH_DB_run_transaction (connection, - "add wire", - &ret, - &add_wire, - &awc); - if (qs < 0) - return ret; + { + enum GNUNET_GenericReturnValue res; + MHD_RESULT ret; + + res = TEH_DB_run_transaction (connection, + "add wire", + &ret, + &add_wire, + &awc); + if (GNUNET_SYSERR == res) + return ret; + } TEH_wire_update_state (); return TALER_MHD_reply_static ( connection, diff --git a/src/exchange/taler-exchange-httpd_management_wire_disable.c b/src/exchange/taler-exchange-httpd_management_wire_disable.c index 67cf3015..0d446bca 100644 --- a/src/exchange/taler-exchange-httpd_management_wire_disable.c +++ b/src/exchange/taler-exchange-httpd_management_wire_disable.c @@ -148,8 +148,6 @@ TEH_handler_management_denominations_wire_disable ( &awc.validity_end), GNUNET_JSON_spec_end () }; - enum GNUNET_DB_QueryStatus qs; - MHD_RESULT ret; { enum GNUNET_GenericReturnValue res; @@ -176,13 +174,19 @@ TEH_handler_management_denominations_wire_disable ( TALER_EC_EXCHANGE_MANAGEMENT_WIRE_DEL_SIGNATURE_INVALID, NULL); } - qs = TEH_DB_run_transaction (connection, - "del wire", - &ret, - &del_wire, - &awc); - if (qs < 0) - return ret; + + { + enum GNUNET_GenericReturnValue res; + MHD_RESULT ret; + + res = TEH_DB_run_transaction (connection, + "del wire", + &ret, + &del_wire, + &awc); + if (GNUNET_SYSERR == res) + return ret; + } TEH_wire_update_state (); return TALER_MHD_reply_static ( connection, diff --git a/src/exchange/taler-exchange-httpd_management_wire_fees.c b/src/exchange/taler-exchange-httpd_management_wire_fees.c index 0a8bf4d1..5486ff33 100644 --- a/src/exchange/taler-exchange-httpd_management_wire_fees.c +++ b/src/exchange/taler-exchange-httpd_management_wire_fees.c @@ -187,8 +187,6 @@ TEH_handler_management_post_wire_fees ( &afc.wire_fee), GNUNET_JSON_spec_end () }; - enum GNUNET_DB_QueryStatus qs; - MHD_RESULT ret; { enum GNUNET_GenericReturnValue res; @@ -221,13 +219,18 @@ TEH_handler_management_post_wire_fees ( NULL); } - qs = TEH_DB_run_transaction (connection, - "add wire fee", - &ret, - &add_fee, - &afc); - if (qs < 0) - return ret; + { + enum GNUNET_GenericReturnValue res; + MHD_RESULT ret; + + res = TEH_DB_run_transaction (connection, + "add wire fee", + &ret, + &add_fee, + &afc); + if (GNUNET_SYSERR == res) + return ret; + } TEH_wire_update_state (); return TALER_MHD_reply_static ( connection, |