move get quota config to addrs
authorChristian Grothoff <christian@grothoff.org>
Sun, 16 Oct 2011 13:58:36 +0000 (13:58 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 16 Oct 2011 13:58:36 +0000 (13:58 +0000)
src/ats/gnunet-service-ats.c
src/ats/gnunet-service-ats_addresses.c
src/ats/gnunet-service-ats_addresses.h
src/ats/gnunet-service-ats_scheduling.c
src/ats/gnunet-service-ats_scheduling.h

index d3f81865304d8dd6d5d6c1ac3bb237cdc3b8e2ca..a2c0e8c7335db22bffaa00002442f8dce3c96477 100644 (file)
@@ -131,8 +131,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   };
   GAS_reservations_init ();
   GAS_performance_init (server);
-  GAS_scheduling_init (server, cfg);
-  GAS_addresses_init ();
+  GAS_scheduling_init (server);
+  GAS_addresses_init (cfg);
   GNUNET_SERVER_disconnect_notify (server, 
                                   &client_disconnect_handler,
                                    NULL);
index 17675ed94003c6000952baf35d13e2ea377af20d..eda7093e78df59fa88912b38a74531754079e647 100644 (file)
@@ -55,6 +55,11 @@ struct ATS_Address
 static struct GNUNET_CONTAINER_MultiHashMap * addresses;
 
 
+static unsigned long long total_quota_in;
+
+static unsigned long long total_quota_out;
+
+
 struct CompareAddressContext
 {
   struct ATS_Address * search;
@@ -252,10 +257,22 @@ GAS_addresses_request_address (const struct GNUNET_PeerIdentity *peer)
 
 /**
  * Initialize address subsystem.
+ *
+ * @param cfg configuration to use
  */
 void
-GAS_addresses_init ()
+GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
+  GNUNET_assert (GNUNET_OK ==
+                GNUNET_CONFIGURATION_get_value_number (cfg,
+                                                       "core",
+                                                       "TOTAL_QUOTA_IN",
+                                                       &total_quota_in));
+  GNUNET_assert (GNUNET_OK ==
+                GNUNET_CONFIGURATION_get_value_number (cfg,
+                                                       "core",
+                                                       "TOTAL_QUOTA_OUT",
+                                                       &total_quota_out));
   addresses = GNUNET_CONTAINER_multihashmap_create(128);
 }
 
index dc70bf553c0701976c0643451c66ae52fca673ca..849e9b31a8e127561602b52361dbcb02510a2ceb 100644 (file)
 
 /**
  * Initialize address subsystem.
+ * @param cfg configuration to use
  */
 void
-GAS_addresses_init (void);
+GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
 
 
 /**
index 8125b8664c2e538b451a89545a58f09d6a176de7..ca4e86ca483cb98d7e493402b1a3d92e0f0b7f93 100644 (file)
@@ -73,10 +73,6 @@ static struct SchedulingClient *sc_tail;
  */
 static struct GNUNET_SERVER_NotificationContext *nc;
 
-static unsigned long long total_quota_in;
-
-static unsigned long long total_quota_out;
-
 
 /**
  * Find the scheduling client associated with the given
@@ -359,22 +355,10 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
  * Initialize scheduling subsystem.
  *
  * @param server handle to our server
- * @param cfg configuration to use
  */
 void
-GAS_scheduling_init (struct GNUNET_SERVER_Handle *server,
-                    const struct GNUNET_CONFIGURATION_Handle *cfg)
+GAS_scheduling_init (struct GNUNET_SERVER_Handle *server)                   
 {
-  GNUNET_assert (GNUNET_OK ==
-                GNUNET_CONFIGURATION_get_value_number (cfg,
-                                                       "core",
-                                                       "TOTAL_QUOTA_IN",
-                                                       &total_quota_in));
-  GNUNET_assert (GNUNET_OK ==
-                GNUNET_CONFIGURATION_get_value_number (cfg,
-                                                       "core",
-                                                       "TOTAL_QUOTA_OUT",
-                                                       &total_quota_out));
   nc = GNUNET_SERVER_notification_context_create (server, 128);
 }
 
index 273126fffa2f5a8de3ebc747e9ece5b20d877bcb..8d6fa977d28973ad1edf0fbe6fb5dee9797699c2 100644 (file)
@@ -117,11 +117,9 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
  * Initialize scheduling subsystem.
  *
  * @param server handle to our server
- * @param cfg configuration to use
  */
 void
-GAS_scheduling_init (struct GNUNET_SERVER_Handle *server,
-                    const struct GNUNET_CONFIGURATION_Handle *cfg);
+GAS_scheduling_init (struct GNUNET_SERVER_Handle *server);
 
 
 /**