X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fdatacache%2Fplugin_datacache_sqlite.c;h=dc4236a8b8fd4ba2254a81f716410b32fb4e3f6e;hb=1eb0a7b0bcc365263e11ba03def10d51976ff32a;hp=c4adb34fdb3cb6acc949374a4163c17769245f68;hpb=18a1d4ec5085690d16345a52f3e75d059c834195;p=oweals%2Fgnunet.git diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c index c4adb34fd..dc4236a8b 100644 --- a/src/datacache/plugin_datacache_sqlite.c +++ b/src/datacache/plugin_datacache_sqlite.c @@ -2,20 +2,18 @@ This file is part of GNUnet Copyright (C) 2006, 2009, 2015 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + Affero General Public License for more details. - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ /** @@ -426,23 +424,14 @@ sqlite_plugin_del (void *cls) plugin->del_expired_stmt); return GNUNET_SYSERR; } - if (SQLITE_ROW != - sqlite3_step (plugin->del_expired_stmt)) - { - LOG_SQLITE (plugin->dbh, - GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, - "sqlite3_step"); - GNUNET_SQ_reset (plugin->dbh, - plugin->del_expired_stmt); - return GNUNET_SYSERR; - } - if (GNUNET_OK != - GNUNET_SQ_extract_result (plugin->del_expired_stmt, - rs)) + if ( (SQLITE_ROW != + sqlite3_step (plugin->del_expired_stmt)) || + (GNUNET_OK != + GNUNET_SQ_extract_result (plugin->del_expired_stmt, + rs)) ) { GNUNET_SQ_reset (plugin->dbh, plugin->del_expired_stmt); - if (SQLITE_ROW != sqlite3_step (plugin->del_select_stmt)) { @@ -760,7 +749,8 @@ libgnunet_plugin_datacache_sqlite_init (void *cls) " value BLOB NOT NULL," " path BLOB DEFAULT '')"); SQLITE3_EXEC (dbh, "CREATE INDEX idx_hashidx ON ds091 (key,type,expire)"); - SQLITE3_EXEC (dbh, "CREATE INDEX idx_expire ON ds091 (prox,expire)"); + SQLITE3_EXEC (dbh, "CREATE INDEX idx_prox_expire ON ds091 (prox,expire)"); + SQLITE3_EXEC (dbh, "CREATE INDEX idx_expire_only ON ds091 (expire)"); plugin = GNUNET_new (struct Plugin); plugin->env = env; plugin->dbh = dbh;