diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-refund.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-refund.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-refund.c b/src/backend/taler-merchant-httpd_post-orders-ID-refund.c index bfdb6ca2..7fafdd5e 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-refund.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-refund.c @@ -253,7 +253,24 @@ static struct PostRefundData *prd_head; static struct PostRefundData *prd_tail; -/* FIXME: Handle shutdown and other events that require ending all requests */ +/** + * Force resuming all suspended order lookups, needed during shutdown. + */ +void +TMH_force_wallet_refund_order_resume (void) +{ + struct PostRefundData *prd; + + while (NULL != (prd = prd_head)) + { + GNUNET_CONTAINER_DLL_remove (prd_head, + prd_tail, + prd); + GNUNET_assert (prd->suspended); + prd->suspended = false; + MHD_resume_connection (prd->sc.con); + } +} /** @@ -581,7 +598,11 @@ TMH_post_orders_ID_refund (const struct TMH_RequestHandler *rh, "Merchant database error"); case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: /* We need to talk to the exchange */ - /* FIXME: notify clients polling for this to happen */ + /* Notify clients waiting for the refund to be obtained. */ + TMH_long_poll_resume (hc->infix, + hc->instance, + &prd->refund_amount, + true); cr->fo = TMH_EXCHANGES_find_exchange (cr->exchange_url, NULL, GNUNET_NO, |