diff options
Diffstat (limited to 'src/psycstore/plugin_psycstore_mysql.c')
-rw-r--r-- | src/psycstore/plugin_psycstore_mysql.c | 35 |
1 files changed, 2 insertions, 33 deletions
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 | |||
81 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 81 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Database filename. | 84 | * MySQL context. |
85 | */ | 85 | */ |
86 | char *fn; | ||
87 | |||
88 | /** | ||
89 | *Handle to talk to Mysql | ||
90 | */ | ||
91 | struct GNUNET_MYSQL_Context *mc; | 86 | struct GNUNET_MYSQL_Context *mc; |
92 | 87 | ||
93 | /** | 88 | /** |
@@ -278,31 +273,8 @@ mysql_prepare (struct GNUNET_MYSQL_Context *mc, | |||
278 | static int | 273 | static int |
279 | database_setup (struct Plugin *plugin) | 274 | database_setup (struct Plugin *plugin) |
280 | { | 275 | { |
281 | char *filename; | ||
282 | |||
283 | if (GNUNET_OK != | ||
284 | GNUNET_CONFIGURATION_get_value_filename (plugin->cfg, "psycstore-mysql", | ||
285 | "FILENAME", &filename)) | ||
286 | { | ||
287 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | ||
288 | "psycstore-mysql", "FILENAME"); | ||
289 | return GNUNET_SYSERR; | ||
290 | } | ||
291 | |||
292 | if (GNUNET_OK != GNUNET_DISK_file_test (filename)) | ||
293 | { | ||
294 | if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (filename)) | ||
295 | { | ||
296 | GNUNET_break (0); | ||
297 | GNUNET_free (filename); | ||
298 | return GNUNET_SYSERR; | ||
299 | } | ||
300 | } | ||
301 | /* filename should be UTF-8-encoded. If it isn't, it's a bug */ | ||
302 | plugin->fn = filename; | ||
303 | |||
304 | /* Open database and precompile statements */ | 276 | /* Open database and precompile statements */ |
305 | plugin->mc = GNUNET_MYSQL_context_create(plugin->cfg, "psycstore-mysql"); | 277 | plugin->mc = GNUNET_MYSQL_context_create (plugin->cfg, "psycstore-mysql"); |
306 | 278 | ||
307 | if (NULL == plugin->mc) | 279 | if (NULL == plugin->mc) |
308 | { | 280 | { |
@@ -601,9 +573,6 @@ static void | |||
601 | database_shutdown (struct Plugin *plugin) | 573 | database_shutdown (struct Plugin *plugin) |
602 | { | 574 | { |
603 | GNUNET_MYSQL_context_destroy (plugin->mc); | 575 | GNUNET_MYSQL_context_destroy (plugin->mc); |
604 | |||
605 | GNUNET_free_non_null (plugin->fn); | ||
606 | |||
607 | } | 576 | } |
608 | 577 | ||
609 | 578 | ||