diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-13 14:29:54 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-13 14:29:54 +0000 |
commit | d7a4acf7971533111c19ec56b2e145d200ca1cae (patch) | |
tree | 2eba8a08cc5fe7a5dd1e63c32d2c13ec80b21c4b /src | |
parent | e3942b151f9ba6371d6ba949f462fc1bac8fff2d (diff) |
- allow reading hostnames with dashes/hyphens
Diffstat (limited to 'src')
-rw-r--r-- | src/testbed/sample_hosts.txt | 2 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_hosts.c | 4 | ||||
-rw-r--r-- | src/testbed/testbed_api_hosts.c | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/testbed/sample_hosts.txt b/src/testbed/sample_hosts.txt index 5b661696b..d0ce5cb45 100644 --- a/src/testbed/sample_hosts.txt +++ b/src/testbed/sample_hosts.txt @@ -13,3 +13,5 @@ totakura@192.168.0.12:22 totakura@192.168.0.13:22 totakura@192.168.0.14:22 totakura@192.168.0.15:22 +totakura@opt01:22 +totakura@i19-n015:22 diff --git a/src/testbed/test_testbed_api_hosts.c b/src/testbed/test_testbed_api_hosts.c index bf72a326c..17ccc7050 100644 --- a/src/testbed/test_testbed_api_hosts.c +++ b/src/testbed/test_testbed_api_hosts.c @@ -110,11 +110,11 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_assert (host == GNUNET_TESTBED_host_lookup_by_id_ (0)); hosts = NULL; num_hosts = GNUNET_TESTBED_hosts_load_from_file ("sample_hosts.txt", cfg, &hosts); - GNUNET_assert (15 == num_hosts); + GNUNET_assert (17 == num_hosts); GNUNET_assert (NULL != hosts); status = GNUNET_YES; shutdown_id = - GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS (2), &do_shutdown, NULL); + GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS (0), &do_shutdown, NULL); } diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index e76dada88..374fee8ef 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c @@ -486,7 +486,7 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, { data[offset] = '\0'; ret = - SSCANF (buf, "%255[a-zA-Z0-9_]@%255[a-zA-Z0-9.]:%5hd", username, + SSCANF (buf, "%255[a-zA-Z0-9_]@%255[a-zA-Z0-9.-]:%5hd", username, hostname, &port); if (3 == ret) { |