fix uninit variable causing crash on 0 value
authorChristian Grothoff <christian@grothoff.org>
Thu, 5 Jan 2017 19:40:16 +0000 (20:40 +0100)
committerChristian Grothoff <christian@grothoff.org>
Thu, 5 Jan 2017 19:40:16 +0000 (20:40 +0100)
src/gns/gnunet-service-gns.c
src/zonemaster/gnunet-service-zonemaster.c

index 7c1dfaba24059571f99b446ae2d7203f79b0791c..cec31ff480fbd0bf0f267769ce04060f15879e26 100644 (file)
@@ -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)
index d61eb723f3f9a3e6c93d41f0d86072d0b7417d72..5d0a373248fa48b841a843489cd8adae351fcef1 100644 (file)
@@ -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))
   {