aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api_hosts.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-12-03 16:46:58 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-12-03 16:46:58 +0000
commit2ee48eea42eca9d2dc7dc4d58ab9cf3f2dbb5066 (patch)
tree8fce122235044be5e6ec93e3372ee5de9a4c7548 /src/testbed/testbed_api_hosts.c
parentf31790d110d6eed2aa78f336f96cc2240bd44c39 (diff)
downloadgnunet-2ee48eea42eca9d2dc7dc4d58ab9cf3f2dbb5066.tar.gz
gnunet-2ee48eea42eca9d2dc7dc4d58ab9cf3f2dbb5066.zip
host compatibility check in GNUNET_TESTBED_run() and fixes
Diffstat (limited to 'src/testbed/testbed_api_hosts.c')
-rw-r--r--src/testbed/testbed_api_hosts.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index e0455d316..6b797b895 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -486,10 +486,10 @@ GNUNET_TESTBED_is_host_registered_ (const struct GNUNET_TESTBED_Host *host,
486 */ 486 */
487struct GNUNET_TESTBED_HostHabitableCheckHandle 487struct GNUNET_TESTBED_HostHabitableCheckHandle
488{ 488{
489 /* /\** */ 489 /**
490 /* * The host to check */ 490 * The host to check
491 /* *\/ */ 491 */
492 /* const struct GNUNET_TESTBED_Host *host; */ 492 const struct GNUNET_TESTBED_Host *host;
493 493
494 /* /\** */ 494 /* /\** */
495 /* * the configuration handle to lookup the path of the testbed helper */ 495 /* * the configuration handle to lookup the path of the testbed helper */
@@ -551,7 +551,8 @@ habitability_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
551{ 551{
552 struct GNUNET_TESTBED_HostHabitableCheckHandle *h = cls; 552 struct GNUNET_TESTBED_HostHabitableCheckHandle *h = cls;
553 void *cb_cls; 553 void *cb_cls;
554 GNUNET_TESTBED_HostHabitableCallback cb; 554 GNUNET_TESTBED_HostHabitableCallback cb;
555 const struct GNUNET_TESTBED_Host *host;
555 unsigned long code; 556 unsigned long code;
556 enum GNUNET_OS_ProcessStatusType type; 557 enum GNUNET_OS_ProcessStatusType type;
557 int ret; 558 int ret;
@@ -584,9 +585,10 @@ habitability_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
584 GNUNET_OS_process_destroy (h->auxp); 585 GNUNET_OS_process_destroy (h->auxp);
585 cb = h->cb; 586 cb = h->cb;
586 cb_cls = h->cb_cls; 587 cb_cls = h->cb_cls;
588 host = h->host;
587 GNUNET_free (h); 589 GNUNET_free (h);
588 if (NULL != cb) 590 if (NULL != cb)
589 cb (cb_cls, ret); 591 cb (cb_cls, host, ret);
590} 592}
591 593
592 594
@@ -616,6 +618,7 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host,
616 h = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_HostHabitableCheckHandle)); 618 h = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_HostHabitableCheckHandle));
617 h->cb = cb; 619 h->cb = cb;
618 h->cb_cls = cb_cls; 620 h->cb_cls = cb_cls;
621 h->host = host;
619 hostname = (NULL == host->hostname) ? "127.0.0.1" : host->hostname; 622 hostname = (NULL == host->hostname) ? "127.0.0.1" : host->hostname;
620 if (NULL == host->username) 623 if (NULL == host->username)
621 h->ssh_addr = GNUNET_strdup (hostname); 624 h->ssh_addr = GNUNET_strdup (hostname);