[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: Apparently ignoring return
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: Apparently ignoring return values from add_now is almost always a bug |
Date: |
Thu, 09 Aug 2018 11:23:11 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 6b82442f8 Apparently ignoring return values from add_now is almost
always a bug
6b82442f8 is described below
commit 6b82442f874cbabaaf19e8c558584ceca734cff6
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Thu Aug 9 11:23:07 2018 +0200
Apparently ignoring return values from add_now is almost always a bug
---
src/reclaim/gnunet-reclaim.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/src/reclaim/gnunet-reclaim.c b/src/reclaim/gnunet-reclaim.c
index 33bad662d..ecc81fb8e 100644
--- a/src/reclaim/gnunet-reclaim.c
+++ b/src/reclaim/gnunet-reclaim.c
@@ -134,9 +134,15 @@ static struct GNUNET_TIME_Relative exp_interval;
*/
static struct GNUNET_SCHEDULER_Task *timeout;
+/**
+ * Cleanup task
+ */
+static struct GNUNET_SCHEDULER_Task *cleanup_task;
+
static void
do_cleanup(void *cls)
{
+ cleanup_task = NULL;
if (NULL != timeout)
GNUNET_SCHEDULER_cancel (timeout);
if (NULL != reclaim_op)
@@ -166,7 +172,7 @@ ticket_issue_cb (void* cls,
ticket_str);
GNUNET_free (ticket_str);
}
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
@@ -179,7 +185,7 @@ store_attr_cont (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%s\n", emsg);
}
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
@@ -191,7 +197,7 @@ process_attrs (void *cls,
if (NULL == identity)
{
reclaim_op = NULL;
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
return;
}
if (NULL == attr)
@@ -213,7 +219,7 @@ iter_error (void *cls)
attr_iterator = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to iterate over attributes\n");
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
@@ -223,7 +229,8 @@ timeout_task (void *cls)
ret = 1;
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
"Timeout\n");
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ if (NULL == cleanup_task)
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
@@ -236,7 +243,7 @@ process_rvk (void *cls, int success, const char* msg)
"Revocation failed.\n");
ret = 1;
}
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
@@ -250,7 +257,7 @@ iter_finished (void *cls)
attr_iterator = NULL;
if (list)
{
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
return;
}
@@ -308,7 +315,7 @@ iter_finished (void *cls)
NULL);
return;
}
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
static void
@@ -351,13 +358,13 @@ iter_cb (void *cls,
}
static void
-ego_iter_finished (void *cls)
+start_get_attributes ()
{
if (NULL == pkey)
{
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
"Ego %s not found\n", ego_name);
- GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
+ cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
return;
}
@@ -402,7 +409,7 @@ ego_cb (void *cls,
if (NULL == name) {
if (GNUNET_YES == init) {
init = GNUNET_NO;
- GNUNET_SCHEDULER_add_now (&ego_iter_finished, NULL);
+ start_get_attributes();
}
return;
}
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: Apparently ignoring return values from add_now is almost always a bug,
gnunet <=