diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2021-03-16 22:06:52 +0100 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2021-03-16 22:06:52 +0100 |
commit | e2b2e60859f0158f0e12cd55ca5cde8b00f7e862 (patch) | |
tree | e2e277fa4a7fbaf490ad36cbc7559f653ffec9a2 /src/backend/taler-merchant-httpd_private-get-orders-ID.c | |
parent | a3fd8a78b07f49b31cf76c99d1d859f6c62baceb (diff) | |
download | merchant-e2b2e60859f0158f0e12cd55ca5cde8b00f7e862.tar.gz merchant-e2b2e60859f0158f0e12cd55ca5cde8b00f7e862.tar.bz2 merchant-e2b2e60859f0158f0e12cd55ca5cde8b00f7e862.zip |
fix private get order id long polling logic
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-orders-ID.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-get-orders-ID.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c index 6d4d625c..e7f6a1a0 100644 --- 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", |