[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r10575 - gnunet/src/datastore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r10575 - gnunet/src/datastore |
Date: |
Fri, 12 Mar 2010 17:16:01 +0100 |
Author: grothoff
Date: 2010-03-12 17:16:01 +0100 (Fri, 12 Mar 2010)
New Revision: 10575
Modified:
gnunet/src/datastore/gnunet-service-datastore.c
gnunet/src/datastore/plugin_datastore_sqlite.c
gnunet/src/datastore/test_datastore_api_data.conf
Log:
better clean up
Modified: gnunet/src/datastore/gnunet-service-datastore.c
===================================================================
--- gnunet/src/datastore/gnunet-service-datastore.c 2010-03-12 16:15:22 UTC
(rev 10574)
+++ gnunet/src/datastore/gnunet-service-datastore.c 2010-03-12 16:16:01 UTC
(rev 10575)
@@ -1263,8 +1263,11 @@
tcc_tail,
tcc);
if (tcc->th != NULL)
- GNUNET_CONNECTION_notify_transmit_ready_cancel (tcc->th);
- if (NULL != tcc->tc)
+ {
+ GNUNET_CONNECTION_notify_transmit_ready_cancel (tcc->th);
+ GNUNET_SERVER_client_drop (tcc->client);
+ }
+ if (NULL != tcc->tc)
tcc->tc (tcc->tc_cls, GNUNET_SYSERR);
GNUNET_free (tcc->msg);
GNUNET_free (tcc);
Modified: gnunet/src/datastore/plugin_datastore_sqlite.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_sqlite.c 2010-03-12 16:15:22 UTC
(rev 10574)
+++ gnunet/src/datastore/plugin_datastore_sqlite.c 2010-03-12 16:16:01 UTC
(rev 10575)
@@ -133,6 +133,11 @@
struct GNUNET_STATISTICS_GetHandle *stat_get;
/**
+ * Closure of the 'next_task' (must be freed if 'next_task' is cancelled).
+ */
+ struct NextContext *next_task_nc;
+
+ /**
* Pending task with scheduler for running the next request.
*/
GNUNET_SCHEDULER_TaskIdentifier next_task;
@@ -533,7 +538,7 @@
sqlite_next_request_cont (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- struct NextContext * nc= cls;
+ struct NextContext * nc = cls;
struct Plugin *plugin;
unsigned long long rowid;
sqlite3_stmt *stmtd;
@@ -548,6 +553,7 @@
plugin = nc->plugin;
plugin->next_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->next_task_nc = NULL;
if ( (GNUNET_YES == nc->end_it) ||
(GNUNET_OK != (nc->prep(nc->prep_cls,
nc))) )
@@ -673,6 +679,7 @@
if (GNUNET_YES == end_it)
nc->end_it = GNUNET_YES;
+ nc->plugin->next_task_nc = nc;
nc->plugin->next_task = GNUNET_SCHEDULER_add_now (nc->plugin->env->sched,
&sqlite_next_request_cont,
nc);
@@ -1655,6 +1662,9 @@
GNUNET_SCHEDULER_cancel (plugin->env->sched,
plugin->next_task);
plugin->next_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->next_task_nc->prep (plugin->next_task_nc->prep_cls, NULL);
+ GNUNET_free (plugin->next_task_nc);
+ plugin->next_task_nc = NULL;
}
fn = NULL;
if (plugin->drop_on_shutdown)
Modified: gnunet/src/datastore/test_datastore_api_data.conf
===================================================================
--- gnunet/src/datastore/test_datastore_api_data.conf 2010-03-12 16:15:22 UTC
(rev 10574)
+++ gnunet/src/datastore/test_datastore_api_data.conf 2010-03-12 16:16:01 UTC
(rev 10575)
@@ -31,6 +31,8 @@
# REJECT_FROM =
# REJECT_FROM6 =
# PREFIX =
+#PREFIX = valgrind --tool=memcheck --leak-check=yes
+#BINARY = /home/grothoff/bin/gnunet-service-datastore
[statistics]
PORT = 22667
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r10575 - gnunet/src/datastore,
gnunet <=