diff options
-rw-r--r-- | src/datastore/gnunet-service-datastore.c | 9 | ||||
-rw-r--r-- | src/datastore/plugin_datastore_postgres.c | 13 |
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; | |||
145 | static unsigned long long quota; | 145 | static unsigned long long quota; |
146 | 146 | ||
147 | /** | 147 | /** |
148 | * Should the database be dropped on exit? | ||
149 | */ | ||
150 | static int do_drop; | ||
151 | |||
152 | /** | ||
148 | * How much space are we using for the cache? (space available for | 153 | * How much space are we using for the cache? (space available for |
149 | * insertions that will be instantly reclaimed by discarding less | 154 | * insertions that will be instantly reclaimed by discarding less |
150 | * important content --- or possibly whatever we just inserted into | 155 | * important content --- or possibly whatever we just inserted into |
@@ -1342,7 +1347,7 @@ handle_drop (void *cls, | |||
1342 | "Processing `%s' request\n", | 1347 | "Processing `%s' request\n", |
1343 | "DROP"); | 1348 | "DROP"); |
1344 | #endif | 1349 | #endif |
1345 | plugin->api->drop (plugin->api->cls); | 1350 | do_drop = GNUNET_YES; |
1346 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1351 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1347 | } | 1352 | } |
1348 | 1353 | ||
@@ -1490,6 +1495,8 @@ static void | |||
1490 | unload_task (void *cls, | 1495 | unload_task (void *cls, |
1491 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 1496 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
1492 | { | 1497 | { |
1498 | if (GNUNET_YES == do_drop) | ||
1499 | plugin->api->drop (plugin->api->cls); | ||
1493 | unload_plugin (plugin); | 1500 | unload_plugin (plugin); |
1494 | plugin = NULL; | 1501 | plugin = NULL; |
1495 | if (filter != NULL) | 1502 | 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, | |||
525 | static void | 525 | static void |
526 | process_result (struct Plugin *plugin, | 526 | process_result (struct Plugin *plugin, |
527 | PluginDatumProcessor proc, void *proc_cls, | 527 | PluginDatumProcessor proc, void *proc_cls, |
528 | PGresult *res) | 528 | PGresult *res, |
529 | int line) | ||
529 | { | 530 | { |
530 | int iret; | 531 | int iret; |
531 | enum GNUNET_BLOCK_Type type; | 532 | enum GNUNET_BLOCK_Type type; |
@@ -541,7 +542,7 @@ process_result (struct Plugin *plugin, | |||
541 | PGRES_TUPLES_OK, | 542 | PGRES_TUPLES_OK, |
542 | "PQexecPrepared", | 543 | "PQexecPrepared", |
543 | "select", | 544 | "select", |
544 | __LINE__)) | 545 | line)) |
545 | { | 546 | { |
546 | #if DEBUG_POSTGRES | 547 | #if DEBUG_POSTGRES |
547 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, | 548 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, |
@@ -800,7 +801,7 @@ postgres_plugin_get_key (void *cls, | |||
800 | paramFormats, 1); | 801 | paramFormats, 1); |
801 | process_result (plugin, | 802 | process_result (plugin, |
802 | proc, proc_cls, | 803 | proc, proc_cls, |
803 | ret); | 804 | ret, __LINE__); |
804 | } | 805 | } |
805 | 806 | ||
806 | 807 | ||
@@ -839,7 +840,7 @@ postgres_plugin_get_zero_anonymity (void *cls, | |||
839 | paramFormats, 1); | 840 | paramFormats, 1); |
840 | process_result (plugin, | 841 | process_result (plugin, |
841 | proc, proc_cls, | 842 | proc, proc_cls, |
842 | ret); | 843 | ret, __LINE__); |
843 | } | 844 | } |
844 | 845 | ||
845 | 846 | ||
@@ -961,7 +962,7 @@ postgres_plugin_get_replication (void *cls, | |||
961 | NULL, NULL, NULL, 1); | 962 | NULL, NULL, NULL, 1); |
962 | process_result (plugin, | 963 | process_result (plugin, |
963 | &repl_proc, &rc, | 964 | &repl_proc, &rc, |
964 | ret); | 965 | ret, __LINE__); |
965 | } | 966 | } |
966 | 967 | ||
967 | 968 | ||
@@ -994,7 +995,7 @@ postgres_plugin_get_expiration (void *cls, | |||
994 | 1); | 995 | 1); |
995 | process_result (plugin, | 996 | process_result (plugin, |
996 | proc, proc_cls, | 997 | proc, proc_cls, |
997 | ret); | 998 | ret, __LINE__); |
998 | } | 999 | } |
999 | 1000 | ||
1000 | 1001 | ||