From: Bart Polot Date: Mon, 27 Apr 2015 19:16:01 +0000 (+0000) Subject: - skip checking all messages that are not there, no matter what the bitfield says X-Git-Tag: initial-import-from-subversion-38251~1976 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0963a5108cd2a95cb862a1ac061892f68d7bba4;p=oweals%2Fgnunet.git - skip checking all messages that are not there, no matter what the bitfield says --- diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c index 2fd0a8e09..e529f8ecb 100644 --- a/src/cadet/gnunet-service-cadet_channel.c +++ b/src/cadet/gnunet-service-cadet_channel.c @@ -1060,15 +1060,18 @@ channel_rel_free_sent (struct CadetChannelReliability *rel, /* Did we run out of copies? (previously freed, it's ok) */ if (NULL == copy) { - LOG (GNUNET_ERROR_TYPE_DEBUG, "run out of copies...\n"); - return; + LOG (GNUNET_ERROR_TYPE_DEBUG, "run out of copies...\n"); + return; } /* Did we overshoot the target? (previously freed, it's ok) */ if (GC_is_pid_bigger (copy->mid, target)) { - LOG (GNUNET_ERROR_TYPE_DEBUG, " next copy %u\n", copy->mid); - continue; + LOG (GNUNET_ERROR_TYPE_DEBUG, " next copy %u\n", copy->mid); + i += copy->mid - target - 1; /* MID: 90, t = 85, i += 4 (i++ later) */ + mask = (0x1LL << (i + 1)) - 1; /* Mask = i-th bit and all before */ + bitfield &= ~mask; + continue; } /* Now copy->mid == target, free it */