From: Christian Grothoff Date: Thu, 5 Jan 2017 19:40:16 +0000 (+0100) Subject: fix uninit variable causing crash on 0 value X-Git-Tag: taler-0.2.1~526 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=47c4d6f8b21347dfee591c503ea290913c52ee31;p=oweals%2Fgnunet.git fix uninit variable causing crash on 0 value --- diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 7c1dfaba2..cec31ff48 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c @@ -574,7 +574,7 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_SERVICE_Handle *service) { - unsigned long long max_parallel_bg_queries = 0; + unsigned long long max_parallel_bg_queries = 16; v6_enabled = GNUNET_NETWORK_test_pf (PF_INET6); v4_enabled = GNUNET_NETWORK_test_pf (PF_INET); @@ -594,7 +594,16 @@ run (void *cls, GNUNET_SCHEDULER_shutdown (); return; } - + if (GNUNET_OK == + GNUNET_CONFIGURATION_get_value_number (c, + "gns", + "MAX_PARALLEL_BACKGROUND_QUERIES", + &max_parallel_bg_queries)) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Number of allowed parallel background queries: %llu\n", + max_parallel_bg_queries); + } dht_handle = GNUNET_DHT_connect (c, (unsigned int) max_parallel_bg_queries); if (NULL == dht_handle) diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c index d61eb723f..5d0a37324 100644 --- a/src/zonemaster/gnunet-service-zonemaster.c +++ b/src/zonemaster/gnunet-service-zonemaster.c @@ -710,7 +710,8 @@ run (void *cls, put_interval = INITIAL_PUT_INTERVAL; zone_publish_time_window_default = DEFAULT_ZONE_PUBLISH_TIME_WINDOW; if (GNUNET_OK == - GNUNET_CONFIGURATION_get_value_time (c, "gns", + GNUNET_CONFIGURATION_get_value_time (c, + "zonemaster", "ZONE_PUBLISH_TIME_WINDOW", &zone_publish_time_window_default)) { @@ -721,7 +722,8 @@ run (void *cls, } zone_publish_time_window = zone_publish_time_window_default; if (GNUNET_OK == - GNUNET_CONFIGURATION_get_value_number (c, "gns", + GNUNET_CONFIGURATION_get_value_number (c, + "zonemaster", "MAX_PARALLEL_BACKGROUND_QUERIES", &max_parallel_bg_queries)) {