[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17661 - gnunet/src/fragmentation
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17661 - gnunet/src/fragmentation |
Date: |
Fri, 21 Oct 2011 17:54:30 +0200 |
Author: wachs
Date: 2011-10-21 17:54:30 +0200 (Fri, 21 Oct 2011)
New Revision: 17661
Modified:
gnunet/src/fragmentation/defragmentation.c
Log:
order of sending ack and notification
Modified: gnunet/src/fragmentation/defragmentation.c
===================================================================
--- gnunet/src/fragmentation/defragmentation.c 2011-10-21 13:52:40 UTC (rev
17660)
+++ gnunet/src/fragmentation/defragmentation.c 2011-10-21 15:54:30 UTC (rev
17661)
@@ -519,21 +519,26 @@
for (b = 0; b < 64; b++)
if (0 != (mc->bits & (1LL << b)))
bc++;
+
+ /* notify about complete message */
+ if ((duplicate == GNUNET_NO) && (0 == mc->bits))
+ {
+ GNUNET_STATISTICS_update (dc->stats, _("# messages defragmented"), 1,
+ GNUNET_NO);
+ /* message complete, notify! */
+ dc->proc (dc->cls, mc->msg);
+ }
+ /* send ACK */
if (mc->frag_times_write_offset - mc->frag_times_start_offset > 1)
dc->latency = estimate_latency (mc);
delay = GNUNET_TIME_relative_multiply (dc->latency, bc + 1);
if ((0 == mc->bits) || (GNUNET_YES == duplicate)) /* message complete or
duplicate, ACK now! */
+ {
delay = GNUNET_TIME_UNIT_ZERO;
+ }
if (GNUNET_SCHEDULER_NO_TASK != mc->ack_task)
GNUNET_SCHEDULER_cancel (mc->ack_task);
mc->ack_task = GNUNET_SCHEDULER_add_delayed (delay, &send_ack, mc);
- if ((duplicate == GNUNET_NO) && (0 == mc->bits))
- {
- GNUNET_STATISTICS_update (dc->stats, _("# messages defragmented"), 1,
- GNUNET_NO);
- /* message complete, notify! */
- dc->proc (dc->cls, mc->msg);
- }
if (duplicate == GNUNET_YES)
return GNUNET_NO;
return GNUNET_YES;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17661 - gnunet/src/fragmentation,
gnunet <=