diff options
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh-enc.c | 12 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 6 | ||||
-rw-r--r-- | src/mesh/mesh_api.c | 2 | ||||
-rw-r--r-- | src/mesh/mesh_api_enc.c | 2 | ||||
-rw-r--r-- | src/mesh/test_mesh_small.c | 11 |
5 files changed, 17 insertions, 16 deletions
diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c index 6005e22db..23d851287 100644 --- a/src/mesh/gnunet-service-mesh-enc.c +++ b/src/mesh/gnunet-service-mesh-enc.c | |||
@@ -1926,8 +1926,8 @@ peer_get_oldest (void *cls, | |||
1926 | if (GNUNET_YES == peer_is_used (p)) | 1926 | if (GNUNET_YES == peer_is_used (p)) |
1927 | return GNUNET_YES; | 1927 | return GNUNET_YES; |
1928 | 1928 | ||
1929 | if (abs->abs_value < p->last_contact.abs_value) | 1929 | if (abs->abs_value_us < p->last_contact.abs_value_us) |
1930 | abs->abs_value = p->last_contact.abs_value; | 1930 | abs->abs_value_us = p->last_contact.abs_value_us; |
1931 | 1931 | ||
1932 | return GNUNET_YES; | 1932 | return GNUNET_YES; |
1933 | } | 1933 | } |
@@ -1948,7 +1948,7 @@ peer_timeout (void *cls, | |||
1948 | struct MeshPeer *p = value; | 1948 | struct MeshPeer *p = value; |
1949 | struct GNUNET_TIME_Absolute *abs = cls; | 1949 | struct GNUNET_TIME_Absolute *abs = cls; |
1950 | 1950 | ||
1951 | if (p->last_contact.abs_value == abs->abs_value && | 1951 | if (p->last_contact.abs_value_us == abs->abs_value_us && |
1952 | GNUNET_NO == peer_is_used (p)) | 1952 | GNUNET_NO == peer_is_used (p)) |
1953 | { | 1953 | { |
1954 | peer_destroy (p); | 1954 | peer_destroy (p); |
@@ -3199,9 +3199,9 @@ rel_message_free (struct MeshReliableMessage *copy) | |||
3199 | 3199 | ||
3200 | rel = copy->rel; | 3200 | rel = copy->rel; |
3201 | time = GNUNET_TIME_absolute_get_duration (copy->timestamp); | 3201 | time = GNUNET_TIME_absolute_get_duration (copy->timestamp); |
3202 | rel->expected_delay.rel_value *= 7; | 3202 | rel->expected_delay.rel_value_us *= 7; |
3203 | rel->expected_delay.rel_value += time.rel_value; | 3203 | rel->expected_delay.rel_value_us += time.rel_value_us; |
3204 | rel->expected_delay.rel_value /= 8; | 3204 | rel->expected_delay.rel_value_us /= 8; |
3205 | rel->n_sent--; | 3205 | rel->n_sent--; |
3206 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "!!! Freeing %u\n", copy->mid); | 3206 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "!!! Freeing %u\n", copy->mid); |
3207 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " n_sent %u\n", rel->n_sent); | 3207 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " n_sent %u\n", rel->n_sent); |
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 0dfac410d..9b4e4ad72 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -2709,9 +2709,9 @@ tunnel_free_reliable_message (struct MeshReliableMessage *copy) | |||
2709 | 2709 | ||
2710 | rel = copy->rel; | 2710 | rel = copy->rel; |
2711 | time = GNUNET_TIME_absolute_get_duration (copy->timestamp); | 2711 | time = GNUNET_TIME_absolute_get_duration (copy->timestamp); |
2712 | rel->expected_delay.rel_value *= 7; | 2712 | rel->expected_delay.rel_value_us *= 7; |
2713 | rel->expected_delay.rel_value += time.rel_value; | 2713 | rel->expected_delay.rel_value_us += time.rel_value_us; |
2714 | rel->expected_delay.rel_value /= 8; | 2714 | rel->expected_delay.rel_value_us /= 8; |
2715 | rel->n_sent--; | 2715 | rel->n_sent--; |
2716 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "!!! Freeing %u\n", copy->mid); | 2716 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "!!! Freeing %u\n", copy->mid); |
2717 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " n_sent %u\n", rel->n_sent); | 2717 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " n_sent %u\n", rel->n_sent); |
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 5daad36e2..1beebf9c1 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c | |||
@@ -564,7 +564,7 @@ add_to_queue (struct GNUNET_MESH_Handle *h, | |||
564 | struct GNUNET_MESH_TransmitHandle *th) | 564 | struct GNUNET_MESH_TransmitHandle *th) |
565 | { | 565 | { |
566 | GNUNET_CONTAINER_DLL_insert_tail (h->th_head, h->th_tail, th); | 566 | GNUNET_CONTAINER_DLL_insert_tail (h->th_head, h->th_tail, th); |
567 | if (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value == th->timeout.abs_value) | 567 | if (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us == th->timeout.abs_value_us) |
568 | return; | 568 | return; |
569 | th->timeout_task = | 569 | th->timeout_task = |
570 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining | 570 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining |
diff --git a/src/mesh/mesh_api_enc.c b/src/mesh/mesh_api_enc.c index 3401f5d33..113ff46d0 100644 --- a/src/mesh/mesh_api_enc.c +++ b/src/mesh/mesh_api_enc.c | |||
@@ -551,7 +551,7 @@ add_to_queue (struct GNUNET_MESH_Handle *h, | |||
551 | struct GNUNET_MESH_TransmitHandle *th) | 551 | struct GNUNET_MESH_TransmitHandle *th) |
552 | { | 552 | { |
553 | GNUNET_CONTAINER_DLL_insert_tail (h->th_head, h->th_tail, th); | 553 | GNUNET_CONTAINER_DLL_insert_tail (h->th_head, h->th_tail, th); |
554 | if (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value == th->timeout.abs_value) | 554 | if (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us == th->timeout.abs_value_us) |
555 | return; | 555 | return; |
556 | th->timeout_task = | 556 | th->timeout_task = |
557 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining | 557 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining |
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c index 30ea49223..dc9f9461c 100644 --- a/src/mesh/test_mesh_small.c +++ b/src/mesh/test_mesh_small.c | |||
@@ -192,14 +192,15 @@ show_end_data (void) | |||
192 | end_time = GNUNET_TIME_absolute_get(); | 192 | end_time = GNUNET_TIME_absolute_get(); |
193 | total_time = GNUNET_TIME_absolute_get_difference(start_time, end_time); | 193 | total_time = GNUNET_TIME_absolute_get_difference(start_time, end_time); |
194 | FPRINTF (stderr, "\nResults of test \"%s\"\n", test_name); | 194 | FPRINTF (stderr, "\nResults of test \"%s\"\n", test_name); |
195 | FPRINTF (stderr, "Test time %llu ms\n", | 195 | FPRINTF (stderr, "Test time %s\n", |
196 | (unsigned long long) total_time.rel_value); | 196 | GNUNET_STRINGS_relative_time_to_string (total_time, |
197 | GNUNET_YES)); | ||
197 | FPRINTF (stderr, "Test bandwidth: %f kb/s\n", | 198 | FPRINTF (stderr, "Test bandwidth: %f kb/s\n", |
198 | 4 * TOTAL_PACKETS * 1.0 / total_time.rel_value); // 4bytes * ms | 199 | 4 * TOTAL_PACKETS * 1.0 / (total_time.rel_value_us / 1000)); // 4bytes * ms |
199 | FPRINTF (stderr, "Test throughput: %f packets/s\n\n", | 200 | FPRINTF (stderr, "Test throughput: %f packets/s\n\n", |
200 | TOTAL_PACKETS * 1000.0 / total_time.rel_value); // packets * ms | 201 | TOTAL_PACKETS * 1000.0 / (total_time.rel_value_us / 1000)); // packets * ms |
201 | GAUGER ("MESH", test_name, | 202 | GAUGER ("MESH", test_name, |
202 | TOTAL_PACKETS * 1000.0 / total_time.rel_value, | 203 | TOTAL_PACKETS * 1000.0 / (total_time.rel_value_us / 1000), |
203 | "packets/s"); | 204 | "packets/s"); |
204 | } | 205 | } |
205 | 206 | ||