From: Gabor X Toth <*@tg-x.net> Date: Thu, 22 Sep 2016 16:55:06 +0000 (+0000) Subject: psycstore-mysql: remove filename config option X-Git-Tag: initial-import-from-subversion-38251~230 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=72ac76db16854deabaa9cd925a50e3fc345d9eb7;p=oweals%2Fgnunet.git psycstore-mysql: remove filename config option --- diff --git a/src/psycstore/plugin_psycstore_mysql.c b/src/psycstore/plugin_psycstore_mysql.c index 2896f4968..42c12119e 100644 --- a/src/psycstore/plugin_psycstore_mysql.c +++ b/src/psycstore/plugin_psycstore_mysql.c @@ -81,13 +81,8 @@ struct Plugin const struct GNUNET_CONFIGURATION_Handle *cfg; /** - * Database filename. + * MySQL context. */ - char *fn; - - /** - *Handle to talk to Mysql - */ struct GNUNET_MYSQL_Context *mc; /** @@ -278,31 +273,8 @@ mysql_prepare (struct GNUNET_MYSQL_Context *mc, static int database_setup (struct Plugin *plugin) { - char *filename; - - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_filename (plugin->cfg, "psycstore-mysql", - "FILENAME", &filename)) - { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "psycstore-mysql", "FILENAME"); - return GNUNET_SYSERR; - } - - if (GNUNET_OK != GNUNET_DISK_file_test (filename)) - { - if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (filename)) - { - GNUNET_break (0); - GNUNET_free (filename); - return GNUNET_SYSERR; - } - } - /* filename should be UTF-8-encoded. If it isn't, it's a bug */ - plugin->fn = filename; - /* Open database and precompile statements */ - plugin->mc = GNUNET_MYSQL_context_create(plugin->cfg, "psycstore-mysql"); + plugin->mc = GNUNET_MYSQL_context_create (plugin->cfg, "psycstore-mysql"); if (NULL == plugin->mc) { @@ -601,9 +573,6 @@ static void database_shutdown (struct Plugin *plugin) { GNUNET_MYSQL_context_destroy (plugin->mc); - - GNUNET_free_non_null (plugin->fn); - } diff --git a/src/psycstore/psycstore.conf.in b/src/psycstore/psycstore.conf.in index 2828201bd..236471e36 100644 --- a/src/psycstore/psycstore.conf.in +++ b/src/psycstore/psycstore.conf.in @@ -17,4 +17,9 @@ DATABASE = sqlite FILENAME = $GNUNET_DATA_HOME/psycstore/sqlite.db [psycstore-mysql] -FILENAME = $GNUNET_DATA_HOME/psycstore/mysql.sql +DATABASE = gnunet +CONFIG = ~/.my.cnf +# USER = gnunet +# PASSWORD = +# HOST = localhost +# PORT = 3306 diff --git a/src/psycstore/test_plugin_psycstore_mysql.conf b/src/psycstore/test_plugin_psycstore_mysql.conf index ea0e406d4..e15b3fd63 100644 --- a/src/psycstore/test_plugin_psycstore_mysql.conf +++ b/src/psycstore/test_plugin_psycstore_mysql.conf @@ -1,2 +1,7 @@ [psycstore-mysql] -FILENAME = /tmp/gnunet-test-plugin-psycstore-mysql/mysql.sql +DATABASE = test +# CONFIG = ~/.my.cnf +# USER = gnunet +# PASSWORD = +# HOST = localhost +# PORT = 3306