diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-13 10:51:45 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-13 10:51:45 +0000 |
commit | 0043aada3f5172d461f89eecc9138b6a1754ca14 (patch) | |
tree | 6970bdc8d0acf430db3b6dee674149a2aeb9273a /src/testbed/testbed_api_testbed.c | |
parent | e27e2a35da519f85d7597890557f83a4d432e414 (diff) | |
download | gnunet-0043aada3f5172d461f89eecc9138b6a1754ca14.tar.gz gnunet-0043aada3f5172d461f89eecc9138b6a1754ca14.zip |
Implement GNUNET_TESTBED_get_statistics() - resolves #2662
Test case for testing GNUNET_TESTBED_get_statistics()
Fix waiting for SHUTDOWN_PEERS reply when controller crashes
Diffstat (limited to 'src/testbed/testbed_api_testbed.c')
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 24ca2653c..3bd6f1db8 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -800,18 +800,21 @@ controller_status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
800 | 800 | ||
801 | if (status != GNUNET_OK) | 801 | if (status != GNUNET_OK) |
802 | { | 802 | { |
803 | switch (rc->state) | 803 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
804 | { | ||
805 | case RC_INIT: | ||
806 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Testbed startup failed\n"); | ||
807 | return; | ||
808 | default: | ||
809 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
810 | "Controller crash detected. Shutting down.\n"); | 804 | "Controller crash detected. Shutting down.\n"); |
811 | rc->cproc = NULL; | 805 | rc->cproc = NULL; |
812 | shutdown_now (rc); | 806 | if (NULL != rc->peers) |
813 | return; | 807 | { |
808 | GNUNET_free (rc->peers); | ||
809 | rc->peers = NULL; | ||
810 | } | ||
811 | if (NULL != rc->c) | ||
812 | { | ||
813 | GNUNET_TESTBED_controller_disconnect (rc->c); | ||
814 | rc->c = NULL; | ||
814 | } | 815 | } |
816 | shutdown_now (rc); | ||
817 | return; | ||
815 | } | 818 | } |
816 | GNUNET_CONFIGURATION_destroy (rc->cfg); | 819 | GNUNET_CONFIGURATION_destroy (rc->cfg); |
817 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); | 820 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); |