summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_exchanges.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_exchanges.c')
-rw-r--r--src/backend/taler-merchant-httpd_exchanges.c16
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) )