2 This file is part of GNUnet
3 Copyright (C) 2006, 2009, 2015 GNUnet e.V.
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 * @file datacache/plugin_datacache_sqlite.c
23 * @brief sqlite for an implementation of a database backend for the datacache
24 * @author Christian Grothoff
27 #include "gnunet_util_lib.h"
28 #include "gnunet_datacache_plugin.h"
29 #include "gnunet_sq_lib.h"
32 #define LOG(kind,...) GNUNET_log_from (kind, "datacache-sqlite", __VA_ARGS__)
34 #define LOG_STRERROR_FILE(kind,op,fn) GNUNET_log_from_strerror_file (kind, "datacache-sqlite", op, fn)
38 * How much overhead do we assume per entry in the
41 #define OVERHEAD (sizeof(struct GNUNET_HashCode) + 36)
44 * Context for all functions in this plugin.
49 * Our execution environment.
51 struct GNUNET_DATACACHE_PluginEnvironment *env;
54 * Handle to the sqlite database.
59 * Filename used for the DB.
64 * Prepared statement for #sqlite_plugin_put.
66 sqlite3_stmt *insert_stmt;
69 * Prepared statement for #sqlite_plugin_get.
71 sqlite3_stmt *get_count_stmt;
74 * Prepared statement for #sqlite_plugin_get.
76 sqlite3_stmt *get_stmt;
79 * Prepared statement for #sqlite_plugin_del.
81 sqlite3_stmt *del_select_stmt;
84 * Prepared statement for #sqlite_plugin_del.
86 sqlite3_stmt *del_stmt;
89 * Prepared statement for #sqlite_plugin_get_random.
91 sqlite3_stmt *get_random_stmt;
94 * Prepared statement for #sqlite_plugin_get_closest.
96 sqlite3_stmt *get_closest_stmt;
99 * Number of key-value pairs in the database.
101 unsigned int num_items;
106 * Log an error message at log-level @a level that indicates
107 * a failure of the command @a cmd with the error from the database @a db
109 * @param db database handle
110 * @param level log level
111 * @param cmd failed command
113 #define LOG_SQLITE(db, level, cmd) do { LOG (level, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, sqlite3_errmsg(db)); } while(0)
117 * Execute SQL statement.
119 * @param db database handle
120 * @param cmd SQL command to execute
122 #define SQLITE3_EXEC(db, cmd) do { emsg = NULL; if (SQLITE_OK != sqlite3_exec(db, cmd, NULL, NULL, &emsg)) { LOG (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, _("`%s' failed at %s:%d with error: %s\n"), "sqlite3_exec", __FILE__, __LINE__, emsg); sqlite3_free(emsg); } } while(0)
126 * @brief Prepare a SQL statement
128 * @param dbh database handle
129 * @param zsql SQL statement text
130 * @param[out] ppStmt set to the prepared statement
131 * @return 0 on success
134 sq_prepare (sqlite3 *dbh,
135 const char *zSql, /* SQL statement, UTF-8 encoded */
136 sqlite3_stmt **ppStmt)
137 { /* OUT: Statement handle */
140 return sqlite3_prepare (dbh,
144 (const char **) &dummy);
149 * Store an item in the datastore.
151 * @param cls closure (our `struct Plugin`)
152 * @param key key to store @a data under
153 * @param am_closest are we the closest peer?
154 * @param size number of bytes in @a data
155 * @param data data to store
156 * @param type type of the value
157 * @param discard_time when to discard the value in any case
158 * @param path_info_len number of entries in @a path_info
159 * @param path_info array of peers that have processed the request
160 * @return 0 if duplicate, -1 on error, number of bytes used otherwise
163 sqlite_plugin_put (void *cls,
164 const struct GNUNET_HashCode *key,
168 enum GNUNET_BLOCK_Type type,
169 struct GNUNET_TIME_Absolute discard_time,
170 unsigned int path_info_len,
171 const struct GNUNET_PeerIdentity *path_info)
173 struct Plugin *plugin = cls;
174 uint32_t type32 = type;
175 uint32_t prox = am_closest;
176 struct GNUNET_SQ_QueryParam params[] = {
177 GNUNET_SQ_query_param_uint32 (&type32),
178 GNUNET_SQ_query_param_absolute_time (&discard_time),
179 GNUNET_SQ_query_param_auto_from_type (key),
180 GNUNET_SQ_query_param_uint32 (&prox),
181 GNUNET_SQ_query_param_fixed_size (data, size),
182 GNUNET_SQ_query_param_fixed_size (path_info,
183 path_info_len * sizeof (struct GNUNET_PeerIdentity)),
184 GNUNET_SQ_query_param_end
187 LOG (GNUNET_ERROR_TYPE_DEBUG,
188 "Processing PUT of %u bytes with key `%s' and expiration %s\n",
191 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (discard_time),
194 GNUNET_SQ_bind (plugin->insert_stmt,
197 LOG_SQLITE (plugin->dbh,
198 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
200 GNUNET_SQ_reset (plugin->dbh,
201 plugin->insert_stmt);
205 sqlite3_step (plugin->insert_stmt))
207 LOG_SQLITE (plugin->dbh,
208 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
210 GNUNET_SQ_reset (plugin->dbh,
211 plugin->insert_stmt);
215 GNUNET_SQ_reset (plugin->dbh,
216 plugin->insert_stmt);
217 return size + OVERHEAD;
222 * Iterate over the results for a particular key
225 * @param cls closure (our `struct Plugin`)
227 * @param type entries of which type are relevant?
228 * @param iter maybe NULL (to just count)
229 * @param iter_cls closure for @a iter
230 * @return the number of results found
233 sqlite_plugin_get (void *cls,
234 const struct GNUNET_HashCode *key,
235 enum GNUNET_BLOCK_Type type,
236 GNUNET_DATACACHE_Iterator iter,
239 struct Plugin *plugin = cls;
240 uint32_t type32 = type;
241 struct GNUNET_TIME_Absolute now;
242 struct GNUNET_TIME_Absolute exp;
249 struct GNUNET_PeerIdentity *path;
250 struct GNUNET_SQ_QueryParam params_count[] = {
251 GNUNET_SQ_query_param_auto_from_type (key),
252 GNUNET_SQ_query_param_uint32 (&type32),
253 GNUNET_SQ_query_param_absolute_time (&now),
254 GNUNET_SQ_query_param_end
256 struct GNUNET_SQ_QueryParam params_select[] = {
257 GNUNET_SQ_query_param_auto_from_type (key),
258 GNUNET_SQ_query_param_uint32 (&type32),
259 GNUNET_SQ_query_param_absolute_time (&now),
260 GNUNET_SQ_query_param_uint32 (&off),
261 GNUNET_SQ_query_param_end
263 struct GNUNET_SQ_ResultSpec rs[] = {
264 GNUNET_SQ_result_spec_variable_size (&dat,
266 GNUNET_SQ_result_spec_absolute_time (&exp),
267 GNUNET_SQ_result_spec_variable_size ((void **) &path,
269 GNUNET_SQ_result_spec_end
272 now = GNUNET_TIME_absolute_get ();
273 LOG (GNUNET_ERROR_TYPE_DEBUG,
274 "Processing GET for key `%s'\n",
278 GNUNET_SQ_bind (plugin->get_count_stmt,
281 LOG_SQLITE (plugin->dbh,
282 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
284 GNUNET_SQ_reset (plugin->dbh,
285 plugin->get_count_stmt);
289 sqlite3_step (plugin->get_count_stmt))
291 LOG_SQLITE (plugin->dbh, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
293 GNUNET_SQ_reset (plugin->dbh,
294 plugin->get_count_stmt);
295 LOG (GNUNET_ERROR_TYPE_DEBUG,
296 "No content found when processing GET for key `%s'\n",
300 total = sqlite3_column_int (plugin->get_count_stmt,
302 GNUNET_SQ_reset (plugin->dbh,
303 plugin->get_count_stmt);
308 LOG (GNUNET_ERROR_TYPE_DEBUG,
309 "No content found when processing GET for key `%s'\n",
315 off = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
319 off = (off + 1) % total;
321 GNUNET_SQ_bind (plugin->get_stmt,
324 LOG_SQLITE (plugin->dbh,
325 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
327 GNUNET_SQ_reset (plugin->dbh,
332 sqlite3_step (plugin->get_stmt))
335 GNUNET_SQ_extract_result (plugin->get_stmt,
339 GNUNET_SQ_reset (plugin->dbh,
343 if (0 != psize % sizeof (struct GNUNET_PeerIdentity))
349 psize /= sizeof (struct GNUNET_PeerIdentity);
351 LOG (GNUNET_ERROR_TYPE_DEBUG,
352 "Found %u-byte result when processing GET for key `%s'\n",
355 if (GNUNET_OK != iter (iter_cls,
364 GNUNET_SQ_cleanup_result (rs);
365 GNUNET_SQ_reset (plugin->dbh,
369 GNUNET_SQ_cleanup_result (rs);
370 GNUNET_SQ_reset (plugin->dbh,
373 GNUNET_SQ_reset (plugin->dbh,
380 * Delete the entry with the lowest expiration value
381 * from the datacache right now.
383 * @param cls closure (our `struct Plugin`)
384 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
387 sqlite_plugin_del (void *cls)
389 struct Plugin *plugin = cls;
394 struct GNUNET_HashCode hc;
395 struct GNUNET_SQ_ResultSpec rs[] = {
396 GNUNET_SQ_result_spec_uint64 (&rowid),
397 GNUNET_SQ_result_spec_auto_from_type (&hc),
398 GNUNET_SQ_result_spec_variable_size ((void **) &data,
400 GNUNET_SQ_result_spec_end
402 struct GNUNET_SQ_QueryParam params[] = {
403 GNUNET_SQ_query_param_uint64 (&rowid),
404 GNUNET_SQ_query_param_end
406 struct GNUNET_SQ_QueryParam prox_params[] = {
407 GNUNET_SQ_query_param_uint32 (&prox),
408 GNUNET_SQ_query_param_end
411 LOG (GNUNET_ERROR_TYPE_DEBUG,
416 GNUNET_SQ_bind (plugin->del_select_stmt,
419 LOG_SQLITE (plugin->dbh,
420 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
422 GNUNET_SQ_reset (plugin->dbh,
424 return GNUNET_SYSERR;
427 sqlite3_step (plugin->del_select_stmt))
429 LOG_SQLITE (plugin->dbh,
430 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
432 GNUNET_SQ_reset (plugin->dbh,
433 plugin->del_select_stmt);
434 if (GNUNET_NO == prox)
439 return GNUNET_SYSERR;
442 GNUNET_SQ_extract_result (plugin->del_select_stmt,
445 GNUNET_SQ_reset (plugin->dbh,
446 plugin->del_select_stmt);
447 if (GNUNET_NO == prox)
453 return GNUNET_SYSERR;
455 GNUNET_SQ_cleanup_result (rs);
456 GNUNET_SQ_reset (plugin->dbh,
457 plugin->del_select_stmt);
459 GNUNET_SQ_bind (plugin->del_stmt,
462 LOG_SQLITE (plugin->dbh,
463 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
465 GNUNET_SQ_reset (plugin->dbh,
467 return GNUNET_SYSERR;
470 sqlite3_step (plugin->del_stmt))
472 LOG_SQLITE (plugin->dbh,
473 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
475 GNUNET_SQ_reset (plugin->dbh,
477 return GNUNET_SYSERR;
480 plugin->env->delete_notify (plugin->env->cls,
483 GNUNET_SQ_reset (plugin->dbh,
490 * Obtain a random key-value pair from the datacache.
492 * @param cls closure (our `struct Plugin`)
493 * @param iter maybe NULL (to just count)
494 * @param iter_cls closure for @a iter
495 * @return the number of results found, zero (datacache empty) or one
498 sqlite_plugin_get_random (void *cls,
499 GNUNET_DATACACHE_Iterator iter,
502 struct Plugin *plugin = cls;
503 struct GNUNET_TIME_Absolute exp;
509 struct GNUNET_PeerIdentity *path;
510 struct GNUNET_HashCode key;
511 struct GNUNET_SQ_QueryParam params[] = {
512 GNUNET_SQ_query_param_uint32 (&off),
513 GNUNET_SQ_query_param_end
515 struct GNUNET_SQ_ResultSpec rs[] = {
516 GNUNET_SQ_result_spec_variable_size (&dat,
518 GNUNET_SQ_result_spec_absolute_time (&exp),
519 GNUNET_SQ_result_spec_variable_size ((void **) &path,
521 GNUNET_SQ_result_spec_auto_from_type (&key),
522 GNUNET_SQ_result_spec_uint32 (&type),
523 GNUNET_SQ_result_spec_end
526 if (0 == plugin->num_items)
530 off = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
533 GNUNET_SQ_bind (plugin->get_random_stmt,
539 sqlite3_step (plugin->get_random_stmt))
542 GNUNET_SQ_reset (plugin->dbh,
543 plugin->get_random_stmt);
547 GNUNET_SQ_extract_result (plugin->get_random_stmt,
551 GNUNET_SQ_reset (plugin->dbh,
552 plugin->get_random_stmt);
555 if (0 != psize % sizeof (struct GNUNET_PeerIdentity))
561 psize /= sizeof (struct GNUNET_PeerIdentity);
562 LOG (GNUNET_ERROR_TYPE_DEBUG,
563 "Found %u-byte result with key %s when processing GET-RANDOM\n",
566 (void) iter (iter_cls,
570 (enum GNUNET_BLOCK_Type) type,
574 GNUNET_SQ_cleanup_result (rs);
575 GNUNET_SQ_reset (plugin->dbh,
576 plugin->get_random_stmt);
582 * Iterate over the results that are "close" to a particular key in
583 * the datacache. "close" is defined as numerically larger than @a
584 * key (when interpreted as a circular address space), with small
587 * @param cls closure (internal context for the plugin)
588 * @param key area of the keyspace to look into
589 * @param num_results number of results that should be returned to @a iter
590 * @param iter maybe NULL (to just count)
591 * @param iter_cls closure for @a iter
592 * @return the number of results found
595 sqlite_plugin_get_closest (void *cls,
596 const struct GNUNET_HashCode *key,
597 unsigned int num_results,
598 GNUNET_DATACACHE_Iterator iter,
601 struct Plugin *plugin = cls;
602 uint32_t num_results32 = num_results;
603 struct GNUNET_TIME_Absolute now;
604 struct GNUNET_TIME_Absolute exp;
610 struct GNUNET_HashCode hc;
611 struct GNUNET_PeerIdentity *path;
612 struct GNUNET_SQ_QueryParam params[] = {
613 GNUNET_SQ_query_param_auto_from_type (key),
614 GNUNET_SQ_query_param_absolute_time (&now),
615 GNUNET_SQ_query_param_uint32 (&num_results32),
616 GNUNET_SQ_query_param_end
618 struct GNUNET_SQ_ResultSpec rs[] = {
619 GNUNET_SQ_result_spec_variable_size (&dat,
621 GNUNET_SQ_result_spec_absolute_time (&exp),
622 GNUNET_SQ_result_spec_variable_size ((void **) &path,
624 GNUNET_SQ_result_spec_uint32 (&type),
625 GNUNET_SQ_result_spec_auto_from_type (&hc),
626 GNUNET_SQ_result_spec_end
629 now = GNUNET_TIME_absolute_get ();
630 LOG (GNUNET_ERROR_TYPE_DEBUG,
631 "Processing GET_CLOSEST for key `%s'\n",
634 GNUNET_SQ_bind (plugin->get_closest_stmt,
637 LOG_SQLITE (plugin->dbh,
638 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
640 GNUNET_SQ_reset (plugin->dbh,
641 plugin->get_closest_stmt);
646 sqlite3_step (plugin->get_closest_stmt))
649 GNUNET_SQ_extract_result (plugin->get_closest_stmt,
655 if (0 != psize % sizeof (struct GNUNET_PeerIdentity))
661 psize /= sizeof (struct GNUNET_PeerIdentity);
663 LOG (GNUNET_ERROR_TYPE_DEBUG,
664 "Found %u-byte result at %s when processing GET_CLOSE\n",
667 if (GNUNET_OK != iter (iter_cls,
676 GNUNET_SQ_cleanup_result (rs);
679 GNUNET_SQ_cleanup_result (rs);
681 GNUNET_SQ_reset (plugin->dbh,
682 plugin->get_closest_stmt);
688 * Entry point for the plugin.
690 * @param cls closure (the `struct GNUNET_DATACACHE_PluginEnvironment`)
691 * @return the plugin's closure (our `struct Plugin`)
694 libgnunet_plugin_datacache_sqlite_init (void *cls)
696 struct GNUNET_DATACACHE_PluginEnvironment *env = cls;
697 struct GNUNET_DATACACHE_PluginFunctions *api;
698 struct Plugin *plugin;
705 GNUNET_CONFIGURATION_get_value_yesno (env->cfg,
709 if (SQLITE_OK != sqlite3_open (":memory:", &dbh))
715 fn = GNUNET_DISK_mktemp ("gnunet-datacache");
721 /* fn should be UTF-8-encoded. If it isn't, it's a bug. */
722 fn_utf8 = GNUNET_strdup (fn);
723 if (SQLITE_OK != sqlite3_open (fn_utf8, &dbh))
726 GNUNET_free (fn_utf8);
732 SQLITE3_EXEC (dbh, "PRAGMA temp_store=MEMORY");
733 SQLITE3_EXEC (dbh, "PRAGMA locking_mode=EXCLUSIVE");
734 SQLITE3_EXEC (dbh, "PRAGMA journal_mode=OFF");
735 SQLITE3_EXEC (dbh, "PRAGMA synchronous=OFF");
736 SQLITE3_EXEC (dbh, "PRAGMA page_size=4092");
738 GNUNET_CONFIGURATION_get_value_yesno (env->cfg,
741 SQLITE3_EXEC (dbh, "PRAGMA sqlite_temp_store=3");
744 "CREATE TABLE ds091 (" " type INTEGER NOT NULL DEFAULT 0,"
745 " expire INTEGER NOT NULL,"
746 " key BLOB NOT NULL DEFAULT '',"
747 " prox INTEGER NOT NULL,"
748 " value BLOB NOT NULL,"
749 " path BLOB DEFAULT '')");
750 SQLITE3_EXEC (dbh, "CREATE INDEX idx_hashidx ON ds090 (key,type,expire)");
751 SQLITE3_EXEC (dbh, "CREATE INDEX idx_expire ON ds090 (prox,expire)");
752 plugin = GNUNET_new (struct Plugin);
755 plugin->fn = fn_utf8;
758 sq_prepare (plugin->dbh,
759 "INSERT INTO ds091 (type, expire, key, prox, value, path) "
760 "VALUES (?, ?, ?, ?, ?, ?)",
761 &plugin->insert_stmt)) ||
763 sq_prepare (plugin->dbh,
764 "SELECT count(*) FROM ds091 "
765 "WHERE key=? AND type=? AND expire >= ?",
766 &plugin->get_count_stmt)) ||
768 sq_prepare (plugin->dbh,
769 "SELECT value,expire,path FROM ds091 "
770 "WHERE key=? AND type=? AND expire >= ? LIMIT 1 OFFSET ?",
771 &plugin->get_stmt)) ||
773 sq_prepare (plugin->dbh,
774 "SELECT _ROWID_,key,value FROM ds091 WHERE prox=? ORDER BY expire ASC LIMIT 1",
775 &plugin->del_select_stmt)) ||
777 sq_prepare (plugin->dbh,
778 "DELETE FROM ds091 WHERE _ROWID_=?",
779 &plugin->del_stmt)) ||
781 sq_prepare (plugin->dbh,
782 "SELECT value,expire,path,key,type FROM ds091 "
783 "ORDER BY key LIMIT 1 OFFSET ?",
784 &plugin->get_random_stmt)) ||
786 sq_prepare (plugin->dbh,
787 "SELECT value,expire,path,type,key FROM ds091 "
788 "WHERE key>=? AND expire >= ? ORDER BY KEY ASC LIMIT ?",
789 &plugin->get_closest_stmt))
792 LOG_SQLITE (plugin->dbh,
793 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
795 GNUNET_break (SQLITE_OK ==
796 sqlite3_close (plugin->dbh));
797 GNUNET_free (plugin);
801 api = GNUNET_new (struct GNUNET_DATACACHE_PluginFunctions);
803 api->get = &sqlite_plugin_get;
804 api->put = &sqlite_plugin_put;
805 api->del = &sqlite_plugin_del;
806 api->get_random = &sqlite_plugin_get_random;
807 api->get_closest = &sqlite_plugin_get_closest;
808 LOG (GNUNET_ERROR_TYPE_INFO,
809 "Sqlite datacache running\n");
815 * Exit point from the plugin.
817 * @param cls closure (our `struct Plugin`)
821 libgnunet_plugin_datacache_sqlite_done (void *cls)
823 struct GNUNET_DATACACHE_PluginFunctions *api = cls;
824 struct Plugin *plugin = api->cls;
827 #if SQLITE_VERSION_NUMBER >= 3007000
831 #if !WINDOWS || defined(__CYGWIN__)
832 if ( (NULL != plugin->fn) &&
833 (0 != UNLINK (plugin->fn)) )
834 LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING,
837 GNUNET_free_non_null (plugin->fn);
839 sqlite3_finalize (plugin->insert_stmt);
840 sqlite3_finalize (plugin->get_count_stmt);
841 sqlite3_finalize (plugin->get_stmt);
842 sqlite3_finalize (plugin->del_select_stmt);
843 sqlite3_finalize (plugin->del_stmt);
844 sqlite3_finalize (plugin->get_random_stmt);
845 sqlite3_finalize (plugin->get_closest_stmt);
846 result = sqlite3_close (plugin->dbh);
847 #if SQLITE_VERSION_NUMBER >= 3007000
848 if (SQLITE_BUSY == result)
850 LOG (GNUNET_ERROR_TYPE_WARNING,
851 _("Tried to close sqlite without finalizing all prepared statements.\n"));
852 stmt = sqlite3_next_stmt (plugin->dbh, NULL);
855 result = sqlite3_finalize (stmt);
856 if (result != SQLITE_OK)
857 LOG (GNUNET_ERROR_TYPE_WARNING,
858 "Failed to close statement %p: %d\n",
861 stmt = sqlite3_next_stmt (plugin->dbh, NULL);
863 result = sqlite3_close (plugin->dbh);
866 if (SQLITE_OK != result)
867 LOG_SQLITE (plugin->dbh,
868 GNUNET_ERROR_TYPE_ERROR,
871 #if WINDOWS && !defined(__CYGWIN__)
872 if ( (NULL != plugin->fn) &&
873 (0 != UNLINK (plugin->fn)) )
874 LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING,
877 GNUNET_free_non_null (plugin->fn);
879 GNUNET_free (plugin);
886 /* end of plugin_datacache_sqlite.c */