summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-12 23:09:24 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-12 23:10:11 +0100
commit117b8006d628b03d6e5945338c2362720a7f0e94 (patch)
tree261e383fd6865b24fae2e3e6914907301da5764e /src/backend
parentaf6b944efb53f429c1a67c30b7ae7576a464b0f5 (diff)
downloadmerchant-117b8006d628b03d6e5945338c2362720a7f0e94.tar.gz
merchant-117b8006d628b03d6e5945338c2362720a7f0e94.tar.bz2
merchant-117b8006d628b03d6e5945338c2362720a7f0e94.zip
fix #7570 and #7571
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/taler-merchant-httpd_exchanges.c16
-rw-r--r--src/backend/taler-merchant-httpd_private-post-reserves.c7
2 files changed, 23 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) )
diff --git a/src/backend/taler-merchant-httpd_private-post-reserves.c b/src/backend/taler-merchant-httpd_private-post-reserves.c
index 0351ab10..82fc865f 100644
--- a/src/backend/taler-merchant-httpd_private-post-reserves.c
+++ b/src/backend/taler-merchant-httpd_private-post-reserves.c
@@ -247,6 +247,13 @@ handle_exchange (void *cls,
TALER_MHD_daemon_trigger (); /* we resumed, kick MHD */
return;
}
+ if (MHD_HTTP_OK != hr->http_status)
+ {
+ rc->ec = hr->ec;
+ rc->http_status = hr->http_status;
+ TALER_MHD_daemon_trigger (); /* we resumed, kick MHD */
+ return;
+ }
if (NULL == payto_uri)
{
rc->ec = TALER_EC_MERCHANT_PRIVATE_POST_RESERVES_UNSUPPORTED_WIRE_METHOD;