gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] 10/45: fix segfault and pending_timeout logic


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 10/45: fix segfault and pending_timeout logic
Date: Sun, 31 Dec 2017 00:36:57 +0100

This is an automated email from the git hooks/post-receive script.

lurchi pushed a commit to branch master
in repository gnunet.

commit b60af34ef8ec413af4eea572ce211ab03a79ca17
Author: lurchi <address@hidden>
AuthorDate: Sat Aug 5 16:31:09 2017 +0200

    fix segfault and pending_timeout logic
---
 src/util/scheduler.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 3da4eaddb..42309c199 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -536,10 +536,11 @@ check_ready (const struct GNUNET_NETWORK_FDSet *rs,
       pos->reason |= GNUNET_SCHEDULER_REASON_TIMEOUT;
     if (0 == pos->reason)
       break;
+    scheduler_driver->set_wakeup (scheduler_driver->cls,
+                                  pending_timeout_head->timeout);
     GNUNET_CONTAINER_DLL_remove (pending_timeout_head,
                                  pending_timeout_tail,
                                  pos);
-    
scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout);
     if (pending_timeout_last == pos)
       pending_timeout_last = NULL;
     queue_ready_task (pos);
@@ -1065,14 +1066,20 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task 
*task)
          (NULL == task->write_set) )
     {
       if (GNUNET_YES == task->on_shutdown)
-  GNUNET_CONTAINER_DLL_remove (shutdown_head,
-             shutdown_tail,
-             task);
+        GNUNET_CONTAINER_DLL_remove (shutdown_head,
+                                     shutdown_tail,
+                                     task);
       else
-  GNUNET_CONTAINER_DLL_remove (pending_timeout_head,
-             pending_timeout_tail,
-             task);
-      
scheduler_driver->set_wakeup(scheduler_driver->cls,pending_timeout_head->timeout);
+      {
+        GNUNET_CONTAINER_DLL_remove (pending_timeout_head,
+                                     pending_timeout_tail,
+                                     task);
+        if (pending_timeout_last == task)
+          pending_timeout_last = NULL;
+        else
+          scheduler_driver->set_wakeup (scheduler_driver->cls,
+                                        pending_timeout_head->timeout);
+      }
       if (task == pending_timeout_last)
         pending_timeout_last = NULL;
     }
@@ -2082,7 +2089,7 @@ GNUNET_SCHEDULER_run_with_driver (const struct 
GNUNET_SCHEDULER_Driver *driver,
   GNUNET_NETWORK_fdset_handle_set (sh.rs, pr);
   sh.driver = driver;
   ret = driver->loop (driver->cls,
-          &sh);
+                      &sh);
   GNUNET_NETWORK_fdset_destroy (sh.rs);
   GNUNET_NETWORK_fdset_destroy (sh.ws);
 
@@ -2128,7 +2135,7 @@ select_loop(void *cls,
 }
 
 
-static void
+void
 select_set_wakeup(void *cls,
                   struct GNUNET_TIME_Absolute dt)
 {

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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