From 44f408a3ed45ee7824a6dcd3705f61792236142b Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Tue, 26 Jun 2012 22:27:48 +0000 Subject: [PATCH] -testbed host registration cancel --- src/testbed/testbed_api.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 4075e1b99..825cf28ba 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c @@ -204,6 +204,11 @@ struct GNUNET_TESTBED_HostRegistrationHandle */ struct GNUNET_TESTBED_Host *host; + /** + * The controller at which this host is being registered + */ + struct GNUNET_TESTBED_Controller *c; + /** * The Registartion completion callback */ @@ -544,6 +549,7 @@ GNUNET_TESTBED_register_host (struct GNUNET_TESTBED_Controller *controller, } rh = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_HostRegistrationHandle)); rh->host = host; + rh->c = controller; GNUNET_assert (NULL != cc); rh->cc = cc; rh->cc_cls = cc_cls; @@ -584,7 +590,13 @@ void GNUNET_TESTBED_cancel_registration (struct GNUNET_TESTBED_HostRegistrationHandle *handle) { - GNUNET_break (0); + if (handle != handle->c->rh) + { + GNUNET_break (0); + return; + } + handle->c->rh = NULL; + GNUNET_free (handle); } -- 2.25.1