gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27896 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r27896 - gnunet/src/mesh
Date: Wed, 10 Jul 2013 19:29:55 +0200

Author: bartpolot
Date: 2013-07-10 19:29:54 +0200 (Wed, 10 Jul 2013)
New Revision: 27896

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- don't let retransmissions mess with per-hop ACK

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2013-07-10 16:53:19 UTC (rev 
27895)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2013-07-10 17:29:54 UTC (rev 
27896)
@@ -3096,11 +3096,13 @@
   switch (type)
   {
     case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
-      t->next_fc.last_pid_sent = pid;
+      if (GMC_is_pid_bigger(pid, t->next_fc.last_pid_sent))
+        t->next_fc.last_pid_sent = pid;
       tunnel_send_fwd_ack (t, GNUNET_MESSAGE_TYPE_MESH_UNICAST);
       break;
     case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
-      t->prev_fc.last_pid_sent = pid;
+      if (GMC_is_pid_bigger(pid, t->prev_fc.last_pid_sent))
+        t->prev_fc.last_pid_sent = pid;
       tunnel_send_bck_ack (t, GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN);
       break;
     default:
@@ -4013,6 +4015,7 @@
   struct GNUNET_MESH_Poll *msg;
   struct MeshTunnel *t;
   GNUNET_PEER_Id id;
+  uint32_t pid;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got an POLL packet from %s!\n",
               GNUNET_i2s (peer));
@@ -4031,16 +4034,20 @@
 
   /* Is this a forward or backward ACK? */
   id = GNUNET_PEER_search(peer);
+  pid = ntohl (msg->pid);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  PID %u\n", pid);
   if (t->next_hop == id)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  from FWD\n");
-    t->next_fc.last_pid_recv = ntohl (msg->pid);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  was %u\n", 
t->next_fc.last_pid_recv);
+    t->next_fc.last_pid_recv = pid;
     tunnel_send_bck_ack (t, GNUNET_MESSAGE_TYPE_MESH_POLL);
   }
   else if (t->prev_hop == id)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  from BCK\n");
-    t->prev_fc.last_pid_recv = ntohl (msg->pid);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  was %u\n", 
t->prev_fc.last_pid_recv);
+    t->prev_fc.last_pid_recv = pid;
     tunnel_send_fwd_ack (t, GNUNET_MESSAGE_TYPE_MESH_POLL);
   }
   else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]