prevent unordered message delivery
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 28 Feb 2019 18:06:22 +0000 (19:06 +0100)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 28 Feb 2019 18:06:22 +0000 (19:06 +0100)
src/cadet/gnunet-service-cadet_channel.c

index 1746fc509aef859ac7ce50e5ea5c39d94a92ccab..3c83d0bb33419012cc3d6b50fdf9993b726b9d25 100644 (file)
@@ -1331,7 +1331,10 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch,
       ccc->client_ready = GNUNET_NO;
       GSC_send_to_client (ccc->c,
                           env);
-      ch->mid_recv.mid = htonl (1 + ntohl (ch->mid_recv.mid));
+      if (GNUNET_NO == ch->out_of_order)
+        ch->mid_recv.mid = htonl (1 + ntohl (msg->mid.mid));
+      else
+        ch->mid_recv.mid = htonl (1 + ntohl (ch->mid_recv.mid));
       ch->mid_futures >>= 1;
       if ( (GNUNET_YES == ch->out_of_order) &&
           (GNUNET_NO == ch->reliable) )