diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-16 13:58:36 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-16 13:58:36 +0000 |
commit | 3a6c268283d47fd7408063b4b953d5d3cbfa4b11 (patch) | |
tree | 187b9bcbcefb7fd9e6a1dc41cc6d036fb9c1b358 /src | |
parent | 5419748cc47ea35b77a616ff269aae822cab8cea (diff) | |
download | gnunet-3a6c268283d47fd7408063b4b953d5d3cbfa4b11.tar.gz gnunet-3a6c268283d47fd7408063b4b953d5d3cbfa4b11.zip |
move get quota config to addrs
Diffstat (limited to 'src')
-rw-r--r-- | src/ats/gnunet-service-ats.c | 4 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 19 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.h | 3 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_scheduling.c | 18 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_scheduling.h | 4 |
5 files changed, 24 insertions, 24 deletions
diff --git a/src/ats/gnunet-service-ats.c b/src/ats/gnunet-service-ats.c index d3f818653..a2c0e8c73 100644 --- a/src/ats/gnunet-service-ats.c +++ b/src/ats/gnunet-service-ats.c | |||
@@ -131,8 +131,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
131 | }; | 131 | }; |
132 | GAS_reservations_init (); | 132 | GAS_reservations_init (); |
133 | GAS_performance_init (server); | 133 | GAS_performance_init (server); |
134 | GAS_scheduling_init (server, cfg); | 134 | GAS_scheduling_init (server); |
135 | GAS_addresses_init (); | 135 | GAS_addresses_init (cfg); |
136 | GNUNET_SERVER_disconnect_notify (server, | 136 | GNUNET_SERVER_disconnect_notify (server, |
137 | &client_disconnect_handler, | 137 | &client_disconnect_handler, |
138 | NULL); | 138 | NULL); |
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index 17675ed94..eda7093e7 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -55,6 +55,11 @@ struct ATS_Address | |||
55 | static struct GNUNET_CONTAINER_MultiHashMap * addresses; | 55 | static struct GNUNET_CONTAINER_MultiHashMap * addresses; |
56 | 56 | ||
57 | 57 | ||
58 | static unsigned long long total_quota_in; | ||
59 | |||
60 | static unsigned long long total_quota_out; | ||
61 | |||
62 | |||
58 | struct CompareAddressContext | 63 | struct CompareAddressContext |
59 | { | 64 | { |
60 | struct ATS_Address * search; | 65 | struct ATS_Address * search; |
@@ -252,10 +257,22 @@ GAS_addresses_request_address (const struct GNUNET_PeerIdentity *peer) | |||
252 | 257 | ||
253 | /** | 258 | /** |
254 | * Initialize address subsystem. | 259 | * Initialize address subsystem. |
260 | * | ||
261 | * @param cfg configuration to use | ||
255 | */ | 262 | */ |
256 | void | 263 | void |
257 | GAS_addresses_init () | 264 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg) |
258 | { | 265 | { |
266 | GNUNET_assert (GNUNET_OK == | ||
267 | GNUNET_CONFIGURATION_get_value_number (cfg, | ||
268 | "core", | ||
269 | "TOTAL_QUOTA_IN", | ||
270 | &total_quota_in)); | ||
271 | GNUNET_assert (GNUNET_OK == | ||
272 | GNUNET_CONFIGURATION_get_value_number (cfg, | ||
273 | "core", | ||
274 | "TOTAL_QUOTA_OUT", | ||
275 | &total_quota_out)); | ||
259 | addresses = GNUNET_CONTAINER_multihashmap_create(128); | 276 | addresses = GNUNET_CONTAINER_multihashmap_create(128); |
260 | } | 277 | } |
261 | 278 | ||
diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h index dc70bf553..849e9b31a 100644 --- a/src/ats/gnunet-service-ats_addresses.h +++ b/src/ats/gnunet-service-ats_addresses.h | |||
@@ -32,9 +32,10 @@ | |||
32 | 32 | ||
33 | /** | 33 | /** |
34 | * Initialize address subsystem. | 34 | * Initialize address subsystem. |
35 | * @param cfg configuration to use | ||
35 | */ | 36 | */ |
36 | void | 37 | void |
37 | GAS_addresses_init (void); | 38 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg); |
38 | 39 | ||
39 | 40 | ||
40 | /** | 41 | /** |
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c index 8125b8664..ca4e86ca4 100644 --- a/src/ats/gnunet-service-ats_scheduling.c +++ b/src/ats/gnunet-service-ats_scheduling.c | |||
@@ -73,10 +73,6 @@ static struct SchedulingClient *sc_tail; | |||
73 | */ | 73 | */ |
74 | static struct GNUNET_SERVER_NotificationContext *nc; | 74 | static struct GNUNET_SERVER_NotificationContext *nc; |
75 | 75 | ||
76 | static unsigned long long total_quota_in; | ||
77 | |||
78 | static unsigned long long total_quota_out; | ||
79 | |||
80 | 76 | ||
81 | /** | 77 | /** |
82 | * Find the scheduling client associated with the given | 78 | * Find the scheduling client associated with the given |
@@ -359,22 +355,10 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client, | |||
359 | * Initialize scheduling subsystem. | 355 | * Initialize scheduling subsystem. |
360 | * | 356 | * |
361 | * @param server handle to our server | 357 | * @param server handle to our server |
362 | * @param cfg configuration to use | ||
363 | */ | 358 | */ |
364 | void | 359 | void |
365 | GAS_scheduling_init (struct GNUNET_SERVER_Handle *server, | 360 | GAS_scheduling_init (struct GNUNET_SERVER_Handle *server) |
366 | const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
367 | { | 361 | { |
368 | GNUNET_assert (GNUNET_OK == | ||
369 | GNUNET_CONFIGURATION_get_value_number (cfg, | ||
370 | "core", | ||
371 | "TOTAL_QUOTA_IN", | ||
372 | &total_quota_in)); | ||
373 | GNUNET_assert (GNUNET_OK == | ||
374 | GNUNET_CONFIGURATION_get_value_number (cfg, | ||
375 | "core", | ||
376 | "TOTAL_QUOTA_OUT", | ||
377 | &total_quota_out)); | ||
378 | nc = GNUNET_SERVER_notification_context_create (server, 128); | 362 | nc = GNUNET_SERVER_notification_context_create (server, 128); |
379 | } | 363 | } |
380 | 364 | ||
diff --git a/src/ats/gnunet-service-ats_scheduling.h b/src/ats/gnunet-service-ats_scheduling.h index 273126fff..8d6fa977d 100644 --- a/src/ats/gnunet-service-ats_scheduling.h +++ b/src/ats/gnunet-service-ats_scheduling.h | |||
@@ -117,11 +117,9 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client, | |||
117 | * Initialize scheduling subsystem. | 117 | * Initialize scheduling subsystem. |
118 | * | 118 | * |
119 | * @param server handle to our server | 119 | * @param server handle to our server |
120 | * @param cfg configuration to use | ||
121 | */ | 120 | */ |
122 | void | 121 | void |
123 | GAS_scheduling_init (struct GNUNET_SERVER_Handle *server, | 122 | GAS_scheduling_init (struct GNUNET_SERVER_Handle *server); |
124 | const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
125 | 123 | ||
126 | 124 | ||
127 | /** | 125 | /** |