gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r22941 - gnunet/src/testbed
Date: Fri, 27 Jul 2012 14:02:07 +0200

Author: harsha
Date: 2012-07-27 14:02:07 +0200 (Fri, 27 Jul 2012)
New Revision: 22941

Modified:
   gnunet/src/testbed/gnunet-service-testbed.c
Log:
removed slave context

Modified: gnunet/src/testbed/gnunet-service-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed.c 2012-07-27 11:35:36 UTC (rev 
22940)
+++ gnunet/src/testbed/gnunet-service-testbed.c 2012-07-27 12:02:07 UTC (rev 
22941)
@@ -169,23 +169,6 @@
 
 
 /**
- * Slave startup context
- */
-struct SlaveContext
-{
-  /**
-   * The slave corresponding to this context
-   */
-  struct Slave *slave;
-
-  /**
-   * The configuration used as a template while startup
-   */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
-};
-
-
-/**
  * States of LCFContext
  */
 enum LCFContextState
@@ -768,22 +751,20 @@
                        const struct GNUNET_CONFIGURATION_Handle *cfg,
                        int status)
 {
-  struct SlaveContext *sc = cls;
+  struct Slave *slave = cls;
 
   if (GNUNET_SYSERR == status)
   {
-    sc->slave->controller_proc = NULL;
+    slave->controller_proc = NULL;
     LOG (GNUNET_ERROR_TYPE_WARNING,
          "Unexpected slave shutdown\n");
     GNUNET_SCHEDULER_shutdown ();      /* We too shutdown */
     return;
   }
-  GNUNET_CONFIGURATION_destroy (sc->cfg);
-  sc->slave->controller =
-    GNUNET_TESTBED_controller_connect (cfg, host_list[sc->slave->host_id],
+  slave->controller =
+    GNUNET_TESTBED_controller_connect (cfg, host_list[slave->host_id],
                                        master_context->event_mask,
-                                       &slave_event_callback, sc->slave);
-  GNUNET_free (sc);
+                                       &slave_event_callback, slave);
 }
 
 
@@ -1023,7 +1004,6 @@
 {
   const struct GNUNET_TESTBED_ControllerLinkMessage *msg;
   struct GNUNET_CONFIGURATION_Handle *cfg;
-  struct SlaveContext *sc;
   struct LCFContextQueue *lcfq;
   struct Route *route;
   struct Route *new_route;
@@ -1125,19 +1105,23 @@
       return;
     }
     slave = GNUNET_malloc (sizeof (struct Slave));
-    slave->host_id = delegated_host_id;
-    slave_list_add (slave);
-    sc = GNUNET_malloc (sizeof (struct SlaveContext));
-    sc->slave = slave;
-    sc->cfg = cfg;
+    slave->host_id = delegated_host_id;    
+    slave_list_add (slave);    
     if (1 == msg->is_subordinate)
     {
       slave->controller_proc =
         GNUNET_TESTBED_controller_start (master_context->master_ip,
                                         host_list[slave->host_id],
                                         cfg, &slave_status_callback,
-                                        sc);
-    }    
+                                        slave);
+    }
+    else {
+      slave->controller = 
+       GNUNET_TESTBED_controller_connect (cfg, host_list[slave->host_id],
+                                          master_context->event_mask,
+                                          &slave_event_callback, slave);
+    }
+    GNUNET_CONFIGURATION_destroy (cfg);
     new_route = GNUNET_malloc (sizeof (struct Route));
     new_route->dest = delegated_host_id;
     new_route->thru = master_context->host_id;




reply via email to

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