gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated (b2cf59bdd -> 1aa0d5f34)


From: gnunet
Subject: [gnunet] branch master updated (b2cf59bdd -> 1aa0d5f34)
Date: Thu, 23 Sep 2021 22:52:52 +0200

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

grothoff pushed a change to branch master
in repository gnunet.

    from b2cf59bdd -finish first draft implementation of dhtu over GNUnet (old, 
not TNG)
     new 8f18cbcaf -add first dhtu test skeleton
     new 1aa0d5f34 PQ: implementing #7014: support testing database version is 
current

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/dhtu/Makefile.am                               |  16 +++
 .../test_dhtu_ip.c}                                |  49 ++++---
 src/include/gnunet_pq_lib.h                        | 102 +++++++++++--
 src/pq/pq.h                                        |   5 +
 src/pq/pq_connect.c                                | 158 +++++++++++++--------
 src/pq/pq_exec.c                                   |   2 +-
 src/util/child_management.c                        |  47 +++---
 7 files changed, 264 insertions(+), 115 deletions(-)
 copy src/{testing/test_testing_hello_world.c => dhtu/test_dhtu_ip.c} (63%)

diff --git a/src/dhtu/Makefile.am b/src/dhtu/Makefile.am
index 33c31dd6c..61ca84ee3 100644
--- a/src/dhtu/Makefile.am
+++ b/src/dhtu/Makefile.am
@@ -39,3 +39,19 @@ libgnunet_plugin_dhtu_gnunet_la_LIBADD = \
   $(LTLIBINTL)
 libgnunet_plugin_dhtu_gnunet_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
+
+
+test_dhtu_ip_SOURCES = \
+ test_dhtu_ip.c
+test_dhtu_ip_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
+ $(top_builddir)/src/util/libgnunetutil.la
+
+check_PROGRAMS = \
+ test_dhtu_ip
+
+if ENABLE_TEST_RUN
+AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export 
PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset 
XDG_CONFIG_HOME;
+TESTS = \
+ $(check_PROGRAMS)
+endif
diff --git a/src/testing/test_testing_hello_world.c b/src/dhtu/test_dhtu_ip.c
similarity index 63%
copy from src/testing/test_testing_hello_world.c
copy to src/dhtu/test_dhtu_ip.c
index 6300e26a4..f350905b8 100644
--- a/src/testing/test_testing_hello_world.c
+++ b/src/dhtu/test_dhtu_ip.c
@@ -19,50 +19,59 @@
  */
 
 /**
- * @file testing/test_testing_hello_world.c
- * @brief hello world test case
- * @author t3sserakt
+ * @file dhtu/test_dhtu_ip.c
+ * @brief Test case for the DHTU implementation for IP
+ * @author Christian Grothoff
  */
 #include "platform.h"
 #include "gnunet_testing_ng_lib.h"
 #include "gnunet_util_lib.h"
 
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120)
+
+#define CONFIG_FILE "test_dhtu_ip.conf"
+
+
+/**
+ * Return value of the test.
+ *
+ */
+static int rv;
+
+
 /**
  * Main function to run the test cases.
  *
  * @param cls not used.
- *
  */
 static void
 run (void *cls)
 {
-  (void *) cls;
-  struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
-
   struct GNUNET_TESTING_Command commands[] = {
-    GNUNET_TESTING_cmd_hello_world_birth ("hello-world-birth-0",
-                                          &now),
-    GNUNET_TESTING_cmd_hello_world ("hello-world-0","hello-world-birth-0",""),
+    GNUNET_TESTING_cmd_netjail_start_v2 ("netjail-start",
+                                         CONFIG_FILE),
+    GNUNET_TESTING_cmd_netjail_stop_v2 ("netjail-stop",
+                                        CONFIG_FILE),
     GNUNET_TESTING_cmd_end ()
   };
 
-  GNUNET_TESTING_run (NULL,
-                      commands,
-                      GNUNET_TIME_UNIT_FOREVER_REL);
+  (void) cls;
+  if (GNUNET_OK !=
+      GNUNET_TESTING_run (NULL, /* config file */
+                          commands,
+                          TIMEOUT))
+  {
+    GNUNET_break (0);
+    rv = EXIT_FAILURE;
+  }
 }
 
+
 int
 main (int argc,
       char *const *argv)
 {
-  int rv = 0;
-
-  GNUNET_log_setup ("test-hello-world",
-                    "DEBUG",
-                    NULL);
-
   GNUNET_SCHEDULER_run (&run,
                         NULL);
-
   return rv;
 }
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h
index fe3fabbea..6a2227581 100644
--- a/src/include/gnunet_pq_lib.h
+++ b/src/include/gnunet_pq_lib.h
@@ -470,7 +470,8 @@ GNUNET_PQ_result_spec_absolute_time_nbo (const char *name,
  * @return array entry for the result specification to use
  */
 struct GNUNET_PQ_ResultSpec
-GNUNET_PQ_result_spec_uint16 (const char *name, uint16_t *u16);
+GNUNET_PQ_result_spec_uint16 (const char *name,
+                              uint16_t *u16);
 
 
 /**
@@ -481,7 +482,8 @@ GNUNET_PQ_result_spec_uint16 (const char *name, uint16_t 
*u16);
  * @return array entry for the result specification to use
  */
 struct GNUNET_PQ_ResultSpec
-GNUNET_PQ_result_spec_uint32 (const char *name, uint32_t *u32);
+GNUNET_PQ_result_spec_uint32 (const char *name,
+                              uint32_t *u32);
 
 
 /**
@@ -492,7 +494,8 @@ GNUNET_PQ_result_spec_uint32 (const char *name, uint32_t 
*u32);
  * @return array entry for the result specification to use
  */
 struct GNUNET_PQ_ResultSpec
-GNUNET_PQ_result_spec_uint64 (const char *name, uint64_t *u64);
+GNUNET_PQ_result_spec_uint64 (const char *name,
+                              uint64_t *u64);
 
 
 /* ************************* pq.c functions ************************ */
@@ -641,11 +644,11 @@ GNUNET_PQ_eval_prepared_multi_select (struct 
GNUNET_PQ_Context *db,
  *         codes to `enum GNUNET_DB_QueryStatus`.
  */
 enum GNUNET_DB_QueryStatus
-GNUNET_PQ_eval_prepared_singleton_select (struct GNUNET_PQ_Context *db,
-                                          const char *statement_name,
-                                          const struct
-                                          GNUNET_PQ_QueryParam *params,
-                                          struct GNUNET_PQ_ResultSpec *rs);
+GNUNET_PQ_eval_prepared_singleton_select (
+  struct GNUNET_PQ_Context *db,
+  const char *statement_name,
+  const struct GNUNET_PQ_QueryParam *params,
+  struct GNUNET_PQ_ResultSpec *rs);
 
 
 /* ******************** pq_prepare.c functions ************** */
@@ -772,7 +775,7 @@ GNUNET_PQ_make_try_execute (const char *sql);
  * @return #GNUNET_OK on success (modulo statements where errors can be 
ignored)
  *         #GNUNET_SYSERR on error
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_PQ_exec_statements (struct GNUNET_PQ_Context *db,
                            const struct GNUNET_PQ_ExecuteStatement *es);
 
@@ -780,6 +783,29 @@ GNUNET_PQ_exec_statements (struct GNUNET_PQ_Context *db,
 /* ******************** pq_connect.c functions ************** */
 
 
+/**
+ * Flags to control PQ operation.
+ */
+enum GNUNET_PQ_Options
+{
+  /**
+   * Traditional default. Do nothing special.
+   */
+  GNUNET_PQ_FLAG_NONE = 0,
+
+  /**
+   * Dropping database. Do not attempt to initialize
+   * versioning schema if not present.
+   */
+  GNUNET_PQ_FLAG_DROP = 1,
+
+  /**
+   * Check database version is current.  Fail to connect if it is not.
+   */
+  GNUNET_PQ_FLAG_CHECK_CURRENT = 2
+};
+
+
 /**
  * Create a connection to the Postgres database using @a config_str for the
  * configuration.  Initialize logging via GNUnet's log routines and disable
@@ -809,6 +835,37 @@ GNUNET_PQ_connect (const char *config_str,
                    const struct GNUNET_PQ_PreparedStatement *ps);
 
 
+/**
+ * Create a connection to the Postgres database using @a config_str for the
+ * configuration.  Initialize logging via GNUnet's log routines and disable
+ * Postgres's logger.  Also ensures that the statements in @a load_path and @a
+ * es are executed whenever we (re)connect to the database, and that the
+ * prepared statements in @a ps are "ready".  If statements in @es fail that
+ * were created with #GNUNET_PQ_make_execute(), then the entire operation
+ * fails.
+ *
+ * In @a load_path, a list of "$XXXX.sql" files is expected where $XXXX
+ * must be a sequence of contiguous integer values starting at 0000.
+ * These files are then loaded in sequence using "psql $config_str" before
+ * running statements from @e es.  The directory is inspected again on
+ * reconnect.
+ *
+ * @param config_str configuration to use
+ * @param load_path path to directory with SQL transactions to run, can be NULL
+ * @param es #GNUNET_PQ_PREPARED_STATEMENT_END-terminated
+ *            array of statements to execute upon EACH connection, can be NULL
+ * @param ps array of prepared statements to prepare, can be NULL
+ * @param flags connection flags
+ * @return NULL on error
+ */
+struct GNUNET_PQ_Context *
+GNUNET_PQ_connect2 (const char *config_str,
+                    const char *load_path,
+                    const struct GNUNET_PQ_ExecuteStatement *es,
+                    const struct GNUNET_PQ_PreparedStatement *ps,
+                    enum GNUNET_PQ_Options flags);
+
+
 /**
  * Connect to a postgres database using the configuration
  * option "CONFIG" in @a section.  Also ensures that the
@@ -834,6 +891,33 @@ GNUNET_PQ_connect_with_cfg (const struct 
GNUNET_CONFIGURATION_Handle *cfg,
                             const struct GNUNET_PQ_PreparedStatement *ps);
 
 
+/**
+ * Connect to a postgres database using the configuration
+ * option "CONFIG" in @a section.  Also ensures that the
+ * statements in @a es are executed whenever we (re)connect to the
+ * database, and that the prepared statements in @a ps are "ready".
+ *
+ * The caller does not have to ensure that @a es and @a ps remain allocated
+ * and initialized in memory until #GNUNET_PQ_disconnect() is called, as a 
copy will be made.
+ *
+ * @param cfg configuration
+ * @param section configuration section to use to get Postgres configuration 
options
+ * @param load_path_suffix suffix to append to the SQL_DIR in the configuration
+ * @param es #GNUNET_PQ_PREPARED_STATEMENT_END-terminated
+ *            array of statements to execute upon EACH connection, can be NULL
+ * @param ps array of prepared statements to prepare, can be NULL
+ * @param flags connection flags
+ * @return the postgres handle, NULL on error
+ */
+struct GNUNET_PQ_Context *
+GNUNET_PQ_connect_with_cfg2 (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                             const char *section,
+                             const char *load_path_suffix,
+                             const struct GNUNET_PQ_ExecuteStatement *es,
+                             const struct GNUNET_PQ_PreparedStatement *ps,
+                             enum GNUNET_PQ_Options flags);
+
+
 /**
  * Reinitialize the database @a db if the connection is down.
  *
diff --git a/src/pq/pq.h b/src/pq/pq.h
index d10931d99..354d85a9f 100644
--- a/src/pq/pq.h
+++ b/src/pq/pq.h
@@ -73,6 +73,11 @@ struct GNUNET_PQ_Context
    * File descriptor wrapper for @e event_task.
    */
   struct GNUNET_NETWORK_Handle *rfd;
+
+  /**
+   * Flags controlling the connection.
+   */
+  enum GNUNET_PQ_Options flags;
 };
 
 
diff --git a/src/pq/pq_connect.c b/src/pq/pq_connect.c
index a2dce3fb0..a63d5f14e 100644
--- a/src/pq/pq_connect.c
+++ b/src/pq/pq_connect.c
@@ -1,6 +1,6 @@
 /*
    This file is part of GNUnet
-   Copyright (C) 2017, 2019, 2020 GNUnet e.V.
+   Copyright (C) 2017, 2019, 2020, 2021 GNUnet e.V.
 
    GNUnet is free software: you can redistribute it and/or modify it
    under the terms of the GNU Affero General Public License as published
@@ -69,6 +69,21 @@ GNUNET_PQ_connect (const char *config_str,
                    const char *load_path,
                    const struct GNUNET_PQ_ExecuteStatement *es,
                    const struct GNUNET_PQ_PreparedStatement *ps)
+{
+  return GNUNET_PQ_connect2 (config_str,
+                             load_path,
+                             es,
+                             ps,
+                             GNUNET_PQ_FLAG_NONE);
+}
+
+
+struct GNUNET_PQ_Context *
+GNUNET_PQ_connect2 (const char *config_str,
+                    const char *load_path,
+                    const struct GNUNET_PQ_ExecuteStatement *es,
+                    const struct GNUNET_PQ_PreparedStatement *ps,
+                    enum GNUNET_PQ_Options flags)
 {
   struct GNUNET_PQ_Context *db;
   unsigned int elen = 0;
@@ -82,6 +97,7 @@ GNUNET_PQ_connect (const char *config_str,
       plen++;
 
   db = GNUNET_new (struct GNUNET_PQ_Context);
+  db->flags = flags;
   db->config_str = GNUNET_strdup (config_str);
   if (NULL != load_path)
     db->load_path = GNUNET_strdup (load_path);
@@ -200,68 +216,72 @@ GNUNET_PQ_run_sql (struct GNUNET_PQ_Context *db,
               load_path);
   for (unsigned int i = 1; i<10000; i++)
   {
+    char patch_name[slen];
+    char buf[slen];
     enum GNUNET_DB_QueryStatus qs;
-    {
-      char buf[slen];
-
-      /* First, check patch actually exists */
-      GNUNET_snprintf (buf,
-                       sizeof (buf),
-                       "%s%04u.sql",
-                       load_path,
-                       i);
-      if (GNUNET_YES !=
-          GNUNET_DISK_file_test (buf))
-        return GNUNET_OK;   /* We are done */
-    }
+
+    /* First, check patch actually exists */
+    GNUNET_snprintf (buf,
+                     sizeof (buf),
+                     "%s%04u.sql",
+                     load_path,
+                     i);
+    if (GNUNET_YES !=
+        GNUNET_DISK_file_test (buf))
+      return GNUNET_OK;     /* We are done */
 
     /* Second, check with DB versioning schema if this patch was already 
applied,
        if so, skip it. */
+    GNUNET_snprintf (patch_name,
+                     sizeof (patch_name),
+                     "%s%04u",
+                     load_path_suffix,
+                     i);
     {
-      char patch_name[slen];
-
-      GNUNET_snprintf (patch_name,
-                       sizeof (patch_name),
-                       "%s%04u",
-                       load_path_suffix,
-                       i);
+      char *applied_by;
+      struct GNUNET_PQ_QueryParam params[] = {
+        GNUNET_PQ_query_param_string (patch_name),
+        GNUNET_PQ_query_param_end
+      };
+      struct GNUNET_PQ_ResultSpec rs[] = {
+        GNUNET_PQ_result_spec_string ("applied_by",
+                                      &applied_by),
+        GNUNET_PQ_result_spec_end
+      };
+
+      qs = GNUNET_PQ_eval_prepared_singleton_select (db,
+                                                     "gnunet_pq_check_patch",
+                                                     params,
+                                                     rs);
+      if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
+      {
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                    "Database version %s already applied by %s, skipping\n",
+                    patch_name,
+                    applied_by);
+        GNUNET_PQ_cleanup_result (rs);
+      }
+      if (GNUNET_DB_STATUS_HARD_ERROR == qs)
       {
-        char *applied_by;
-        struct GNUNET_PQ_QueryParam params[] = {
-          GNUNET_PQ_query_param_string (patch_name),
-          GNUNET_PQ_query_param_end
-        };
-        struct GNUNET_PQ_ResultSpec rs[] = {
-          GNUNET_PQ_result_spec_string ("applied_by",
-                                        &applied_by),
-          GNUNET_PQ_result_spec_end
-        };
-
-        qs = GNUNET_PQ_eval_prepared_singleton_select (db,
-                                                       "gnunet_pq_check_patch",
-                                                       params,
-                                                       rs);
-        if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
-        {
-          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                      "Database version %s already applied by %s, skipping\n",
-                      patch_name,
-                      applied_by);
-          GNUNET_PQ_cleanup_result (rs);
-        }
-        if (GNUNET_DB_STATUS_HARD_ERROR == qs)
-        {
-          GNUNET_break (0);
-          return GNUNET_SYSERR;
-        }
+        GNUNET_break (0);
+        return GNUNET_SYSERR;
       }
     }
     if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
       continue; /* patch already applied, skip it */
 
-    /* patch not yet applied, run it! */
+    if (0 != (GNUNET_PQ_FLAG_CHECK_CURRENT & db->flags))
     {
-      int ret;
+      /* We are only checking, found unapplied patch, bad! */
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Database outdated, patch %s missing. Aborting!\n",
+                  patch_name);
+      return GNUNET_SYSERR;
+    }
+    else
+    {
+      /* patch not yet applied, run it! */
+      enum GNUNET_GenericReturnValue ret;
 
       ret = apply_patch (db,
                          load_path,
@@ -334,9 +354,17 @@ GNUNET_PQ_reconnect (struct GNUNET_PQ_Context *db)
                      NULL);
     if (PGRES_COMMAND_OK != PQresultStatus (res))
     {
-      int ret;
+      enum GNUNET_GenericReturnValue ret;
 
       PQclear (res);
+      if (0 != (db->flags & GNUNET_PQ_FLAG_DROP))
+      {
+        GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                    "Failed to prepare statement to check patch level. Likely 
versioning schema does not exist yet. Not attempting drop!\n");
+        PQfinish (db->conn);
+        db->conn = NULL;
+        return;
+      }
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "Failed to prepare statement to check patch level. Likely 
versioning schema does not exist yet, loading patch level 0000!\n");
       ret = apply_patch (db,
@@ -423,6 +451,23 @@ GNUNET_PQ_connect_with_cfg (const struct 
GNUNET_CONFIGURATION_Handle *cfg,
                             const char *load_path_suffix,
                             const struct GNUNET_PQ_ExecuteStatement *es,
                             const struct GNUNET_PQ_PreparedStatement *ps)
+{
+  return GNUNET_PQ_connect_with_cfg2 (cfg,
+                                      section,
+                                      load_path_suffix,
+                                      es,
+                                      ps,
+                                      GNUNET_PQ_FLAG_NONE);
+}
+
+
+struct GNUNET_PQ_Context *
+GNUNET_PQ_connect_with_cfg2 (const struct GNUNET_CONFIGURATION_Handle *cfg,
+                             const char *section,
+                             const char *load_path_suffix,
+                             const struct GNUNET_PQ_ExecuteStatement *es,
+                             const struct GNUNET_PQ_PreparedStatement *ps,
+                             enum GNUNET_PQ_Options flags)
 {
   struct GNUNET_PQ_Context *db;
   char *conninfo;
@@ -447,10 +492,11 @@ GNUNET_PQ_connect_with_cfg (const struct 
GNUNET_CONFIGURATION_Handle *cfg,
                      "%s%s",
                      sp,
                      load_path_suffix);
-  db = GNUNET_PQ_connect (conninfo == NULL ? "" : conninfo,
-                          load_path,
-                          es,
-                          ps);
+  db = GNUNET_PQ_connect2 (conninfo == NULL ? "" : conninfo,
+                           load_path,
+                           es,
+                           ps,
+                           flags);
   GNUNET_free (load_path);
   GNUNET_free (sp);
   GNUNET_free (conninfo);
diff --git a/src/pq/pq_exec.c b/src/pq/pq_exec.c
index fd4feae53..464fff4b4 100644
--- a/src/pq/pq_exec.c
+++ b/src/pq/pq_exec.c
@@ -72,7 +72,7 @@ GNUNET_PQ_make_try_execute (const char *sql)
  * @return #GNUNET_OK on success (modulo statements where errors can be 
ignored)
  *         #GNUNET_SYSERR on error
  */
-int
+enum GNUNET_GenericReturnValue
 GNUNET_PQ_exec_statements (struct GNUNET_PQ_Context *db,
                            const struct GNUNET_PQ_ExecuteStatement *es)
 {
diff --git a/src/util/child_management.c b/src/util/child_management.c
index 3afd682b9..4ef42dba2 100644
--- a/src/util/child_management.c
+++ b/src/util/child_management.c
@@ -91,15 +91,10 @@ maint_child_death (void *cls)
 
   (void) cls;
   sig_task = NULL;
-
-  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-              "Received SIGCHLD.\n");
-
   /* drain pipe */
   pr = GNUNET_DISK_pipe_handle (sigpipe,
                                 GNUNET_DISK_PIPE_END_READ);
   GNUNET_assert (! GNUNET_DISK_handle_invalid (pr));
-
   (void) GNUNET_DISK_file_read (pr,
                                 buf,
                                 sizeof(buf));
@@ -159,9 +154,8 @@ sighandler_child_death (void)
 }
 
 
-// void __attribute__ ((constructor))
 static void
-child_management_start ()
+child_management_start (void)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Trying to start child management.\n");
@@ -170,19 +164,24 @@ child_management_start ()
   sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
   GNUNET_assert (sigpipe != NULL);
   shc_chld =
-    GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death);
+    GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD,
+                                   &sighandler_child_death);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Child management started.\n");
 }
 
+
 /**
  * Clean up.
  */
-// void __attribute__ ((destructor))
 static void
-child_management_done ()
+child_management_done (void)
 {
-  GNUNET_assert (NULL == sig_task);
+  if (NULL != sig_task)
+  {
+    GNUNET_SCHEDULER_cancel (sig_task);
+    sig_task = NULL;
+  }
   GNUNET_SIGNAL_handler_uninstall (shc_chld);
   shc_chld = NULL;
   GNUNET_DISK_pipe_close (sigpipe);
@@ -191,6 +190,7 @@ child_management_done ()
               "Child management stopped.\n");
 }
 
+
 struct GNUNET_ChildWaitHandle *
 GNUNET_wait_child (struct GNUNET_OS_Process *proc,
                    GNUNET_ChildCompletedCallback cb,
@@ -198,9 +198,6 @@ GNUNET_wait_child (struct GNUNET_OS_Process *proc,
 {
   struct GNUNET_ChildWaitHandle *cwh;
 
-  LOG (GNUNET_ERROR_TYPE_ERROR,
-       "Adding child!\n");
-
   child_management_start ();
   cwh = GNUNET_new (struct GNUNET_ChildWaitHandle);
   cwh->proc = proc;
@@ -221,23 +218,15 @@ GNUNET_wait_child (struct GNUNET_OS_Process *proc,
   return cwh;
 }
 
+
 void
 GNUNET_wait_child_cancel (struct GNUNET_ChildWaitHandle *cwh)
 {
-  if ((NULL != cwh_head))
-  {
-    GNUNET_CONTAINER_DLL_remove (cwh_head,
-                                 cwh_tail,
-                                 cwh);
-  }
-  if (NULL == cwh_head)
-  {
-    child_management_done ();
-  }
-  if (NULL != sig_task)
-  {
-    GNUNET_SCHEDULER_cancel (sig_task);
-    sig_task = NULL;
-  }
+  GNUNET_CONTAINER_DLL_remove (cwh_head,
+                               cwh_tail,
+                               cwh);
   GNUNET_free (cwh);
+  if (NULL != cwh_head)
+    return;
+  child_management_done ();
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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