gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r33056 - gnunet/src/mesh
Date: Mon, 14 Apr 2014 13:09:39 +0200

Author: bartpolot
Date: 2014-04-14 13:09:39 +0200 (Mon, 14 Apr 2014)
New Revision: 33056

Modified:
   gnunet/src/mesh/gnunet-service-mesh_connection.c
Log:
- allow NULL peer id for broken connection

Modified: gnunet/src/mesh/gnunet-service-mesh_connection.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.c    2014-04-14 09:23:38 UTC 
(rev 33055)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.c    2014-04-14 11:09:39 UTC 
(rev 33056)
@@ -867,10 +867,10 @@
  * @param peer Peer to notify (neighbor who sent the connection).
  */
 static void
-send_broken2 (struct GNUNET_MESH_Hash *connection_id,
-             const struct GNUNET_PeerIdentity *id1,
-             const struct GNUNET_PeerIdentity *id2,
-             GNUNET_PEER_Id peer_id)
+send_broken_unknown (struct GNUNET_MESH_Hash *connection_id,
+                     const struct GNUNET_PeerIdentity *id1,
+                     const struct GNUNET_PeerIdentity *id2,
+                     GNUNET_PEER_Id peer_id)
 {
   struct GNUNET_MESH_ConnectionBroken *msg;
   struct MeshPeer *neighbor;
@@ -883,7 +883,10 @@
   msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN);
   msg->cid = *connection_id;
   msg->peer1 = *id1;
-  msg->peer2 = *id2;
+  if (NULL != id2)
+    msg->peer2 = *id2;
+  else
+    memset (&msg->peer2, 0, sizeof (msg->peer2));
   neighbor = GMP_get_short (peer_id);
   GMP_queue_add (neighbor, msg,
                  GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN,
@@ -1608,7 +1611,7 @@
         GNUNET_break (0);
         return GNUNET_OK;
       }
-      send_broken2 (cid, &my_full_id,
+      send_broken_unknown (cid, &my_full_id,
                     GNUNET_PEER_resolve2 (path->peers[own_pos + 1]),
                     path->peers[own_pos - 1]);
       path_destroy (path);




reply via email to

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