diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-02-17 17:28:45 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-02-17 17:28:45 +0000 |
commit | fc5042202a772ca2659f60e87baa169a11a7b8a5 (patch) | |
tree | 18d58aac2f4e3478be4e43a6ca8fa4eb7048da39 /src/dht | |
parent | c42d09fc483b38b61b344f01da1a4678a18d337d (diff) | |
download | gnunet-fc5042202a772ca2659f60e87baa169a11a7b8a5.tar.gz gnunet-fc5042202a772ca2659f60e87baa169a11a7b8a5.zip |
bigger floating point
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/gnunet-dht-driver.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index 907b44c84..ab4a4a8f5 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c | |||
@@ -2604,10 +2604,10 @@ topology_callback (void *cls, | |||
2604 | unsigned long long total_duration; | 2604 | unsigned long long total_duration; |
2605 | unsigned int new_connections; | 2605 | unsigned int new_connections; |
2606 | unsigned int new_failed_connections; | 2606 | unsigned int new_failed_connections; |
2607 | float conns_per_sec_recent; | 2607 | double conns_per_sec_recent; |
2608 | float conns_per_sec_total; | 2608 | double conns_per_sec_total; |
2609 | float failed_conns_per_sec_recent; | 2609 | double failed_conns_per_sec_recent; |
2610 | float failed_conns_per_sec_total; | 2610 | double failed_conns_per_sec_total; |
2611 | 2611 | ||
2612 | #if ONLY_TESTING | 2612 | #if ONLY_TESTING |
2613 | if (repeat_connect_mode == GNUNET_YES) | 2613 | if (repeat_connect_mode == GNUNET_YES) |
@@ -2631,8 +2631,6 @@ topology_callback (void *cls, | |||
2631 | } | 2631 | } |
2632 | #endif | 2632 | #endif |
2633 | 2633 | ||
2634 | |||
2635 | |||
2636 | if (GNUNET_TIME_absolute_get_difference (connect_last_time, | 2634 | if (GNUNET_TIME_absolute_get_difference (connect_last_time, |
2637 | GNUNET_TIME_absolute_get()).rel_value > GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, CONN_UPDATE_DURATION).rel_value) | 2635 | GNUNET_TIME_absolute_get()).rel_value > GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, CONN_UPDATE_DURATION).rel_value) |
2638 | { | 2636 | { |
@@ -2648,10 +2646,10 @@ topology_callback (void *cls, | |||
2648 | total_duration = GNUNET_TIME_absolute_get_difference (connect_start_time, | 2646 | total_duration = GNUNET_TIME_absolute_get_difference (connect_start_time, |
2649 | GNUNET_TIME_absolute_get()).rel_value / 1000; | 2647 | GNUNET_TIME_absolute_get()).rel_value / 1000; |
2650 | 2648 | ||
2651 | failed_conns_per_sec_recent = (float)new_failed_connections / duration; | 2649 | failed_conns_per_sec_recent = (double)new_failed_connections / duration; |
2652 | failed_conns_per_sec_total = (float)failed_connections / total_duration; | 2650 | failed_conns_per_sec_total = (double)failed_connections / total_duration; |
2653 | conns_per_sec_recent = (float)new_connections / duration; | 2651 | conns_per_sec_recent = (double)new_connections / duration; |
2654 | conns_per_sec_total = (float)total_connections / total_duration; | 2652 | conns_per_sec_total = (double)total_connections / total_duration; |
2655 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Recent: %.2f/s, Total: %.2f/s, Recent failed: %.2f/s, total failed %.2f/s\n", | 2653 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Recent: %.2f/s, Total: %.2f/s, Recent failed: %.2f/s, total failed %.2f/s\n", |
2656 | conns_per_sec_recent, CONN_UPDATE_DURATION, conns_per_sec_total, | 2654 | conns_per_sec_recent, CONN_UPDATE_DURATION, conns_per_sec_total, |
2657 | failed_conns_per_sec_recent, failed_conns_per_sec_total); | 2655 | failed_conns_per_sec_recent, failed_conns_per_sec_total); |
@@ -2677,6 +2675,11 @@ topology_callback (void *cls, | |||
2677 | } | 2675 | } |
2678 | #endif | 2676 | #endif |
2679 | } | 2677 | } |
2678 | else if (repeat_connect_mode == GNUNET_YES) | ||
2679 | { | ||
2680 | repeat_connect_task = GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60), &repeat_connect, NULL); | ||
2681 | } | ||
2682 | |||
2680 | if (emsg == NULL) | 2683 | if (emsg == NULL) |
2681 | { | 2684 | { |
2682 | total_connections++; | 2685 | total_connections++; |