diff options
author | Florian Dold <florian@dold.me> | 2022-04-25 23:18:16 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-04-25 23:18:16 +0200 |
commit | ceb62f87b444d6c57fc34c5c2c4ed4295e499648 (patch) | |
tree | 364bcfe58707eeba0d320334a100e8b9978bd956 /src/backend | |
parent | 666c52a90321b201682db6aa6e568b28f5cb42d0 (diff) | |
download | merchant-ceb62f87b444d6c57fc34c5c2c4ed4295e499648.tar.gz merchant-ceb62f87b444d6c57fc34c5c2c4ed4295e499648.tar.bz2 merchant-ceb62f87b444d6c57fc34c5c2c4ed4295e499648.zip |
don't confuse GNUnet and MHD error codes
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c index 375f0930..37a37008 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -2084,8 +2084,8 @@ parse_pay (struct MHD_Connection *connection, MHD_HTTP_BAD_REQUEST, TALER_EC_GENERIC_PARAMETER_MALFORMED, "duplicate coin in list")) - ? GNUNET_NO - : GNUNET_SYSERR; + ? GNUNET_NO + : GNUNET_SYSERR; } } @@ -2099,10 +2099,12 @@ parse_pay (struct MHD_Connection *connection, { GNUNET_break_op (0); GNUNET_JSON_parse_free (spec); - return TALER_MHD_reply_with_error (connection, + return (MHD_YES == TALER_MHD_reply_with_error (connection, MHD_HTTP_CONFLICT, TALER_EC_GENERIC_CURRENCY_MISMATCH, - TMH_currency); + TMH_currency)) + ? GNUNET_NO + : GNUNET_SYSERR; } { @@ -2114,11 +2116,15 @@ parse_pay (struct MHD_Connection *connection, { GNUNET_break_op (0); GNUNET_JSON_parse_free (spec); - return TALER_MHD_reply_with_error ( - connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "inconsistency: 'mininum_age_sig' vs. 'age_commitment'"); + return (MHD_YES == + TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "inconsistency: 'mininum_age_sig' vs. 'age_commitment'") + ) + ? GNUNET_NO + : GNUNET_SYSERR; } /* Parse the AgeCommitment, i. e. the public keys */ @@ -2134,10 +2140,14 @@ parse_pay (struct MHD_Connection *connection, { GNUNET_break_op (0); GNUNET_JSON_parse_free (spec); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "'age_commitment' too large"); + return (MHD_YES == + TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "'age_commitment' too large" + )) + ? GNUNET_NO + : GNUNET_SYSERR; } dc->age_commitment = GNUNET_new (struct TALER_AgeCommitment); @@ -2164,10 +2174,14 @@ parse_pay (struct MHD_Connection *connection, { GNUNET_break_op (0); GNUNET_JSON_parse_free (spec); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "age_commitment"); + return (MHD_YES == + TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "age_commitment")) + ? GNUNET_NO + : GNUNET_SYSERR; } } } @@ -2443,6 +2457,7 @@ TMH_post_orders_ID_pay (const struct TMH_RequestHandler *rh, = GNUNET_SCHEDULER_add_delayed (get_pay_timeout (pc->coins_cnt), &handle_pay_timeout, pc); + GNUNET_assert (NULL != pc->wm); execute_pay_transaction (pc); return MHD_YES; } |