Fix double-scheduling of shutdown task
authorDavid Barksdale <amatus@amat.us>
Tue, 2 Jan 2018 17:34:45 +0000 (11:34 -0600)
committerDavid Barksdale <amatus@amat.us>
Tue, 2 Jan 2018 17:36:58 +0000 (11:36 -0600)
src/util/resolver_api.c

index 11b8134d6d78e1a85a6a1d2c6df46c1721a7a2eb..84f541ba04accd06d4f726b2c5717958636bf303 100644 (file)
@@ -414,10 +414,11 @@ process_requests ()
   {
     /* nothing to do, release socket really soon if there is nothing
      * else happening... */
-    s_task =
-      GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
-                                    &shutdown_task,
-                                    NULL);
+    if (NULL == s_task)
+      s_task =
+        GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
+                                      &shutdown_task,
+                                      NULL);
     return;
   }
   if (GNUNET_NO != rh->was_transmitted)