From 72cbf663952bc95888aa2187894da78725e7590c Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Sun, 2 Oct 2022 22:51:54 +0200 Subject: WiP: added auction_brandt as extension - added an extension to handle auctions via libbrandt - /extensions/auction_brandt GET and POST handler defined - initial parsing of transcript.json implemented, yet WiP - multiple cleanups and changes to extension handling --- src/exchange/taler-exchange-httpd_extensions.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/exchange/taler-exchange-httpd_extensions.c') diff --git a/src/exchange/taler-exchange-httpd_extensions.c b/src/exchange/taler-exchange-httpd_extensions.c index 2a99d7a2..2aee1b5c 100644 --- a/src/exchange/taler-exchange-httpd_extensions.c +++ b/src/exchange/taler-exchange-httpd_extensions.c @@ -78,6 +78,7 @@ extension_update_event_cb (void *cls, } // Get the config from the database as string + if (extension->has_config) { char *config_str = NULL; enum GNUNET_DB_QueryStatus qs; @@ -117,26 +118,26 @@ extension_update_event_cb (void *cls, err.text, err.source); GNUNET_break (0); - free(config_str); + free (config_str); return; } // Call the parser for the extension ret = extension->load_json_config ( (struct TALER_Extension *) extension, - json_object_get(config, "config")); + json_object_get (config, "config")); if (GNUNET_OK != ret) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Couldn't parse configuration for extension %s from the database: %s\n", extension->name, - config_str); + config_str); GNUNET_break (0); } - free(config_str); - json_decref(config); + free (config_str); + json_decref (config); } /* Special case age restriction: Update global flag and mask */ @@ -190,12 +191,16 @@ TEH_extensions_init () it = it->next) { const struct TALER_Extension *ext = it->extension; + uint32_t typ = htonl (ext->type); char *conf = json_dumps (ext->config_to_json (ext), JSON_COMPACT); TEH_plugin->set_extension_config (TEH_plugin->cls, ext->name, conf); - extension_update_event_cb (NULL, &ext->type, sizeof(ext->type)); + + extension_update_event_cb (NULL, + &typ, + sizeof(typ)); free (conf); } -- cgit v1.2.3