gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r30157 - gnunet/src/mesh
Date: Fri, 11 Oct 2013 17:37:21 +0200

Author: bartpolot
Date: 2013-10-11 17:37:21 +0200 (Fri, 11 Oct 2013)
New Revision: 30157

Modified:
   gnunet/src/mesh/Makefile.am
   gnunet/src/mesh/gnunet-service-mesh_connection.c
   gnunet/src/mesh/gnunet-service-mesh_connection.h
   gnunet/src/mesh/gnunet-service-mesh_tunnel.c
   gnunet/src/mesh/gnunet-service-mesh_tunnel.h
Log:
- mesh builds again


Modified: gnunet/src/mesh/Makefile.am
===================================================================
--- gnunet/src/mesh/Makefile.am 2013-10-11 15:22:13 UTC (rev 30156)
+++ gnunet/src/mesh/Makefile.am 2013-10-11 15:37:21 UTC (rev 30157)
@@ -23,8 +23,8 @@
 EXP_LIB = \
  libgnunetmeshenc.la
 
-#EXP_LIBEXEC = \
-# gnunet-service-mesh-enc
+EXP_LIBEXEC = \
+ gnunet-service-mesh-enc
 
 libexec_PROGRAMS = \
  gnunet-service-mesh $(EXP_LIBEXEC)

Modified: gnunet/src/mesh/gnunet-service-mesh_connection.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.c    2013-10-11 15:22:13 UTC 
(rev 30156)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.c    2013-10-11 15:37:21 UTC 
(rev 30157)
@@ -516,7 +516,8 @@
               fwd ? "FWD" : "BCK", GNUNET_h2s (&c->id));
 
   /* Check if we need to transmit the ACK */
-  if (prev_fc->last_ack_sent - prev_fc->last_pid_recv > 3)
+  delta = prev_fc->last_ack_sent - prev_fc->last_pid_recv;
+  if (3 < delta && buffer < delta)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "Not sending ACK, buffer > 3\n");
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -526,8 +527,7 @@
   }
 
   /* Ok, ACK might be necessary, what PID to ACK? */
-  delta = next_fc->queue_max - next_fc->queue_n;
-  ack = prev_fc->last_pid_recv + delta;
+  ack = prev_fc->last_pid_recv + buffer;
   LOG (GNUNET_ERROR_TYPE_DEBUG, " ACK %u\n", ack);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        " last pid %u, last ack %u, qmax %u, q %u\n",
@@ -1695,7 +1695,7 @@
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "  sending on all connections\n");
     GNUNET_assert (NULL != ch);
-    channel_send_connections_ack (ch, buffer, fwd);
+    GMT_send_acks (GMCH_get_tunnel (ch), buffer, fwd);
   }
   else
   {
@@ -1751,6 +1751,7 @@
 void
 GMC_shutdown (void)
 {
+  GNUNET_CONTAINER_multihashmap_destroy (connections);
 }
 
 
@@ -1934,6 +1935,23 @@
 
 
 /**
+ * Allow the connection to advertise a buffer of the given size.
+ *
+ * The connection will send an @c fwd ACK message (so: in direction !fwd)
+ * allowing up to last_pid_recv + buffer.
+ *
+ * @param c Connection.
+ * @param buffer How many more messages the connection can accept.
+ * @param fwd Is this about FWD traffic? (The ack will go dest->root).
+ */
+void
+GMC_allow (struct MeshConnection *c, unsigned int buffer, int fwd)
+{
+  connection_send_ack (c, buffer, fwd);
+}
+
+
+/**
  * Send a notification that a connection is broken.
  *
  * @param c Connection that is broken.

Modified: gnunet/src/mesh/gnunet-service-mesh_connection.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.h    2013-10-11 15:22:13 UTC 
(rev 30156)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.h    2013-10-11 15:37:21 UTC 
(rev 30157)
@@ -328,6 +328,19 @@
 GMC_get_qn (struct MeshConnection *c, int fwd);
 
 /**
+ * Allow the connection to advertise a buffer of the given size.
+ *
+ * The connection will send an @c fwd ACK message (so: in direction !fwd)
+ * allowing up to last_pid_recv + buffer.
+ *
+ * @param c Connection.
+ * @param buffer How many more messages the connection can accept.
+ * @param fwd Is this about FWD traffic? (The ack will go dest->root).
+ */
+void
+GMC_allow (struct MeshConnection *c, unsigned int buffer, int fwd);
+
+/**
  * Send FWD keepalive packets for a connection.
  *
  * @param cls Closure (connection for which to send the keepalive).

Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-10-11 15:22:13 UTC 
(rev 30156)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-10-11 15:37:21 UTC 
(rev 30157)
@@ -1095,10 +1095,8 @@
  * @param ch Channel which has some free buffer space.
  * @param fwd Is this in for FWD traffic? (ACK goes dest->root)
  */
-static void
-GMT_send_acks (struct MeshTunnel3 *t,
-               unsigned int buffer,
-               int fwd)
+void
+GMT_send_acks (struct MeshTunnel3 *t, unsigned int buffer, int fwd)
 {
   struct MeshTConnection *iter;
   uint32_t allowed;
@@ -1108,8 +1106,20 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Tunnel send acks on %s:%X\n",
-              fwd ? "FWD" : "BCK", peer2s (ch->t->peer), ch->gid);
+              fwd ? "FWD" : "BCK", GMT_2s (t));
 
+  if (NULL == t)
+  {
+    GNUNET_break (0);
+    return;
+  }
+  if (NULL == t->channel_head ||
+      GNUNET_NO == GMCH_is_origin (t->channel_head->ch, fwd))
+  {
+    GNUNET_break (0);
+    return;
+  }
+
   /* Count connections, how many messages are already allowed */
   cs = GMT_count_connections (t);
   for (allowed = 0, iter = t->connection_head; NULL != iter; iter = iter->next)
@@ -1125,7 +1135,7 @@
   }
 
   /* Authorize connections to send more data */
-  to_allow = buffer - allowed;
+  to_allow = buffer; /* - allowed; */
 
   for (iter = t->connection_head; NULL != iter && to_allow > 0; iter = 
iter->next)
   {
@@ -1136,13 +1146,9 @@
     {
       continue;
     }
-    GMC_send_ack (iter->c, NULL, fwd);
-    connection_send_ack (iter, allow_per_connection, fwd);
+    GMC_allow (iter->c, buffer, fwd);
   }
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Channel send connection %s ack on %s:%X\n",
-                fwd ? "FWD" : "BCK", peer2s (ch->t->peer), ch->gid);
   GNUNET_break (to_allow == 0);
 }
 

Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.h        2013-10-11 15:22:13 UTC 
(rev 30156)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.h        2013-10-11 15:37:21 UTC 
(rev 30157)
@@ -310,6 +310,17 @@
 GMT_get_next_chid (struct MeshTunnel3 *t);
 
 /**
+ * Send ACK on one or more connections due to buffer space to the client.
+ *
+ * Iterates all connections of the tunnel and sends ACKs appropriately.
+ *
+ * @param ch Channel which has some free buffer space.
+ * @param fwd Is this in for FWD traffic? (ACK goes dest->root)
+ */
+void
+GMT_send_acks (struct MeshTunnel3 *t, unsigned int buffer, int fwd);
+
+/**
  * Sends an already built message on a tunnel, encrypting it and
  * choosing the best connection.
  *




reply via email to

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