aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-service-testbed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/gnunet-service-testbed.c')
-rw-r--r--src/testbed/gnunet-service-testbed.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c
index c4a30f12c..0736f5997 100644
--- a/src/testbed/gnunet-service-testbed.c
+++ b/src/testbed/gnunet-service-testbed.c
@@ -538,6 +538,11 @@ struct LinkControllersContext
538 */ 538 */
539static struct Context *master_context; 539static struct Context *master_context;
540 540
541/**
542 * Our hostname; we give this to all the peers we start
543 */
544static char *hostname;
545
541/***********/ 546/***********/
542/* Handles */ 547/* Handles */
543/***********/ 548/***********/
@@ -1237,7 +1242,7 @@ handle_init (void *cls, struct GNUNET_SERVER_Client *client,
1237 master_context->master_ip = GNUNET_strdup (controller_hostname); 1242 master_context->master_ip = GNUNET_strdup (controller_hostname);
1238 LOG_DEBUG ("Master Controller IP: %s\n", master_context->master_ip); 1243 LOG_DEBUG ("Master Controller IP: %s\n", master_context->master_ip);
1239 master_context->system = 1244 master_context->system =
1240 GNUNET_TESTING_system_create ("testbed", master_context->master_ip); 1245 GNUNET_TESTING_system_create ("testbed", master_context->master_ip, hostname);
1241 host = 1246 host =
1242 GNUNET_TESTBED_host_create_with_id (master_context->host_id, NULL, NULL, 1247 GNUNET_TESTBED_host_create_with_id (master_context->host_id, NULL, NULL,
1243 0); 1248 0);
@@ -2832,6 +2837,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
2832 GNUNET_free (master_context); 2837 GNUNET_free (master_context);
2833 master_context = NULL; 2838 master_context = NULL;
2834 } 2839 }
2840 GNUNET_free_non_null (hostname);
2835} 2841}
2836 2842
2837 2843
@@ -2896,6 +2902,8 @@ testbed_run (void *cls, struct GNUNET_SERVER_Handle *server,
2896 {NULL} 2902 {NULL}
2897 }; 2903 };
2898 2904
2905 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string
2906 (cfg, "testbed", "HOSTNAME", &hostname));
2899 GNUNET_SERVER_add_handlers (server, message_handlers); 2907 GNUNET_SERVER_add_handlers (server, message_handlers);
2900 GNUNET_SERVER_disconnect_notify (server, &client_disconnect_cb, NULL); 2908 GNUNET_SERVER_disconnect_notify (server, &client_disconnect_cb, NULL);
2901 ss_map = GNUNET_CONTAINER_multihashmap_create (5); 2909 ss_map = GNUNET_CONTAINER_multihashmap_create (5);