aboutsummaryrefslogtreecommitdiff
path: root/src/fragmentation
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-27 16:05:18 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-27 16:05:18 +0000
commita78cd64b8551f257091a59ac79ab0807305c535a (patch)
treec2901575323738ac55ccedff449ef900302eab90 /src/fragmentation
parent2aee8da94c5aee59e4ffe2ce4ac9f0c984c4d570 (diff)
-logging, indenting
Diffstat (limited to 'src/fragmentation')
-rw-r--r--src/fragmentation/fragmentation.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c
index 6dad6d6d7a..dd6e6774b7 100644
--- a/src/fragmentation/fragmentation.c
+++ b/src/fragmentation/fragmentation.c
@@ -203,12 +203,19 @@ transmit_next (void *cls,
else
fsize = fc->mtu;
if (NULL != fc->tracker)
- delay = GNUNET_BANDWIDTH_tracker_get_delay (fc->tracker, fsize);
+ delay = GNUNET_BANDWIDTH_tracker_get_delay (fc->tracker,
+ fsize);
else
delay = GNUNET_TIME_UNIT_ZERO;
if (delay.rel_value_us > 0)
{
- fc->task = GNUNET_SCHEDULER_add_delayed (delay, &transmit_next, fc);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Fragmentation logic delays transmission of next fragment by %s\n",
+ GNUNET_STRINGS_relative_time_to_string (delay,
+ GNUNET_YES));
+ fc->task = GNUNET_SCHEDULER_add_delayed (delay,
+ &transmit_next,
+ fc);
return;
}
fc->next_transmission = (fc->next_transmission + 1) % 64;
@@ -273,7 +280,8 @@ transmit_next (void *cls,
fc->proc_busy = GNUNET_YES;
fc->delay_until = GNUNET_TIME_relative_to_absolute (delay);
fc->num_transmissions++;
- fc->proc (fc->proc_cls, &fh->header);
+ fc->proc (fc->proc_cls,
+ &fh->header);
}
@@ -331,7 +339,8 @@ GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats,
fc->proc = proc;
fc->proc_cls = proc_cls;
fc->fragment_id =
- GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX);
+ GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
+ UINT32_MAX);
memcpy (&fc[1], msg, size);
bits =
(size + mtu - sizeof (struct FragmentHeader) - 1) / (mtu -