diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-04-30 16:49:38 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-04-30 16:49:38 +0000 |
commit | f5743f7009ec5ab505963b7cf4338917caa136d1 (patch) | |
tree | 69fbf4d778b9961c3f1e4f9c1fc227cb898d4246 /src/ats/gnunet-ats-solver-eval.c | |
parent | df775d9bd009286b42212fecf995cf3b1865a39a (diff) | |
download | gnunet-f5743f7009ec5ab505963b7cf4338917caa136d1.tar.gz gnunet-f5743f7009ec5ab505963b7cf4338917caa136d1.zip |
fixing file handle lookup
one type to store them all
Diffstat (limited to 'src/ats/gnunet-ats-solver-eval.c')
-rw-r--r-- | src/ats/gnunet-ats-solver-eval.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c index 6e8a4b5dd..57e9ce69f 100644 --- a/src/ats/gnunet-ats-solver-eval.c +++ b/src/ats/gnunet-ats-solver-eval.c | |||
@@ -194,7 +194,7 @@ GNUNET_ATS_solver_logging_now (struct LoggingHandle *l) | |||
194 | /* Store logging data here */ | 194 | /* Store logging data here */ |
195 | for (cur = peer_head; NULL != cur; cur = cur->next) | 195 | for (cur = peer_head; NULL != cur; cur = cur->next) |
196 | { | 196 | { |
197 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Logging peer id %u\n", cur->peer_id); | 197 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Logging peer id %llu\n", cur->id); |
198 | 198 | ||
199 | log_p = GNUNET_new (struct LoggingPeer); | 199 | log_p = GNUNET_new (struct LoggingPeer); |
200 | log_p->id = cur->id; | 200 | log_p->id = cur->id; |
@@ -211,7 +211,8 @@ GNUNET_ATS_solver_logging_now (struct LoggingHandle *l) | |||
211 | 211 | ||
212 | for (cur_addr = cur->addr_head; NULL != cur_addr; cur_addr = cur_addr->next) | 212 | for (cur_addr = cur->addr_head; NULL != cur_addr; cur_addr = cur_addr->next) |
213 | { | 213 | { |
214 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Logging peer id %u address %u\n", cur->peer_id, cur_addr->aid); | 214 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Logging peer id %llu address %llu\n", |
215 | cur->peer_id, cur_addr->aid); | ||
215 | log_a = GNUNET_new (struct LoggingAddress); | 216 | log_a = GNUNET_new (struct LoggingAddress); |
216 | log_a->aid = cur_addr->aid; | 217 | log_a->aid = cur_addr->aid; |
217 | log_a->active = cur_addr->ats_addr->active; | 218 | log_a->active = cur_addr->ats_addr->active; |
@@ -231,7 +232,7 @@ GNUNET_ATS_solver_logging_now (struct LoggingHandle *l) | |||
231 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "\t BW in = %llu\n", ntohl(log_a->assigned_bw_in.value__)); | 232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "\t BW in = %llu\n", ntohl(log_a->assigned_bw_in.value__)); |
232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "\t BW out = %llu\n", ntohl(log_a->assigned_bw_out.value__)); | 233 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "\t BW out = %llu\n", ntohl(log_a->assigned_bw_out.value__)); |
233 | 234 | ||
234 | GNUNET_CONTAINER_DLL_insert_tail(log_p->addr_head, log_p->addr_tail, log_a); | 235 | GNUNET_CONTAINER_DLL_insert_tail (log_p->addr_head, log_p->addr_tail, log_a); |
235 | } | 236 | } |
236 | } | 237 | } |
237 | } | 238 | } |
@@ -280,7 +281,7 @@ find_logging_file_handle (struct LoggingFileHandle *lf_head, | |||
280 | struct LoggingFileHandle *res; | 281 | struct LoggingFileHandle *res; |
281 | 282 | ||
282 | for (res = lf_head; NULL != res; res = res->next) | 283 | for (res = lf_head; NULL != res; res = res->next) |
283 | if ((res->pid == peer_id) && (res->pid == address_id)) | 284 | if ((res->pid == peer_id) && (res->aid == address_id)) |
284 | return res; | 285 | return res; |
285 | return NULL; | 286 | return NULL; |
286 | 287 | ||
@@ -361,7 +362,7 @@ GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int add_time_s | |||
361 | cur->aid, | 362 | cur->aid, |
362 | cur->pid); | 363 | cur->pid); |
363 | 364 | ||
364 | fprintf (stderr, "Add writing log data for %i %i to file `%s'\n", | 365 | fprintf (stderr, "Add writing log data for %llu %llu to file `%s'\n", |
365 | cur->pid, cur->aid, filename); | 366 | cur->pid, cur->aid, filename); |
366 | 367 | ||
367 | 368 | ||
@@ -472,7 +473,7 @@ GNUNET_ATS_solver_logging_eval (struct LoggingHandle *l) | |||
472 | 473 | ||
473 | for (log_p = lts->head; NULL != log_p; log_p = log_p->next) | 474 | for (log_p = lts->head; NULL != log_p; log_p = log_p->next) |
474 | { | 475 | { |
475 | fprintf (stderr,"\tLogging peer pid %u\n", log_p->id); | 476 | fprintf (stderr,"\tLogging peer pid %llu\n", log_p->id); |
476 | for (c = 1; c < GNUNET_ATS_PreferenceCount; c++) | 477 | for (c = 1; c < GNUNET_ATS_PreferenceCount; c++) |
477 | { | 478 | { |
478 | fprintf(stderr,"\t %s = %.2f %.2f [abs/rel]\n", | 479 | fprintf(stderr,"\t %s = %.2f %.2f [abs/rel]\n", |
@@ -482,7 +483,7 @@ GNUNET_ATS_solver_logging_eval (struct LoggingHandle *l) | |||
482 | 483 | ||
483 | for (log_a = log_p->addr_head; NULL != log_a; log_a = log_a->next) | 484 | for (log_a = log_p->addr_head; NULL != log_a; log_a = log_a->next) |
484 | { | 485 | { |
485 | fprintf (stderr, "\tPeer pid %u address %u: %u %u %u\n", | 486 | fprintf (stderr, "\tPeer pid %llu address %llu: %u %u %u\n", |
486 | log_p->id, log_a->aid, log_a->active, | 487 | log_p->id, log_a->aid, log_a->active, |
487 | ntohl(log_a->assigned_bw_in.value__), | 488 | ntohl(log_a->assigned_bw_in.value__), |
488 | ntohl(log_a->assigned_bw_out.value__)); | 489 | ntohl(log_a->assigned_bw_out.value__)); |
@@ -2074,11 +2075,12 @@ enforce_add_address (struct GNUNET_ATS_TEST_Operation *op) | |||
2074 | 2075 | ||
2075 | a = GNUNET_new (struct TestAddress); | 2076 | a = GNUNET_new (struct TestAddress); |
2076 | a->aid = op->address_id; | 2077 | a->aid = op->address_id; |
2078 | fprintf (stderr, "XXXX : %llu %llu \n", a->aid, op->address_id); | ||
2077 | a->network = op->address_network; | 2079 | a->network = op->address_network; |
2078 | a->ats_addr = create_ats_address (&p->peer_id, op->plugin, op->address, | 2080 | a->ats_addr = create_ats_address (&p->peer_id, op->plugin, op->address, |
2079 | strlen (op->address) + 1, op->address_session); | 2081 | strlen (op->address) + 1, op->address_session); |
2080 | memset (&p->peer_id, op->peer_id, sizeof (p->peer_id)); | 2082 | memset (&p->peer_id, op->peer_id, sizeof (p->peer_id)); |
2081 | GNUNET_CONTAINER_DLL_insert (p->addr_head, p->addr_tail, a); | 2083 | GNUNET_CONTAINER_DLL_insert_tail (p->addr_head, p->addr_tail, a); |
2082 | 2084 | ||
2083 | for (c = 0; c < GNUNET_ATS_PropertyCount; c++) | 2085 | for (c = 0; c < GNUNET_ATS_PropertyCount; c++) |
2084 | a->prop_norm[c] = DEFAULT_REL_QUALITY; | 2086 | a->prop_norm[c] = DEFAULT_REL_QUALITY; |