twister

HTTP fault injector for testing
Log | Files | Refs | README | LICENSE

commit 9e2e2a7759dad741f060adaf1c11e0fc17f7310b
parent ad58257c5b5fc728faee55aaaea3ce747447a28a
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 16 Jun 2019 01:57:30 +0200

do not assert on bad config, also check return value

Diffstat:
Msrc/twister/taler-twister-service.c | 22++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c @@ -1843,7 +1843,7 @@ create_response (void *cls, flip_path_dl)) { GNUNET_free (flip_path_dl); - flip_path_dl = NULL; + flip_path_dl = NULL; } } @@ -2446,11 +2446,21 @@ run (void *cls, /* No need to check return value. If given, we take, * otherwise it stays zero. */ - GNUNET_CONFIGURATION_get_value_number (c, - "twister", - "CHAOS_RATE", - &chaos_rate); - GNUNET_assert (100 >= chaos_rate); + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_number (c, + "twister", + "CHAOS_RATE", + &chaos_rate)) + chaos_rate = 0; + if (100 < chaos_rate) + { + GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, + "twister", + "CHAOS_RATE", + "must be below 100"); + GNUNET_SCHEDULER_shutdown (); + return; + } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string