check for ACKed MID
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Tue, 26 Feb 2019 18:12:08 +0000 (19:12 +0100)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Tue, 26 Feb 2019 18:12:08 +0000 (19:12 +0100)
src/cadet/gnunet-service-cadet_channel.c

index 031da9e4dcb42009e65001255ecaa93f408922ae..905211e00ad2fa928969b49817bcb6da286eca67 100644 (file)
@@ -1318,6 +1318,7 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch,
          ((msg->mid.mid == ch->mid_recv.mid) &&
           (GNUNET_YES == ch->reliable)) ||
          ((GNUNET_NO == ch->reliable) &&
+          (msg->mid.mid >= ch->mid_recv.mid) &&
           ((NULL == ccc->head_recv) ||
            (msg->mid.mid < ccc->head_recv->mid.mid))) )
     {
@@ -1416,11 +1417,12 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch,
                                    next_msg);
       ccc->num_recv--;
       /* Do not process duplicate MID */
-      if (msg->mid.mid == next_msg->mid.mid)
+      if ((msg->mid.mid == next_msg->mid.mid) || /* Duplicate */
+          (msg->mid.mid < ch->mid_recv.mid)) /* Old */
       {
         /* Duplicate within the queue, drop */
         LOG (GNUNET_ERROR_TYPE_DEBUG,
-             "Duplicate message on %s (mid %u) dropped\n",
+             "Message on %s (mid %u) dropped\n",
              GCCH_2s (ch),
              ntohl (msg->mid.mid));
         GNUNET_free (next_msg);