merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit e2b2e60859f0158f0e12cd55ca5cde8b00f7e862
parent a3fd8a78b07f49b31cf76c99d1d859f6c62baceb
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Tue, 16 Mar 2021 22:06:52 +0100

fix private get order id long polling logic

Diffstat:
Msrc/backend/taler-merchant-httpd_private-get-orders-ID.c | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c @@ -1061,6 +1061,19 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh, if ( (! paid) && (! order_only) ) { + if (0 != GNUNET_TIME_absolute_get_remaining (gorc->sc.long_poll_timeout).rel_value_us) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Suspending GET /private/orders/%s\n", + hc->infix); + TMH_long_poll_suspend (hc->infix, + gorc->session_id, + gorc->fulfillment_url, + hc->instance, + &gorc->sc, + NULL); + return MHD_YES; + } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Order %s claimed but not paid yet\n", hc->infix); @@ -1102,7 +1115,7 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh, } if ( (! paid) && - (0 != gorc->sc.long_poll_timeout.abs_value_us) ) + (0 != GNUNET_TIME_absolute_get_remaining (gorc->sc.long_poll_timeout).rel_value_us) ) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Suspending GET /private/orders/%s\n",