From 462fd2694d132796780f866f0035d30434759691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Thu, 23 Dec 2021 15:06:44 +0100 Subject: [PATCH] added TEH_extensions_done() also: renamed TEH_WIRE_done -> TEH_wire_done --- src/exchange/taler-exchange-httpd.c | 3 ++- src/exchange/taler-exchange-httpd_extensions.c | 13 ++++++++----- src/exchange/taler-exchange-httpd_extensions.h | 5 +++++ src/exchange/taler-exchange-httpd_wire.c | 2 +- src/exchange/taler-exchange-httpd_wire.h | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index 581eaf005..0535a54ea 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -1799,7 +1799,8 @@ do_shutdown (void *cls) TEH_kyc_proof_cleanup (); if (NULL != mhd) MHD_stop_daemon (mhd); - TEH_WIRE_done (); + TEH_wire_done (); + TEH_extensions_done (); TEH_keys_finished (); if (NULL != TEH_plugin) { diff --git a/src/exchange/taler-exchange-httpd_extensions.c b/src/exchange/taler-exchange-httpd_extensions.c index 64f20fda3..98092bd09 100644 --- a/src/exchange/taler-exchange-httpd_extensions.c +++ b/src/exchange/taler-exchange-httpd_extensions.c @@ -44,22 +44,20 @@ static struct GNUNET_DB_EventHandler *extensions_eh; */ static void extension_update_event_cb (void *cls, - const void *extra, - size_t extra_size) + const void *extra, + size_t extra_size) { (void) cls; (void) extra; (void) extra_size; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received /management/extensions update event\n"); - /* TODO !? */ } enum GNUNET_GenericReturnValue TEH_extensions_init () { - /* TODO */ struct GNUNET_DB_EventHeaderP es = { .size = htons (sizeof (es)), .type = htons (TALER_DBEVENT_EXCHANGE_EXTENSIONS_UPDATED), @@ -82,7 +80,12 @@ TEH_extensions_init () void TEH_extensions_done () { - /* TODO!? */ + if (NULL != extensions_eh) + { + TEH_plugin->event_listen_cancel (TEH_plugin->cls, + extensions_eh); + extensions_eh = NULL; + } } diff --git a/src/exchange/taler-exchange-httpd_extensions.h b/src/exchange/taler-exchange-httpd_extensions.h index 513598ff1..3c86e2662 100644 --- a/src/exchange/taler-exchange-httpd_extensions.h +++ b/src/exchange/taler-exchange-httpd_extensions.h @@ -34,6 +34,11 @@ enum GNUNET_GenericReturnValue TEH_extensions_init (void); +/** + * Terminate the extension subsystem + */ +void +TEH_extensions_done (void); /** * Something changed in the database. Rebuild the extension state metadata. diff --git a/src/exchange/taler-exchange-httpd_wire.c b/src/exchange/taler-exchange-httpd_wire.c index 911100583..d378bdabc 100644 --- a/src/exchange/taler-exchange-httpd_wire.c +++ b/src/exchange/taler-exchange-httpd_wire.c @@ -130,7 +130,7 @@ TEH_wire_init () void -TEH_WIRE_done () +TEH_wire_done () { if (NULL != wire_state) { diff --git a/src/exchange/taler-exchange-httpd_wire.h b/src/exchange/taler-exchange-httpd_wire.h index 5966ccbd4..ed815a57e 100644 --- a/src/exchange/taler-exchange-httpd_wire.h +++ b/src/exchange/taler-exchange-httpd_wire.h @@ -30,7 +30,7 @@ * Clean up wire subsystem. */ void -TEH_WIRE_done (void); +TEH_wire_done (void); /**