diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-01-12 23:09:24 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-01-12 23:10:11 +0100 |
commit | 117b8006d628b03d6e5945338c2362720a7f0e94 (patch) | |
tree | 261e383fd6865b24fae2e3e6914907301da5764e /src/backend/taler-merchant-httpd_exchanges.c | |
parent | af6b944efb53f429c1a67c30b7ae7576a464b0f5 (diff) | |
download | merchant-117b8006d628b03d6e5945338c2362720a7f0e94.tar.gz merchant-117b8006d628b03d6e5945338c2362720a7f0e94.tar.bz2 merchant-117b8006d628b03d6e5945338c2362720a7f0e94.zip |
fix #7570 and #7571
Diffstat (limited to 'src/backend/taler-merchant-httpd_exchanges.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_exchanges.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c index 7f6336c1..12c75ca4 100644 --- a/src/backend/taler-merchant-httpd_exchanges.c +++ b/src/backend/taler-merchant-httpd_exchanges.c @@ -238,6 +238,12 @@ struct Exchange */ bool trusted; + /** + * true if this exchange did return to use the + * response from /wire. + */ + bool have_wire; + }; @@ -627,6 +633,13 @@ process_find_operations (struct Exchange *exchange) .http_status = MHD_HTTP_OK, }; + if ( (NULL != fo->wire_method) && + (! exchange->have_wire) ) + { + /* We needed /wire, but didn't get it. That's not "200 OK". */ + hr.http_status = MHD_HTTP_BAD_GATEWAY; + hr.ec = TALER_EC_MERCHANT_GENERIC_EXCHANGE_WIRE_REQUEST_FAILED; + } fo->fc (fo->fc_cls, &hr, exchange->conn, @@ -676,6 +689,7 @@ handle_wire_data (void *cls, { struct TMH_EXCHANGES_FindOperation *fo; + exchange->have_wire = false; GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to obtain /wire details from `%s': %u/%d\n", exchange->url, @@ -710,6 +724,7 @@ handle_wire_data (void *cls, }; GNUNET_break_op (0); + exchange->have_wire = false; while (NULL != (fo = exchange->fo_head)) { fo->fc (fo->fc_cls, @@ -722,6 +737,7 @@ handle_wire_data (void *cls, } return; } + exchange->have_wire = true; if ( (process_find_operations (exchange)) && (NULL == exchange->wire_task) && (NULL == exchange->wire_request) ) |