summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-05-06 15:05:46 +0000
committerChristian Grothoff <christian@grothoff.org>2011-05-06 15:05:46 +0000
commit399643b49e9564eead88548fa78e9bf259d8b3c3 (patch)
treee56d0a96160f1cdc7ab74c1b6bcc62bba4d95c48 /src
parentb9362adab3bced778d54c4c83d6fdd9305ce52c7 (diff)
fix
Diffstat (limited to 'src')
-rw-r--r--src/datastore/gnunet-service-datastore.c9
-rw-r--r--src/datastore/plugin_datastore_postgres.c13
2 files changed, 15 insertions, 7 deletions
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index a0d5f7bab..f95f09921 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -145,6 +145,11 @@ static struct GNUNET_CONTAINER_BloomFilter *filter;
static unsigned long long quota;
/**
+ * Should the database be dropped on exit?
+ */
+static int do_drop;
+
+/**
* How much space are we using for the cache? (space available for
* insertions that will be instantly reclaimed by discarding less
* important content --- or possibly whatever we just inserted into
@@ -1342,7 +1347,7 @@ handle_drop (void *cls,
"Processing `%s' request\n",
"DROP");
#endif
- plugin->api->drop (plugin->api->cls);
+ do_drop = GNUNET_YES;
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@ -1490,6 +1495,8 @@ static void
unload_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ if (GNUNET_YES == do_drop)
+ plugin->api->drop (plugin->api->cls);
unload_plugin (plugin);
plugin = NULL;
if (filter != NULL)
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index cb077f06a..30a6c20da 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -525,7 +525,8 @@ postgres_plugin_put (void *cls,
static void
process_result (struct Plugin *plugin,
PluginDatumProcessor proc, void *proc_cls,
- PGresult *res)
+ PGresult *res,
+ int line)
{
int iret;
enum GNUNET_BLOCK_Type type;
@@ -541,7 +542,7 @@ process_result (struct Plugin *plugin,
PGRES_TUPLES_OK,
"PQexecPrepared",
"select",
- __LINE__))
+ line))
{
#if DEBUG_POSTGRES
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
@@ -800,7 +801,7 @@ postgres_plugin_get_key (void *cls,
paramFormats, 1);
process_result (plugin,
proc, proc_cls,
- ret);
+ ret, __LINE__);
}
@@ -839,7 +840,7 @@ postgres_plugin_get_zero_anonymity (void *cls,
paramFormats, 1);
process_result (plugin,
proc, proc_cls,
- ret);
+ ret, __LINE__);
}
@@ -961,7 +962,7 @@ postgres_plugin_get_replication (void *cls,
NULL, NULL, NULL, 1);
process_result (plugin,
&repl_proc, &rc,
- ret);
+ ret, __LINE__);
}
@@ -994,7 +995,7 @@ postgres_plugin_get_expiration (void *cls,
1);
process_result (plugin,
proc, proc_cls,
- ret);
+ ret, __LINE__);
}