From 23dfcefbf671f8bf529d84b7327599480ba4c7df Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 26 Sep 2011 19:44:27 +0000 Subject: [PATCH] Fixed updating status of peer on ACK --- src/mesh/gnunet-service-mesh.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 615da463e..539d5ebdb 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -1977,8 +1977,6 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, * * @return GNUNET_OK to keep the connection open, * GNUNET_SYSERR to close it (signal serious error) - * - * FIXME path change state */ static int handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer, @@ -1986,8 +1984,9 @@ handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_TRANSPORT_ATS_Information *atsi) { struct GNUNET_MESH_PathACK *msg; - struct MeshTunnel *t; + struct MeshTunnelTreeNode *n; struct MeshPeerInfo *peer_info; + struct MeshTunnel *t; msg = (struct GNUNET_MESH_PathACK *) message; t = tunnel_get (&msg->oid, msg->tid); @@ -2000,10 +1999,9 @@ handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer, /* Message for us? */ if (0 == memcmp (&msg->oid, &my_full_id, sizeof (struct GNUNET_PeerIdentity))) { - if (NULL == t->client) { - GNUNET_break (0); + GNUNET_break_op (0); return GNUNET_OK; } peer_info = peer_info_get (&msg->peer_id); @@ -2012,7 +2010,13 @@ handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_break_op (0); return GNUNET_OK; } - /* FIXME change state of peer */ + n = tree_find_peer(t->tree, peer_info->id); + if (NULL == n) + { + GNUNET_break_op (0); + return GNUNET_OK; + } + n->status = MESH_PEER_READY; send_client_peer_connected(t, peer_info->id); return GNUNET_OK; } -- 2.25.1