gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r15173 - gnunet/src/datastore


From: gnunet
Subject: [GNUnet-SVN] r15173 - gnunet/src/datastore
Date: Fri, 6 May 2011 17:05:46 +0200

Author: grothoff
Date: 2011-05-06 17:05:46 +0200 (Fri, 06 May 2011)
New Revision: 15173

Modified:
   gnunet/src/datastore/gnunet-service-datastore.c
   gnunet/src/datastore/plugin_datastore_postgres.c
Log:
fix

Modified: gnunet/src/datastore/gnunet-service-datastore.c
===================================================================
--- gnunet/src/datastore/gnunet-service-datastore.c     2011-05-06 12:25:50 UTC 
(rev 15172)
+++ gnunet/src/datastore/gnunet-service-datastore.c     2011-05-06 15:05:46 UTC 
(rev 15173)
@@ -145,6 +145,11 @@
 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 @@
              "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 @@
 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)

Modified: gnunet/src/datastore/plugin_datastore_postgres.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_postgres.c    2011-05-06 12:25:50 UTC 
(rev 15172)
+++ gnunet/src/datastore/plugin_datastore_postgres.c    2011-05-06 15:05:46 UTC 
(rev 15173)
@@ -525,7 +525,8 @@
 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 @@
                                 PGRES_TUPLES_OK,
                                 "PQexecPrepared",
                                 "select",
-                                __LINE__))
+                                line))
     {
 #if DEBUG_POSTGRES
       GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
@@ -800,7 +801,7 @@
                        paramFormats, 1);
   process_result (plugin,
                  proc, proc_cls,
-                 ret);
+                 ret, __LINE__);
 }
 
 
@@ -839,7 +840,7 @@
                        paramFormats, 1);
   process_result (plugin,
                  proc, proc_cls,
-                 ret);
+                 ret, __LINE__);
 }
 
 
@@ -961,7 +962,7 @@
                        NULL, NULL, NULL, 1);
   process_result (plugin,
                  &repl_proc, &rc,
-                 ret);
+                 ret, __LINE__);
 }
 
 
@@ -994,7 +995,7 @@
                        1);
   process_result (plugin,
                  proc, proc_cls,
-                 ret);
+                 ret, __LINE__);
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]