From f46a22ebb9cc7308ed3bffcbb5227795552a08fb Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 27 Nov 2015 21:03:37 +0100 Subject: use new pluggable db backend, fixes FTBFS --- src/backend/taler-merchant-httpd.c | 12 ++++++------ src/backend/taler-merchant-httpd.h | 2 +- src/backend/taler-merchant-httpd_auditors.c | 5 +++-- src/backend/taler-merchant-httpd_pay.c | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index ffa81a7d..2cc553e9 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -107,7 +107,7 @@ static int result; /** * Connection handle to the our database */ -PGconn *db_conn; +struct TALER_MERCHANTDB_Plugin *db; /** * The MHD Daemon @@ -241,10 +241,10 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) MHD_stop_daemon (mhd); mhd = NULL; } - if (NULL != db_conn) + if (NULL != db) { - TALER_MERCHANTDB_disconnect (db_conn); - db_conn = NULL; + TALER_MERCHANTDB_plugin_unload (db); + db = NULL; } TMH_MINTS_done (); TMH_AUDITORS_done (); @@ -505,9 +505,9 @@ run (void *cls, GNUNET_CRYPTO_eddsa_key_get_public (privkey, &pubkey.eddsa_pub); EXITIF (NULL == - (db_conn = TALER_MERCHANTDB_connect (config))); + (db = TALER_MERCHANTDB_plugin_load (config))); EXITIF (GNUNET_OK != - TALER_MERCHANTDB_initialize (db_conn, dry)); + db->initialize (db->cls, dry)); EXITIF (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number (config, "merchant", diff --git a/src/backend/taler-merchant-httpd.h b/src/backend/taler-merchant-httpd.h index 3acff594..efecc467 100644 --- a/src/backend/taler-merchant-httpd.h +++ b/src/backend/taler-merchant-httpd.h @@ -142,7 +142,7 @@ extern struct GNUNET_CRYPTO_EddsaPrivateKey *privkey; extern struct TALER_MerchantPublicKeyP pubkey; -extern PGconn *db_conn; +extern struct TALER_MERCHANTDB_Plugin *db; diff --git a/src/backend/taler-merchant-httpd_auditors.c b/src/backend/taler-merchant-httpd_auditors.c index ecb0cb64..f30b11ee 100644 --- a/src/backend/taler-merchant-httpd_auditors.c +++ b/src/backend/taler-merchant-httpd_auditors.c @@ -65,13 +65,14 @@ json_t *j_auditors; * Function called on each configuration section. Finds sections * about auditors and parses the entries. * - * @param cls closure + * @param cls closure, with a `const struct GNUNET_CONFIGURATION_Handle *` * @param section name of the section */ static void parse_auditors (void *cls, const char *section) { + const struct GNUNET_CONFIGURATION_Handle *cfg = cfg; char *pks; struct Auditor auditor; @@ -150,7 +151,7 @@ TMH_AUDITORS_init (const struct GNUNET_CONFIGURATION_Handle *cfg) GNUNET_CONFIGURATION_iterate_sections (cfg, &parse_auditors, - NULL); + (void *) cfg); /* Generate preferred mint(s) array. */ j_auditors = json_array (); diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c index 945cf278..39d4c659 100644 --- a/src/backend/taler-merchant-httpd_pay.c +++ b/src/backend/taler-merchant-httpd_pay.c @@ -318,7 +318,7 @@ process_pay_with_mint (void *cls, struct PayContext *pc = cls; struct TALER_Amount acc_fee; struct TALER_Amount acc_amount; - struct TALER_Amount coin_fee; + // struct TALER_Amount coin_fee; const struct TALER_MINT_Keys *keys; unsigned int i; -- cgit v1.2.3