gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25204 - in gnunet/src: mesh testbed


From: gnunet
Subject: [GNUnet-SVN] r25204 - in gnunet/src: mesh testbed
Date: Mon, 3 Dec 2012 18:31:48 +0100

Author: harsha
Date: 2012-12-03 18:31:48 +0100 (Mon, 03 Dec 2012)
New Revision: 25204

Modified:
   gnunet/src/mesh/gnunet-regex-profiler.c
   gnunet/src/testbed/gnunet-testbed-profiler.c
   gnunet/src/testbed/testbed_api.c
   gnunet/src/testbed/testbed_api_hosts.c
   gnunet/src/testbed/testbed_api_hosts.h
   gnunet/src/testbed/testbed_api_testbed.c
Log:
- remove duplicate functions

Modified: gnunet/src/mesh/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/mesh/gnunet-regex-profiler.c     2012-12-03 17:24:14 UTC (rev 
25203)
+++ gnunet/src/mesh/gnunet-regex-profiler.c     2012-12-03 17:31:48 UTC (rev 
25204)
@@ -1697,8 +1697,23 @@
   static unsigned int hosts_checked;
 
   *hc_handle = NULL;
-  if (++hosts_checked < num_hosts)
+  if (GNUNET_NO == status)
+  {
+    if ((NULL != host) && (NULL != GNUNET_TESTBED_host_get_hostname (host)))
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Host %s cannot start testbed\n"),
+                  GNUNET_TESTBED_host_get_hostname (host));
+    else
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Testbed cannot be started on 
localhost\n"));
+    GNUNET_SCHEDULER_cancel (abort_task);
+    abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
     return;
+  }
+  hosts_checked++;
+  /* printf (_("\rChecked %u hosts"), hosts_checked); */
+  /* fflush (stdout); */
+  if (hosts_checked < num_hosts)
+    return;
+  /* printf (_("\nAll hosts can start testbed. Creating peers\n")); */
   GNUNET_free (hc_handles);
   hc_handles = NULL;
   mc_proc = 
@@ -1742,6 +1757,7 @@
     fprintf (stderr, _("No hosts loaded. Need at least one host\n"));
     return;
   }
+  printf (_("Checking whether given hosts can start testbed. Please wait\n"));
   hc_handles = GNUNET_malloc (sizeof (struct
                                       GNUNET_TESTBED_HostHabitableCheckHandle 
*) 
                               * num_hosts);
@@ -1751,8 +1767,7 @@
                                                                        
&host_habitable_cb,
                                                                        
&hc_handles[nhost])))
     {
-      fprintf (stderr, _("Host %s cannot start testbed\n"),
-                         GNUNET_TESTBED_host_get_hostname (hosts[nhost]));
+      GNUNET_break (0);
       for (nhost = 0; nhost < num_hosts; nhost++)
         if (NULL != hc_handles[nhost])
           GNUNET_TESTBED_is_host_habitable_cancel (hc_handles[nhost]);


Property changes on: gnunet/src/mesh/gnunet-regex-profiler.c
___________________________________________________________________
Modified: svn:mergeinfo
## -1,2 +1,4 ##
 /branches/gnunet/mantis_0001616/src/mesh/gnunet-regex-profiler.c:13878-14093
-/gnunet/src/testbed/gnunet-testbed-profiler.c:25185,25195,25199
+/branches/gnunet/mantis_0001616/src/testbed/gnunet-testbed-profiler.c:13878-14093
+/gnunet/src/testbed/gnunet-testbed-profiler.c:25185,25188,25195,25199,25202
+/gnunet/src/testbed/test_testbed_api_3peers_3controllers.c:25201
\ No newline at end of property
Modified: gnunet/src/testbed/gnunet-testbed-profiler.c
===================================================================
--- gnunet/src/testbed/gnunet-testbed-profiler.c        2012-12-03 17:24:14 UTC 
(rev 25203)
+++ gnunet/src/testbed/gnunet-testbed-profiler.c        2012-12-03 17:31:48 UTC 
(rev 25204)
@@ -719,9 +719,9 @@
   *hc_handle = NULL;
   if (GNUNET_NO == status)
   {
-    if ((NULL != host) && (NULL != GNUNET_TESTBED_host_get_hostname_ (host)))
+    if ((NULL != host) && (NULL != GNUNET_TESTBED_host_get_hostname (host)))
       LOG (GNUNET_ERROR_TYPE_ERROR, _("Host %s cannot start testbed\n"),
-           GNUNET_TESTBED_host_get_hostname_ (host));
+           GNUNET_TESTBED_host_get_hostname (host));
     else
       LOG (GNUNET_ERROR_TYPE_ERROR, _("Testbed cannot be started on 
localhost\n"));
     GNUNET_SCHEDULER_cancel (abort_task);
@@ -737,7 +737,7 @@
   GNUNET_free (hc_handles);
   hc_handles = NULL;
   mc_proc = 
-      GNUNET_TESTBED_controller_start (GNUNET_TESTBED_host_get_hostname_ 
+      GNUNET_TESTBED_controller_start (GNUNET_TESTBED_host_get_hostname 
                                        (hosts[0]),
                                        hosts[0],
                                        cfg,
@@ -786,8 +786,7 @@
                                                                        
&host_habitable_cb,
                                                                        
&hc_handles[nhost])))
     {
-      fprintf (stderr, _("Host %s cannot start testbed\n"),
-              GNUNET_TESTBED_host_get_hostname_ (hosts[nhost]));
+      GNUNET_break (0);
       for (nhost = 0; nhost < num_hosts; nhost++)
         if (NULL != hc_handles[nhost])
           GNUNET_TESTBED_is_host_habitable_cancel (hc_handles[nhost]);

Modified: gnunet/src/testbed/testbed_api.c
===================================================================
--- gnunet/src/testbed/testbed_api.c    2012-12-03 17:24:14 UTC (rev 25203)
+++ gnunet/src/testbed/testbed_api.c    2012-12-03 17:31:48 UTC (rev 25204)
@@ -1169,7 +1169,7 @@
                  (cp->cfg, config, config_size, GNUNET_NO));
   GNUNET_free (config);
   if ((NULL == cp->host) ||
-      (NULL == (hostname = GNUNET_TESTBED_host_get_hostname_ (cp->host))))
+      (NULL == (hostname = GNUNET_TESTBED_host_get_hostname (cp->host))))
     hostname = "localhost";
   /* Change the hostname so that we can connect to it */
   GNUNET_CONFIGURATION_set_value_string (cp->cfg, "testbed", "hostname",
@@ -1409,7 +1409,7 @@
     unsigned int argp;
 
     username = GNUNET_TESTBED_host_get_username_ (host);
-    hostname = GNUNET_TESTBED_host_get_hostname_ (host);
+    hostname = GNUNET_TESTBED_host_get_hostname (host);
     GNUNET_asprintf (&port, "%u", GNUNET_TESTBED_host_get_ssh_port_ (host));
     if (NULL == username)
       GNUNET_asprintf (&dst, "%s", hostname);
@@ -1590,7 +1590,7 @@
       GNUNET_TESTBED_operation_queue_create_
       (controller->num_parallel_connects);
   controller->num_parallel_connects_threshold = 
num_parallel_connects_threshold;
-  controller_hostname = GNUNET_TESTBED_host_get_hostname_ (host);
+  controller_hostname = GNUNET_TESTBED_host_get_hostname (host);
   if (NULL == controller_hostname)
     controller_hostname = "127.0.0.1";
   msg =
@@ -1713,7 +1713,7 @@
 
   if (NULL != controller->rh)
     return NULL;
-  hostname = GNUNET_TESTBED_host_get_hostname_ (host);
+  hostname = GNUNET_TESTBED_host_get_hostname (host);
   if (GNUNET_YES == GNUNET_TESTBED_is_host_registered_ (host, controller))
   {
     LOG (GNUNET_ERROR_TYPE_WARNING, "Host hostname: %s already registered\n",

Modified: gnunet/src/testbed/testbed_api_hosts.c
===================================================================
--- gnunet/src/testbed/testbed_api_hosts.c      2012-12-03 17:24:14 UTC (rev 
25203)
+++ gnunet/src/testbed/testbed_api_hosts.c      2012-12-03 17:31:48 UTC (rev 
25204)
@@ -183,26 +183,13 @@
  * @return hostname of the host
  */
 const char *
-GNUNET_TESTBED_host_get_hostname_ (const struct GNUNET_TESTBED_Host *host)
+GNUNET_TESTBED_host_get_hostname (const struct GNUNET_TESTBED_Host *host)
 {
   return host->hostname;
 }
 
 
 /**
- * Obtain the host's hostname.
- *
- * @param host handle to the host, NULL means 'localhost'
- * @return hostname of the host
- */
-const char *
-GNUNET_TESTBED_host_get_hostname (const struct GNUNET_TESTBED_Host *host)
-{
-  return GNUNET_TESTBED_host_get_hostname_ (host);
-}
-
-
-/**
  * Obtain the host's username
  *
  * @param host handle to the host, NULL means 'localhost'

Modified: gnunet/src/testbed/testbed_api_hosts.h
===================================================================
--- gnunet/src/testbed/testbed_api_hosts.h      2012-12-03 17:24:14 UTC (rev 
25203)
+++ gnunet/src/testbed/testbed_api_hosts.h      2012-12-03 17:31:48 UTC (rev 
25204)
@@ -67,16 +67,6 @@
 
 
 /**
- * Obtain the host's hostname.
- *
- * @param host handle to the host, NULL means 'localhost'
- * @return hostname of the host
- */
-const char *
-GNUNET_TESTBED_host_get_hostname_ (const struct GNUNET_TESTBED_Host *host);
-
-
-/**
  * Obtain the host's username
  *
  * @param host handle to the host, NULL means 'localhost'

Modified: gnunet/src/testbed/testbed_api_testbed.c
===================================================================
--- gnunet/src/testbed/testbed_api_testbed.c    2012-12-03 17:24:14 UTC (rev 
25203)
+++ gnunet/src/testbed/testbed_api_testbed.c    2012-12-03 17:31:48 UTC (rev 
25204)
@@ -848,9 +848,9 @@
   rc->hc_handles[nhost] = NULL;
   if (GNUNET_NO == status)
   {
-    if ((NULL != host) && (NULL != GNUNET_TESTBED_host_get_hostname_ (host)))
+    if ((NULL != host) && (NULL != GNUNET_TESTBED_host_get_hostname (host)))
       LOG (GNUNET_ERROR_TYPE_ERROR, _("Host %s cannot start testbed\n"),
-           GNUNET_TESTBED_host_get_hostname_ (host));
+           GNUNET_TESTBED_host_get_hostname (host));
     else
       LOG (GNUNET_ERROR_TYPE_ERROR, _("Testbed cannot be started on 
localhost\n"));
     GNUNET_SCHEDULER_cancel (rc->shutdown_run_task);
@@ -1013,8 +1013,7 @@
                                                    &host_habitable_cb,
                                                    rc)))
     {
-      LOG (GNUNET_ERROR_TYPE_WARNING, "Host %s cannot start testbed\n",
-              GNUNET_TESTBED_host_get_hostname_ (rc->hosts[nhost]));
+      GNUNET_break (0);
       for (nhost = 0; nhost < rc->num_hosts; nhost++)
         if (NULL != rc->hc_handles[nhost])
           GNUNET_TESTBED_is_host_habitable_cancel (rc->hc_handles[nhost]);




reply via email to

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