gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r24304 - gnunet/src/testbed


From: gnunet
Subject: [GNUnet-SVN] r24304 - gnunet/src/testbed
Date: Sun, 14 Oct 2012 12:49:34 +0200

Author: harsha
Date: 2012-10-14 12:49:34 +0200 (Sun, 14 Oct 2012)
New Revision: 24304

Modified:
   gnunet/src/testbed/gnunet-testbed-profiler.c
Log:
towards peer create

Modified: gnunet/src/testbed/gnunet-testbed-profiler.c
===================================================================
--- gnunet/src/testbed/gnunet-testbed-profiler.c        2012-10-14 09:30:02 UTC 
(rev 24303)
+++ gnunet/src/testbed/gnunet-testbed-profiler.c        2012-10-14 10:49:34 UTC 
(rev 24304)
@@ -80,7 +80,12 @@
   /**
    * Creating peers
    */
-  STATE_PEERS_CREATING
+  STATE_PEERS_CREATING,
+
+  /**
+   * Starting peers
+   */
+  STATE_PEERS_STARTING
 };
 
 
@@ -214,7 +219,7 @@
     GNUNET_TESTBED_controller_stop (mc_proc);
   if (NULL != cfg)
     GNUNET_CONFIGURATION_destroy (cfg);
-  GNUNET_SCHEDULER_shutdown ();        /* Stop scheduler to shutdown testbed 
run */  
+  GNUNET_SCHEDULER_shutdown ();        /* Stop scheduler to shutdown testbed 
run */
 }
 
 
@@ -249,6 +254,7 @@
   struct DLLOperation *dll_op = cls;
   struct GNUNET_TESTBED_Peer **peer_ptr;
   static unsigned int created_peers;
+  unsigned int peer_cnt;
 
   if (NULL != emsg)
   {
@@ -273,6 +279,13 @@
     printf ("All peers created successfully in %.2f seconds\n",
             ((double) prof_time.rel_value) / 1000.00);
     /* Now peers are to be started */
+    state = STATE_PEERS_STARTING;
+    for (peer_cnt = 0; peer_cnt < num_peers; peer_cnt++)
+    {
+      dll_op = GNUNET_malloc (sizeof (struct DLLOperation));
+      dll_op->op = GNUNET_TESTBED_peer_start (peers[peer_cnt], NULL, NULL);
+      GNUNET_CONTAINER_DLL_insert_tail (dll_op_head, dll_op_tail, dll_op);
+    }
   }
 }
 
@@ -299,11 +312,11 @@
       {
         static unsigned int slaves_started;
         unsigned int peer_cnt;
-            
+        
         dll_op = event->details.operation_finished.op_cls;
         GNUNET_CONTAINER_DLL_remove (dll_op_head, dll_op_tail, dll_op);
         GNUNET_free (dll_op);
-       op = event->details.operation_finished.operation;
+        op = event->details.operation_finished.operation;
         if (NULL != event->details.operation_finished.emsg)
         {
           LOG (GNUNET_ERROR_TYPE_WARNING,
@@ -341,6 +354,20 @@
       GNUNET_assert (0);
     }
     break;
+  case STATE_PEERS_STARTING:
+    switch (event->type)
+    {
+    case GNUNET_TESTBED_ET_OPERATION_FINISHED:
+      /* Control reaches here when peer start fails */
+      GNUNET_break (0);
+      break;
+    case GNUNET_TESTBED_ET_PEER_START:
+      GNUNET_break (0);
+      break;
+    default:
+      GNUNET_assert (0);
+    }
+    break;
   default:
     GNUNET_assert (0);
   }




reply via email to

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