diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-09-21 22:39:11 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-09-21 22:39:11 +0000 |
commit | 1e018e4e2e1d57cee223aa84f2ebd7e6c8160480 (patch) | |
tree | 5f9b2d379902901ce7fe02f3e82fbdfe357281a6 /src/mesh | |
parent | e163fb4e0712105b71ae508d441d06220eff5c6a (diff) | |
download | gnunet-1e018e4e2e1d57cee223aa84f2ebd7e6c8160480.tar.gz gnunet-1e018e4e2e1d57cee223aa84f2ebd7e6c8160480.zip |
Added notification when peers go offline during a path change
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 7ac577476..f39040851 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -1003,10 +1003,26 @@ tunnel_get (struct GNUNET_PeerIdentity *oid, MESH_TunnelNumber tid) | |||
1003 | } | 1003 | } |
1004 | 1004 | ||
1005 | 1005 | ||
1006 | /** | ||
1007 | * Callback used to notify a client owner of a tunnel that a peer has | ||
1008 | * disconnected, most likely because of a path change. | ||
1009 | * | ||
1010 | * @param n Node in the tree representing the disconnected peer | ||
1011 | */ | ||
1006 | void | 1012 | void |
1007 | notify_peer_disconnected (const struct MeshTunnelTreeNode *n) | 1013 | notify_peer_disconnected (const struct MeshTunnelTreeNode *n) |
1008 | { | 1014 | { |
1009 | 1015 | struct GNUNET_MESH_PeerControl msg; | |
1016 | |||
1017 | if (NULL == n->t->client || NULL == nc) | ||
1018 | return; | ||
1019 | |||
1020 | msg.header.size = htons (sizeof (msg)); | ||
1021 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_DEL); | ||
1022 | msg.tunnel_id = htonl (n->t->local_tid); | ||
1023 | GNUNET_PEER_resolve (n->peer, &msg.peer); | ||
1024 | GNUNET_SERVER_notification_context_unicast (nc, n->t->client->handle, | ||
1025 | &msg.header, GNUNET_NO); | ||
1010 | } | 1026 | } |
1011 | 1027 | ||
1012 | 1028 | ||