gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r29005 - gnunet/src/mesh
Date: Thu, 5 Sep 2013 05:50:01 +0200

Author: bartpolot
Date: 2013-09-05 05:50:00 +0200 (Thu, 05 Sep 2013)
New Revision: 29005

Modified:
   gnunet/src/mesh/gnunet-service-mesh-enc.c
Log:
- cancel old ACK/POLL when issuing a new one


Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-09-05 03:36:22 UTC (rev 
29004)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c   2013-09-05 03:50:00 UTC (rev 
29005)
@@ -4828,7 +4828,6 @@
   fwd = queue->fwd;
   fc = fwd ? &c->fwd_fc : &c->bck_fc;
 
-
   dst_id = GNUNET_PEER_resolve2 (peer->id);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*   towards %s\n", GNUNET_i2s 
(dst_id));
   /* Check if buffer size is enough for the message */
@@ -5058,6 +5057,18 @@
   queue->fwd = fwd;
   if (100 <= priority)
   {
+    struct MeshPeerQueue *copy;
+    struct MeshPeerQueue *next;
+
+    for (copy = peer->queue_head; NULL != copy; copy = next)
+    {
+      next = copy->next;
+      if (copy->type == type && copy->c == c && copy->fwd == fwd)
+      {
+        /* Example: also a FWD ACK for connection XYZ */
+        queue_destroy (copy, GNUNET_YES);
+      }
+    }
     GNUNET_CONTAINER_DLL_insert (peer->queue_head, peer->queue_tail, queue);
   }
   else
@@ -5994,6 +6005,7 @@
   struct MeshConnection *c;
   struct MeshFlowControl *fc;
   GNUNET_PEER_Id id;
+  uint32_t ack;
   int fwd;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "\n\n");
@@ -6030,10 +6042,12 @@
     return GNUNET_OK;
   }
 
-  fc->last_ack_recv = ntohl (msg->ack);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  ACK %u\n", fc->last_ack_recv);
+  ack = ntohl (msg->ack);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  ACK %u (was %u)\n",
+              ack, fc->last_ack_recv);
+  if (GMC_is_pid_bigger (ack, fc->last_ack_recv))
+    fc->last_ack_recv = ack;
 
-
   /* Cancel polling if the ACK is big enough. */
   if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task &&
       GMC_is_pid_bigger (fc->last_ack_recv, fc->last_pid_sent))




reply via email to

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