diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-09-26 19:44:27 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-09-26 19:44:27 +0000 |
commit | 23dfcefbf671f8bf529d84b7327599480ba4c7df (patch) | |
tree | 19c385b1f47962228c3ea07d6f57042201ec1dad /src/mesh | |
parent | 461cc5743782469d2ecf8b130c2f359ea741cc13 (diff) | |
download | gnunet-23dfcefbf671f8bf529d84b7327599480ba4c7df.tar.gz gnunet-23dfcefbf671f8bf529d84b7327599480ba4c7df.zip |
Fixed updating status of peer on ACK
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 16 |
1 files 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, | |||
1977 | * | 1977 | * |
1978 | * @return GNUNET_OK to keep the connection open, | 1978 | * @return GNUNET_OK to keep the connection open, |
1979 | * GNUNET_SYSERR to close it (signal serious error) | 1979 | * GNUNET_SYSERR to close it (signal serious error) |
1980 | * | ||
1981 | * FIXME path change state | ||
1982 | */ | 1980 | */ |
1983 | static int | 1981 | static int |
1984 | handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer, | 1982 | 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, | |||
1986 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) | 1984 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
1987 | { | 1985 | { |
1988 | struct GNUNET_MESH_PathACK *msg; | 1986 | struct GNUNET_MESH_PathACK *msg; |
1989 | struct MeshTunnel *t; | 1987 | struct MeshTunnelTreeNode *n; |
1990 | struct MeshPeerInfo *peer_info; | 1988 | struct MeshPeerInfo *peer_info; |
1989 | struct MeshTunnel *t; | ||
1991 | 1990 | ||
1992 | msg = (struct GNUNET_MESH_PathACK *) message; | 1991 | msg = (struct GNUNET_MESH_PathACK *) message; |
1993 | t = tunnel_get (&msg->oid, msg->tid); | 1992 | t = tunnel_get (&msg->oid, msg->tid); |
@@ -2000,10 +1999,9 @@ handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2000 | /* Message for us? */ | 1999 | /* Message for us? */ |
2001 | if (0 == memcmp (&msg->oid, &my_full_id, sizeof (struct GNUNET_PeerIdentity))) | 2000 | if (0 == memcmp (&msg->oid, &my_full_id, sizeof (struct GNUNET_PeerIdentity))) |
2002 | { | 2001 | { |
2003 | |||
2004 | if (NULL == t->client) | 2002 | if (NULL == t->client) |
2005 | { | 2003 | { |
2006 | GNUNET_break (0); | 2004 | GNUNET_break_op (0); |
2007 | return GNUNET_OK; | 2005 | return GNUNET_OK; |
2008 | } | 2006 | } |
2009 | peer_info = peer_info_get (&msg->peer_id); | 2007 | peer_info = peer_info_get (&msg->peer_id); |
@@ -2012,7 +2010,13 @@ handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2012 | GNUNET_break_op (0); | 2010 | GNUNET_break_op (0); |
2013 | return GNUNET_OK; | 2011 | return GNUNET_OK; |
2014 | } | 2012 | } |
2015 | /* FIXME change state of peer */ | 2013 | n = tree_find_peer(t->tree, peer_info->id); |
2014 | if (NULL == n) | ||
2015 | { | ||
2016 | GNUNET_break_op (0); | ||
2017 | return GNUNET_OK; | ||
2018 | } | ||
2019 | n->status = MESH_PEER_READY; | ||
2016 | send_client_peer_connected(t, peer_info->id); | 2020 | send_client_peer_connected(t, peer_info->id); |
2017 | return GNUNET_OK; | 2021 | return GNUNET_OK; |
2018 | } | 2022 | } |