summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-12-02 11:09:54 +0100
committerChristian Grothoff <christian@grothoff.org>2015-12-02 11:09:54 +0100
commit9251a2d5d243981d45dc956844f32619a6a64530 (patch)
tree097bc49bac828d29ae99edb655eccbea1abcc80e
parent7c96cb35514dd8170f2064da581880f30e0ca8d2 (diff)
downloadmerchant-9251a2d5d243981d45dc956844f32619a6a64530.tar.gz
merchant-9251a2d5d243981d45dc956844f32619a6a64530.tar.bz2
merchant-9251a2d5d243981d45dc956844f32619a6a64530.zip
use config consistently:
-rw-r--r--src/backend/merchant.conf1
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c19
2 files changed, 7 insertions, 13 deletions
diff --git a/src/backend/merchant.conf b/src/backend/merchant.conf
index f9c964b2..91816ead 100644
--- a/src/backend/merchant.conf
+++ b/src/backend/merchant.conf
@@ -21,6 +21,7 @@ TRUSTED_MINTS = taler x
# FIXME: EDATE is a bit short, 'execution_delay'?
EDATE = 3 week
+# Which plugin (backend) do we use for the DB.
DB = postgres
[mint-taler]
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 836f0377..56d6b09c 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -38,11 +38,6 @@ struct PostgresClosure
*/
PGconn *conn;
- /**
- * Database connection string, as read from
- * the configuration.
- */
- char *connection_cfg_str;
};
@@ -211,17 +206,16 @@ libtaler_plugin_merchantdb_postgres_init (void *cls)
pg = GNUNET_new (struct PostgresClosure);
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "merchantdb-postgres",
- "CONFIG",
- &pg->connection_cfg_str))
+ GNUNET_CONFIGURATION_have_value_string (cfg,
+ "merchantdb-postgres",
+ "CONFIG"))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "merchant",
- "db_conn_str");
+ "merchantdb-postgres",
+ "CONFIG");
return NULL;
}
- pg->conn = GNUNET_POSTGRES_connect (cfg, "merchant-db");
+ pg->conn = GNUNET_POSTGRES_connect (cfg, "merchantdb-postgres");
plugin = GNUNET_new (struct TALER_MERCHANTDB_Plugin);
plugin->cls = pg;
plugin->initialize = &postgres_initialize;
@@ -243,7 +237,6 @@ libtaler_plugin_merchantdb_postgres_done (void *cls)
struct TALER_MERCHANTDB_Plugin *plugin = cls;
struct PostgresClosure *pg = plugin->cls;
- GNUNET_free (pg->connection_cfg_str);
PQfinish (pg->conn);
GNUNET_free (pg);
GNUNET_free (plugin);