summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_ats.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-07-19 12:56:55 +0000
committerChristian Grothoff <christian@grothoff.org>2011-07-19 12:56:55 +0000
commit438477f091548c33f67fd609f30768151bf97aa3 (patch)
treef1722f3c36b76b6270236800fa1732efc1c0948a /src/transport/gnunet-service-transport_ats.c
parent17c4884e4aa9d57179a9b5d352aa959e8376e8ec (diff)
cleanup
Diffstat (limited to 'src/transport/gnunet-service-transport_ats.c')
-rw-r--r--src/transport/gnunet-service-transport_ats.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c
index d8acb534b..df425bfb0 100644
--- a/src/transport/gnunet-service-transport_ats.c
+++ b/src/transport/gnunet-service-transport_ats.c
@@ -463,9 +463,9 @@ static void _dummy2 ()
{
ats_modify_problem_state (NULL, 0);
qm[1].atis_index = 0;
- _dummy();
- int t = ATS_COST_UPDATED + ATS_MODIFIED + ATS_NEW;
- t = 0;
+ _dummy();
+ int t = ATS_COST_UPDATED + ATS_MODIFIED + ATS_NEW;
+ t++;
}
/*
@@ -1669,14 +1669,40 @@ void ats_update_problem_cr (struct ATS_Handle * ats)
void ats_set_logging_options (struct ATS_Handle * ats,
struct GNUNET_STATISTICS_Handle * stats,
- int minimum_addresses,
- int minimum_peers,
- int overwrite_dump,
- int log_solution,
- int log_problem)
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
+ int minimum_addresses;
+ int minimum_peers;
+ int overwrite_dump;
+ int log_solution;
+ int log_problem;
+ unsigned long long value;
+
if (ats == NULL)
return;
+ log_problem = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "transport",
+ "DUMP_MLP");
+ log_solution = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "transport",
+ "DUMP_SOLUTION");
+ overwrite_dump = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "transport",
+ "DUMP_OVERWRITE");
+ if (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_number(cfg,
+ "transport",
+ "DUMP_MIN_PEERS",
+ &value))
+ minimum_peers = (int) value;
+ if (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_number(cfg,
+ "transport",
+ "DUMP_MIN_ADDRS",
+ &value))
+ minimum_addresses = (int) value;
+
+
ats->stats = stats;
ats->dump_min_addr = minimum_addresses;
ats->dump_min_peers = minimum_peers;