[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r23028 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r23028 - gnunet/src/mesh |
Date: |
Wed, 1 Aug 2012 13:24:47 +0200 |
Author: bartpolot
Date: 2012-08-01 13:24:47 +0200 (Wed, 01 Aug 2012)
New Revision: 23028
Modified:
gnunet/src/mesh/gnunet-service-mesh.c
gnunet/src/mesh/test_mesh.conf
gnunet/src/mesh/test_mesh_local_traffic.c
Log:
- wip
Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c 2012-08-01 11:12:31 UTC (rev
23027)
+++ gnunet/src/mesh/gnunet-service-mesh.c 2012-08-01 11:24:47 UTC (rev
23028)
@@ -981,17 +981,28 @@
/**
- * Get the current ack value for a tunnel, taking in account the tunnel
- * mode and the status of all children nodes.
+ * Get the current ack value for a tunnel, for data going from root to leaves,
+ * taking in account the tunnel mode and the status of all children and
clients.
*
* @param t Tunnel.
*
* @return Maximum PID allowed.
*/
static uint32_t
-tunnel_get_ack (struct MeshTunnel *t);
+tunnel_get_fwd_ack (struct MeshTunnel *t);
/**
+ * Get the current ack value for a tunnel, for data going from leaves to root,
+ * taking in account the tunnel mode and the status of all children and
clients.
+ *
+ * @param t Tunnel.
+ *
+ * @return Maximum PID allowed.
+ */
+static uint32_t
+tunnel_get_bck_ack (struct MeshTunnel *t);
+
+/**
* Add a client to a tunnel, initializing all needed data structures.
*
* @param t Tunnel to which add the client.
@@ -1968,7 +1979,7 @@
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " to client %u\n", c->id);
- ack = tunnel_get_ack (t);
+ ack = tunnel_get_fwd_ack (t);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " ack %u\n", ack);
if (t->last_ack == ack)
@@ -3288,7 +3299,7 @@
*
* @param t Tunnel.
*
- * @return Maximum PID allowed.
+ * @return Maximum PID allowed, 0 if node has no children.
*/
static uint32_t
tunnel_get_children_ack (struct MeshTunnel *t)
@@ -3407,7 +3418,7 @@
* @return Maximum PID allowed.
*/
static uint32_t
-tunnel_get_ack (struct MeshTunnel *t)
+tunnel_get_fwd_ack (struct MeshTunnel *t)
{
uint32_t count;
uint32_t buffer_free;
@@ -3419,7 +3430,8 @@
buffer_free = t->queue_max - t->queue_n;
ack = count + buffer_free;
child_ack = tunnel_get_children_ack (t);
- client_ack = tunnel_get_clients_ack (t);
+ if (0 == child_ack)
+ ack = client_ack = tunnel_get_clients_ack (t);
if (GNUNET_YES == t->speed_min)
{
@@ -3436,7 +3448,25 @@
return ack;
}
+/**
+ * Get the current ack value for a tunnel, taking in account the tunnel
+ * mode and the status of all children nodes.
+ *
+ * @param t Tunnel.
+ *
+ * @return Maximum PID allowed.
+ */
+static uint32_t
+tunnel_get_bck_ack (struct MeshTunnel *t)
+{
+ uint32_t ack;
+ ack = 0;
+
+ return ack;
+}
+
+
/**
* Send an ACK informing the predecessor about the available buffer space.
* In case there is no predecessor, inform the owning client.
@@ -3475,7 +3505,7 @@
}
/* Ok, ACK might be necessary, what PID to ACK? */
- ack = tunnel_get_ack (t);
+ ack = tunnel_get_fwd_ack (t);
/* If speed_min and not all children have ack'd, dont send yet */
if (ack == t->last_ack)
@@ -6596,7 +6626,7 @@
}
/* Does client own tunnel? */
- if (NULL != t->owner && t->owner->handle != client)
+ if (NULL != t->owner && t->owner->handle == client)
{
GNUNET_break (0);
// FIXME TODO
Modified: gnunet/src/mesh/test_mesh.conf
===================================================================
--- gnunet/src/mesh/test_mesh.conf 2012-08-01 11:12:31 UTC (rev 23027)
+++ gnunet/src/mesh/test_mesh.conf 2012-08-01 11:24:47 UTC (rev 23028)
@@ -12,7 +12,17 @@
PORT = 10511
# PREFIX = valgrind --leak-check=full
# PREFIX = xterm -geometry 100x85 -T peer1 -e gdb --args
+REFRESH_PATH_TIME = 3 s
+APP_ANNOUNCE_TIME = 5 s
+ID_ANNOUNCE_TIME = 5 s
+UNACKNOWLEDGED_WAIT = 2 s
+CONNECT_TIMEOUT = 30 s
+DEFAULT_TTL = 16
+DHT_REPLICATION_LEVEL = 10
+MAX_TUNNELS = 10
+MAX_MSGS_QUEUE = 20
+
[dht]
DEBUG = NO
AUTOSTART = YES
Modified: gnunet/src/mesh/test_mesh_local_traffic.c
===================================================================
--- gnunet/src/mesh/test_mesh_local_traffic.c 2012-08-01 11:12:31 UTC (rev
23027)
+++ gnunet/src/mesh/test_mesh_local_traffic.c 2012-08-01 11:24:47 UTC (rev
23028)
@@ -32,7 +32,7 @@
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
-#define TARGET 1000
+#define TARGET 10
GNUNET_NETWORK_STRUCT_BEGIN
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r23028 - gnunet/src/mesh,
gnunet <=