merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit b4b9b0d6fd069a967f4fd8542848f20844abdab2
parent 2977581de1b66917a35dee5ccccb1e92002a7dbc
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Mon, 20 Jul 2026 09:26:15 +0200

properly handle parse failure

Diffstat:
Msrc/backend/taler-merchant-httpd_post-private-donau.c | 17++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-private-donau.c b/src/backend/taler-merchant-httpd_post-private-donau.c @@ -290,13 +290,20 @@ TMH_private_post_donau_instance (const struct TMH_RequestHandler *rh, GNUNET_JSON_spec_end () }; - if (GNUNET_OK != - TALER_MHD_parse_json_data (connection, - hc->request_body, - spec)) + enum GNUNET_GenericReturnValue res; + + res = TALER_MHD_parse_json_data (connection, + hc->request_body, + spec); + if (GNUNET_OK != res) { + /* On a client error the parser already queued a 400 and + returns GNUNET_NO; we must return MHD_YES so MHD sends it, + returning MHD_NO only on GNUNET_SYSERR (drop connection). */ GNUNET_break_op (0); - return MHD_NO; + return (GNUNET_NO == res) + ? MHD_YES + : MHD_NO; } } qs = TALER_MERCHANTDB_check_donau_instance (TMH_db,