summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-11-27 21:03:37 +0100
committerChristian Grothoff <christian@grothoff.org>2015-11-27 21:03:37 +0100
commitf46a22ebb9cc7308ed3bffcbb5227795552a08fb (patch)
tree99459be5549ad376071342dea573c6994c409514
parentcd1bc15c6cc942be27db20ab3ab5ba76eb90849a (diff)
downloadmerchant-f46a22ebb9cc7308ed3bffcbb5227795552a08fb.tar.gz
merchant-f46a22ebb9cc7308ed3bffcbb5227795552a08fb.tar.bz2
merchant-f46a22ebb9cc7308ed3bffcbb5227795552a08fb.zip
use new pluggable db backend, fixes FTBFS
-rw-r--r--src/backend/taler-merchant-httpd.c12
-rw-r--r--src/backend/taler-merchant-httpd.h2
-rw-r--r--src/backend/taler-merchant-httpd_auditors.c5
-rw-r--r--src/backend/taler-merchant-httpd_pay.c2
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;