gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r14620 - gnunet/src/testing


From: gnunet
Subject: [GNUnet-SVN] r14620 - gnunet/src/testing
Date: Wed, 9 Mar 2011 13:06:56 +0100

Author: nevans
Date: 2011-03-09 13:06:56 +0100 (Wed, 09 Mar 2011)
New Revision: 14620

Modified:
   gnunet/src/testing/testing.c
Log:
force connection attempt to core (should core always be listed in 
defaultservices instead?

Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c        2011-03-09 11:08:00 UTC (rev 14619)
+++ gnunet/src/testing/testing.c        2011-03-09 12:06:56 UTC (rev 14620)
@@ -216,6 +216,7 @@
 }
 #endif
 
+#if !WAIT_FOR_HELLO
 /**
  * Notify of a peer being up and running.  Scheduled as a task
  * so that variables which may need to be set are set before
@@ -236,6 +237,7 @@
   if (NULL != cb)
     cb (d->cb_cls, &d->id, d->cfg, d, NULL);
 }
+#endif
 
 /**
  * Finite-state machine for starting GNUnet.
@@ -471,6 +473,7 @@
             cb (d->cb_cls, NULL, d->cfg, d, _("`Failed to get hostkey!\n"));
           return;
         }
+      d->shortname = GNUNET_strdup(GNUNET_i2s(&d->id));
       GNUNET_DISK_pipe_close (d->pipe_stdout);
       d->pipe_stdout = NULL;
       (void) GNUNET_OS_process_kill (d->proc, SIGKILL);
@@ -685,11 +688,11 @@
                    _("Failed to connect to transport service!\n"));
           return;
         }
-    #if DEBUG_TESTING
+#if DEBUG_TESTING
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Connected to transport service `%s', getting HELLO\n",
-                  GNUNET_i2s (my_identity));
-    #endif
+                  GNUNET_i2s (&d->id));
+#endif
 
       GNUNET_TRANSPORT_get_hello (d->th, &process_hello, d);
       GNUNET_SCHEDULER_add_now(&notify_daemon_started, d);
@@ -1759,10 +1762,15 @@
   if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
     return;
   if ((ctx->d1core_ready == GNUNET_YES) && (ctx->d2->hello != NULL)
-      && (NULL != GNUNET_HELLO_get_header (ctx->d2->hello)))
+      && (NULL != GNUNET_HELLO_get_header (ctx->d2->hello))
+      && (ctx->d1->phase == SP_START_DONE)
+      && (ctx->d2->phase == SP_START_DONE))
     {
       hello = GNUNET_HELLO_get_header (ctx->d2->hello);
       GNUNET_assert (hello != NULL);
+#if DEBUG_TESTING
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Offering hello of %s to %s\n", 
ctx->d2->shortname, ctx->d1->shortname);
+#endif
       GNUNET_TRANSPORT_offer_hello (ctx->d1th, hello, NULL, NULL);
       GNUNET_assert (ctx->d1core != NULL);
       ctx->connect_request_handle =
@@ -2023,6 +2031,7 @@
 
   /* Core is up! Iterate over all _known_ peers first to check if we are 
already connected to the peer! */
   GNUNET_assert(GNUNET_OK == GNUNET_CORE_is_peer_connected (ctx->d1->cfg, 
&ctx->d2->id, &core_initial_iteration, ctx));
+  GNUNET_assert(GNUNET_OK == GNUNET_CORE_is_peer_connected (ctx->d2->cfg, 
&ctx->d1->id, NULL, NULL));
   /*GNUNET_assert(GNUNET_OK == GNUNET_CORE_iterate_peers (ctx->d1->cfg, 
&core_initial_iteration, ctx));*/
 }
 




reply via email to

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