X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fats%2Fperf_ats_solver.c;h=6fbf547ac2f6a0218a407f72aaf8a01dc2f91a11;hb=a35ab677ed4396f271cfd3fea2051044a6a8b5d7;hp=6504172d94dc2605ddc2deaf6268ac02e7fa1a60;hpb=3e4174aa514058d30647190e44f3dc2e39827dba;p=oweals%2Fgnunet.git diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c index 6504172d9..6fbf547ac 100644 --- a/src/ats/perf_ats_solver.c +++ b/src/ats/perf_ats_solver.c @@ -393,16 +393,15 @@ static void bandwidth_changed_cb (void *cls, struct ATS_Address *address) { - if ( (0 == ntohl (address->assigned_bw_out.value__)) && - (0 == ntohl (address->assigned_bw_in.value__)) ) + if ( (0 == address->assigned_bw_out) && (0 == address->assigned_bw_in) ) return; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Bandwidth changed addresses %s %p to %u Bps out / %u Bps in\n", GNUNET_i2s (&address->peer), address, - (unsigned int) ntohl (address->assigned_bw_out.value__), - (unsigned int) ntohl (address->assigned_bw_in.value__)); + address->assigned_bw_out, + address->assigned_bw_in); if (GNUNET_YES == ph.bulk_running) GNUNET_break (0); return; @@ -791,7 +790,11 @@ evaluate (int iteration) if (0 == cp) continue; if (NULL == cur) + { GNUNET_break (0); + fprintf (stderr, + "Missing result for %u peers\n", cp); + } if (GNUNET_NO == cur->valid) @@ -959,8 +962,15 @@ write_all_iterations (void) cur_upd_res = ph.iterations_results[c_iteration].update_results_array[c_peer]; data_upd_tmp = GNUNET_strdup (data_upd_str); GNUNET_free (data_upd_str); - GNUNET_asprintf (&data_upd_str, "%s;%llu", data_upd_tmp, + if (GNUNET_YES == cur_full_res->valid) + { + GNUNET_asprintf (&data_upd_str, "%s;%llu", data_upd_tmp, (NULL == cur_upd_res) ? 0 : cur_upd_res->d_total_full.rel_value_us); + } + else + { + GNUNET_asprintf (&data_upd_str, "%s;", data_upd_tmp); + } GNUNET_free (data_upd_tmp); } @@ -970,7 +980,16 @@ write_all_iterations (void) data_tmp = GNUNET_strdup (data_str); GNUNET_free (data_str); - GNUNET_asprintf (&data_str, "%s;%llu", data_tmp, cur_full_res->d_total_full.rel_value_us); + if (GNUNET_YES == cur_full_res->valid) + { + GNUNET_asprintf (&data_str, "%s;%llu", data_tmp, + cur_full_res->d_total_full.rel_value_us); + } + else + { + GNUNET_asprintf (&data_str, "%s;", data_tmp); + } + GNUNET_free (data_tmp); } data_tmp = GNUNET_strdup (data_str); @@ -990,7 +1009,7 @@ write_all_iterations (void) GNUNET_asprintf (&data_upd_str, "%s\n", data_upd_tmp); GNUNET_free (data_upd_tmp); - fprintf (stderr, "Result updated solution: %s\n", data_upd_str); + fprintf (stderr, "Result updated solution: `%s'\n", data_upd_str); if (GNUNET_SYSERR == GNUNET_DISK_file_write (f_update, data_upd_str, strlen(data_upd_str))) GNUNET_break (0); GNUNET_free (data_upd_str);