summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_get-orders-ID.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_get-orders-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_get-orders-ID.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c b/src/backend/taler-merchant-httpd_get-orders-ID.c
index d6abdc62..9748f469 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- (C) 2014-2021 Taler Systems SA
+ (C) 2014-2022 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -131,9 +131,12 @@ struct GetOrderData
/**
* Did we suspend @a connection and are thus in
- * the #god_head DLL?
+ * the #god_head DLL (#GNUNET_YES). Set to
+ * #GNUNET_NO if we are not suspended, and to
+ * #GNUNET_SYSERR if we should close the connection
+ * without a response due to shutdown.
*/
- bool suspended;
+ enum GNUNET_GenericReturnValue suspended;
/**
* Set to true if we are dealing with a claimed order
@@ -184,7 +187,7 @@ TMH_force_wallet_get_order_resume (void)
god_tail,
god);
GNUNET_assert (god->suspended);
- god->suspended = false;
+ god->suspended = GNUNET_SYSERR;
MHD_resume_connection (god->sc.con);
TALER_MHD_daemon_trigger (); /* we resumed, kick MHD */
}
@@ -267,7 +270,7 @@ resume_by_event (void *cls,
god->sc.awaiting_refund,
(int) extra_size,
(const char *) extra);
- god->suspended = false;
+ god->suspended = GNUNET_NO;
GNUNET_CONTAINER_DLL_remove (god_head,
god_tail,
god);
@@ -295,7 +298,7 @@ suspend_god (struct GetOrderData *god)
god->contract_terms = NULL;
}
GNUNET_assert (! god->suspended);
- god->suspended = true;
+ god->suspended = GNUNET_YES;
GNUNET_CONTAINER_DLL_insert (god_head,
god_tail,
god);
@@ -1003,9 +1006,11 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
} /* end of first-time initialization / sanity checks */
- if (god->suspended)
+ if (GNUNET_SYSERR == god->suspended)
+ return MHD_NO; /* we are in shutdown */
+ if (GNUNET_YES == god->suspended)
{
- god->suspended = false;
+ god->suspended = GNUNET_NO;
GNUNET_CONTAINER_DLL_remove (god_head,
god_tail,
god);