-updating dependency diagram
[oweals/gnunet.git] / src / testing_old / testing.c
index 9254d491743bef78b9ce357d30ef2306c1f2960b..8084a8d59ef3d01c6325920fe06de6445e600f0c 100644 (file)
  */
 #define EMPTY_HACK GNUNET_YES
 
+
+/**
+ * After how long do we retry a service connection that was
+ * unavailable?  Used in cases where an exponential back-off
+ * seems inappropriate.
+ */
+#define GNUNET_CONSTANTS_SERVICE_RETRY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 500)
+
+/**
+ * How long do we wait after a FORK+EXEC before testing for the
+ * resulting process to be up (port open, waitpid, etc.)?
+ */
+#define GNUNET_CONSTANTS_EXEC_WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 200)
+
 /**
  * How long do we wait after starting gnunet-service-arm
  * for the core service to be alive?
@@ -1846,7 +1860,7 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                 "Sending connect request to TRANSPORT of %s for peer %s\n",
                 GNUNET_i2s (&ctx->d1->id),
                 GNUNET_h2s (&ctx->d2->id.hashPubKey));
-    GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id);
+    GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id, NULL, NULL); /*FIXME TRY_CONNECT change */
     ctx->timeout_hello =
         GNUNET_TIME_relative_add (ctx->timeout_hello,
                                   GNUNET_TIME_relative_multiply
@@ -1873,7 +1887,7 @@ core_init_notify (void *cls, struct GNUNET_CORE_Handle *server,
 
   if (connect_ctx->send_hello == GNUNET_NO)
   {
-    GNUNET_TRANSPORT_try_connect (connect_ctx->d1th, &connect_ctx->d2->id);
+    GNUNET_TRANSPORT_try_connect (connect_ctx->d1th, &connect_ctx->d2->id, NULL, NULL); /*FIXME TRY_CONNECT change */
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Sending connect request to TRANSPORT of %s for peer %s\n",
                 connect_ctx->d1->shortname, connect_ctx->d2->shortname);
@@ -1954,11 +1968,11 @@ reattempt_daemons_connect (void *cls,
     if (NULL == ctx->d2->th)
     {
       GNUNET_CORE_disconnect (ctx->d1core);
-      GNUNET_free (ctx);
       if (NULL != ctx->cb)
         ctx->cb (ctx->cb_cls, &ctx->d1->id, &ctx->d2->id, 0, ctx->d1->cfg,
                  ctx->d2->cfg, ctx->d1, ctx->d2,
                  _("Failed to connect to transport service!\n"));
+      GNUNET_free (ctx);
       return;
     }
     ctx->d2->ghh =
@@ -1998,7 +2012,7 @@ reattempt_daemons_connect (void *cls,
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to reconnect %s to %s\n",
                 ctx->d1->shortname, ctx->d2->shortname);
-    GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id);
+    GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id, NULL, NULL); /*FIXME TRY_CONNECT change */
   }
   ctx->timeout_task =
       GNUNET_SCHEDULER_add_delayed (ctx->relative_timeout,