From 307943e9b638c092503ebe523cef814dab77e191 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 9 Aug 2012 12:10:03 +0000 Subject: [PATCH] - fix PID sequence --- src/mesh/gnunet-service-mesh.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 57116eb85..419cc19da 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -4100,8 +4100,10 @@ tunnel_new (GNUNET_PEER_Id owner, t->bck_queue_max = t->fwd_queue_max; t->tree = tree_new (owner); t->owner = client; - t->bck_ack = INITIAL_WINDOW_SIZE; - t->last_fwd_ack = INITIAL_WINDOW_SIZE; + t->fwd_pid = (uint32_t) -1; // Next (expected) = 0 + t->bck_pid = (uint32_t) -1; // Next (expected) = 0 + t->bck_ack = INITIAL_WINDOW_SIZE - 1; + t->last_fwd_ack = INITIAL_WINDOW_SIZE - 1; t->local_tid = local; t->children_fc = GNUNET_CONTAINER_multihashmap_create (8); n_tunnels++; @@ -6870,7 +6872,13 @@ handle_local_unicast (void *cls, struct GNUNET_SERVER_Client *client, copy->oid = my_full_id; copy->tid = htonl (t->id.tid); copy->ttl = htonl (default_ttl); - GNUNET_assert (ntohl (copy->pid) == (t->fwd_pid + 1)); + if (ntohl (copy->pid) != t->fwd_pid + 1) + { + GNUNET_break (0); + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Unicast PID, expected %u, got %u\n", + t->fwd_pid + 1, ntohl (copy->pid)); + } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " calling generic handler...\n"); handle_mesh_data_unicast (NULL, &my_full_id, ©->header, NULL, 0); -- 2.25.1