aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-regex-profiler.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-12-03 17:31:48 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-12-03 17:31:48 +0000
commit3497cf2a8e182972cf217e38f9c762f7df4cec2f (patch)
treee663f19307964d9417d5dcf987176c3c858ef2a3 /src/mesh/gnunet-regex-profiler.c
parentac1843fcf0e0bda117d02c6ffbf976a11f379a35 (diff)
downloadgnunet-3497cf2a8e182972cf217e38f9c762f7df4cec2f.tar.gz
gnunet-3497cf2a8e182972cf217e38f9c762f7df4cec2f.zip
- remove duplicate functions
Diffstat (limited to 'src/mesh/gnunet-regex-profiler.c')
-rw-r--r--src/mesh/gnunet-regex-profiler.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mesh/gnunet-regex-profiler.c b/src/mesh/gnunet-regex-profiler.c
index 5e31af47e..14fadd89a 100644
--- a/src/mesh/gnunet-regex-profiler.c
+++ b/src/mesh/gnunet-regex-profiler.c
@@ -1697,8 +1697,23 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host, int status
1697 static unsigned int hosts_checked; 1697 static unsigned int hosts_checked;
1698 1698
1699 *hc_handle = NULL; 1699 *hc_handle = NULL;
1700 if (++hosts_checked < num_hosts) 1700 if (GNUNET_NO == status)
1701 {
1702 if ((NULL != host) && (NULL != GNUNET_TESTBED_host_get_hostname (host)))
1703 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Host %s cannot start testbed\n"),
1704 GNUNET_TESTBED_host_get_hostname (host));
1705 else
1706 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Testbed cannot be started on localhost\n"));
1707 GNUNET_SCHEDULER_cancel (abort_task);
1708 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
1709 return;
1710 }
1711 hosts_checked++;
1712 /* printf (_("\rChecked %u hosts"), hosts_checked); */
1713 /* fflush (stdout); */
1714 if (hosts_checked < num_hosts)
1701 return; 1715 return;
1716 /* printf (_("\nAll hosts can start testbed. Creating peers\n")); */
1702 GNUNET_free (hc_handles); 1717 GNUNET_free (hc_handles);
1703 hc_handles = NULL; 1718 hc_handles = NULL;
1704 mc_proc = 1719 mc_proc =
@@ -1742,6 +1757,7 @@ run (void *cls, char *const *args, const char *cfgfile,
1742 fprintf (stderr, _("No hosts loaded. Need at least one host\n")); 1757 fprintf (stderr, _("No hosts loaded. Need at least one host\n"));
1743 return; 1758 return;
1744 } 1759 }
1760 printf (_("Checking whether given hosts can start testbed. Please wait\n"));
1745 hc_handles = GNUNET_malloc (sizeof (struct 1761 hc_handles = GNUNET_malloc (sizeof (struct
1746 GNUNET_TESTBED_HostHabitableCheckHandle *) 1762 GNUNET_TESTBED_HostHabitableCheckHandle *)
1747 * num_hosts); 1763 * num_hosts);
@@ -1751,8 +1767,7 @@ run (void *cls, char *const *args, const char *cfgfile,
1751 &host_habitable_cb, 1767 &host_habitable_cb,
1752 &hc_handles[nhost]))) 1768 &hc_handles[nhost])))
1753 { 1769 {
1754 fprintf (stderr, _("Host %s cannot start testbed\n"), 1770 GNUNET_break (0);
1755 GNUNET_TESTBED_host_get_hostname (hosts[nhost]));
1756 for (nhost = 0; nhost < num_hosts; nhost++) 1771 for (nhost = 0; nhost < num_hosts; nhost++)
1757 if (NULL != hc_handles[nhost]) 1772 if (NULL != hc_handles[nhost])
1758 GNUNET_TESTBED_is_host_habitable_cancel (hc_handles[nhost]); 1773 GNUNET_TESTBED_is_host_habitable_cancel (hc_handles[nhost]);