[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: fix infinite loop in GET /orders
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: fix infinite loop in GET /orders/ if exchange refund returns error |
Date: |
Thu, 13 Aug 2020 09:59:03 +0200 |
This is an automated email from the git hooks/post-receive script.
jonathan-buchanan pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new f0d7057 fix infinite loop in GET /orders/ if exchange refund returns
error
f0d7057 is described below
commit f0d70571fe4cece208d133d10e2dbea0d82b8b0f
Author: Jonathan Buchanan <jonathan.russ.buchanan@gmail.com>
AuthorDate: Thu Aug 13 03:58:53 2020 -0400
fix infinite loop in GET /orders/ if exchange refund returns error
---
src/backend/taler-merchant-httpd_get-orders-ID.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c
b/src/backend/taler-merchant-httpd_get-orders-ID.c
index 25e9631..f2ce62e 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.c
@@ -816,8 +816,8 @@ process_refunds_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Found refund of %s for coin %s with reason `%s' in database\n",
- TALER_B2S (coin_pub),
TALER_amount2s (refund_amount),
+ TALER_B2S (coin_pub),
reason);
cr = GNUNET_new (struct CoinRefund);
cr->refund_serial = refund_serial;
@@ -1225,6 +1225,16 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
}
}
+ /* Before we reset the refunds, make sure we notify the client in the case
+ of a non-200 status from the exchange. */
+ for (struct CoinRefund *cr = god->cr_head;
+ NULL != cr;
+ cr = cr->next)
+ {
+ if (MHD_HTTP_OK != cr->exchange_status)
+ goto REPLY;
+ }
+
/* At this point, we know the contract was paid. Let's check for
refunds. First, clear away refunds found from previous invocations. */
rf_cleanup (god);
@@ -1315,6 +1325,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
}
/* All operations done, build final response */
+REPLY:
{
json_t *ra;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant] branch master updated: fix infinite loop in GET /orders/ if exchange refund returns error,
gnunet <=