gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r17000 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r17000 - gnunet/src/mesh
Date: Thu, 22 Sep 2011 00:39:11 +0200

Author: bartpolot
Date: 2011-09-22 00:39:11 +0200 (Thu, 22 Sep 2011)
New Revision: 17000

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
Added notification when peers go offline during a path change


Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2011-09-21 20:50:20 UTC (rev 
16999)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2011-09-21 22:39:11 UTC (rev 
17000)
@@ -1003,10 +1003,26 @@
 }
 
 
+/**
+ * Callback used to notify a client owner of a tunnel that a peer has
+ * disconnected, most likely because of a path change.
+ *
+ * @param n Node in the tree representing the disconnected peer
+ */
 void
 notify_peer_disconnected (const struct MeshTunnelTreeNode *n)
 {
-  
+  struct GNUNET_MESH_PeerControl msg;
+
+  if (NULL == n->t->client || NULL == nc)
+    return;
+
+  msg.header.size = htons (sizeof (msg));
+  msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_PEER_DEL);
+  msg.tunnel_id = htonl (n->t->local_tid);
+  GNUNET_PEER_resolve (n->peer, &msg.peer);
+  GNUNET_SERVER_notification_context_unicast (nc, n->t->client->handle,
+                                              &msg.header, GNUNET_NO);
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]