gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: always set task NULL when c


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: always set task NULL when cancel; make sure SCHEDULER_add* doesn't get invalid input
Date: Mon, 08 Jan 2018 20:25:11 +0100

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

lurchi pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 5e233bcb4 always set task NULL when cancel; make sure SCHEDULER_add* 
doesn't get invalid input
5e233bcb4 is described below

commit 5e233bcb4b48593af84c551738369fe89bc77251
Author: lurchi <address@hidden>
AuthorDate: Mon Jan 8 20:24:52 2018 +0100

    always set task NULL when cancel; make sure SCHEDULER_add* doesn't get 
invalid input
---
 src/gns/gnunet-gns-proxy.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 3af571eba..25092dcf0 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1957,8 +1957,10 @@ mhd_log_callback (void *cls,
   }
   s5r->url = GNUNET_strdup (url);
   if (NULL != s5r->timeout_task)
+  {
     GNUNET_SCHEDULER_cancel (s5r->timeout_task);
-  s5r->timeout_task = NULL;
+    s5r->timeout_task = NULL;
+  }
   GNUNET_assert (s5r->state == SOCKS5_SOCKET_WITH_MHD);
   return s5r;
 }
@@ -2060,7 +2062,10 @@ schedule_httpd (struct MhdHttpList *hd)
     wws = NULL;
   }
   if (NULL != hd->httpd_task)
+  {
     GNUNET_SCHEDULER_cancel (hd->httpd_task);
+    hd->httpd_task = NULL;
+  }
   if ( (MHD_YES != haveto) &&
        (-1 == max) &&
        (hd != httpd) )
@@ -2108,8 +2113,7 @@ do_httpd (void *cls)
 static void
 run_mhd_now (struct MhdHttpList *hd)
 {
-  if (NULL !=
-      hd->httpd_task)
+  if (NULL != hd->httpd_task)
     GNUNET_SCHEDULER_cancel (hd->httpd_task);
   hd->httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd,
                                              hd);
@@ -2891,18 +2895,17 @@ do_accept (void *cls)
   struct GNUNET_NETWORK_Handle *s;
   struct Socks5Request *s5r;
 
-  if (lsock == lsock4)
-    ltask4 = NULL;
-  else
-    ltask6 = NULL;
+  GNUNET_assert (NULL != lsock);
   if (lsock == lsock4)
     ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
                                             lsock,
                                             &do_accept, lsock);
-  else
+  else if (lsock == lsock6)
     ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
                                             lsock,
                                             &do_accept, lsock);
+  else
+    GNUNET_assert (0);
   s = GNUNET_NETWORK_socket_accept (lsock, NULL, NULL);
   if (NULL == s)
   {

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



reply via email to

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