[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: still fixing the stupid con
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: still fixing the stupid connect_task cleanup issue |
Date: |
Sun, 22 Jan 2017 00:52:14 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new a225f5848 still fixing the stupid connect_task cleanup issue
a225f5848 is described below
commit a225f5848382d5fda618732ca4a2087fbd6076af
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Jan 22 00:52:04 2017 +0100
still fixing the stupid connect_task cleanup issue
---
src/cadet/test_cadet_local.c | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/src/cadet/test_cadet_local.c b/src/cadet/test_cadet_local.c
index ddd294d6b..2b915ab81 100644
--- a/src/cadet/test_cadet_local.c
+++ b/src/cadet/test_cadet_local.c
@@ -64,17 +64,13 @@ do_connect (void *cls);
static void
do_shutdown (void *cls)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "shutdown\n");
if (NULL != abort_task)
{
GNUNET_SCHEDULER_cancel (abort_task);
abort_task = NULL;
}
- if (NULL != connect_task)
- {
- GNUNET_SCHEDULER_cancel (connect_task);
- connect_task = NULL;
- }
if (NULL != ch)
{
GNUNET_CADET_channel_destroy (ch);
@@ -94,6 +90,11 @@ do_shutdown (void *cls)
GNUNET_CADET_disconnect (cadet_peer_2);
cadet_peer_2 = NULL;
}
+ if (NULL != connect_task)
+ {
+ GNUNET_SCHEDULER_cancel (connect_task);
+ connect_task = NULL;
+ }
}
@@ -117,12 +118,12 @@ do_abort (void *cls)
* @param channel connection to the other end
* @param channel_ctx place to store local state associated with the channel
* @param message the actual message
- *
- * @return GNUNET_OK to keep the connection open,
- * GNUNET_SYSERR to close it (signal serious error)
+ * @return #GNUNET_OK to keep the connection open,
+ * #GNUNET_SYSERR to close it (signal serious error)
*/
static int
-data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
+data_callback (void *cls,
+ struct GNUNET_CADET_Channel *channel,
void **channel_ctx,
const struct GNUNET_MessageHeader *message)
{
@@ -292,7 +293,8 @@ run (void *cls,
struct GNUNET_TESTING_Peer *peer)
{
me = peer;
- GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
+ GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
+ NULL);
abort_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 15),
@@ -320,11 +322,12 @@ run (void *cls,
GC_u2h (1),
&inbound_channel,
(void *) 2L);
- connect_task
- = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS,
- 2),
- &do_connect,
- NULL);
+ if (NULL == connect_task)
+ connect_task
+ = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS,
+ 2),
+ &do_connect,
+ NULL);
}
--
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: still fixing the stupid connect_task cleanup issue,
gnunet <=