diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-04-14 11:09:39 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-04-14 11:09:39 +0000 |
commit | be63de9ad9df990015aa7a8a0f8a338985fbfde8 (patch) | |
tree | 3de43cefde1f6e9a4ff6eab6b8ce8b5073ed9475 /src | |
parent | a1504c5082ead63a1d9b1e77748691d25e2cb7ed (diff) | |
download | gnunet-be63de9ad9df990015aa7a8a0f8a338985fbfde8.tar.gz gnunet-be63de9ad9df990015aa7a8a0f8a338985fbfde8.zip |
- allow NULL peer id for broken connection
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 19dcba2e2..b18777c67 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c | |||
@@ -867,10 +867,10 @@ send_broken (struct MeshConnection *c, | |||
867 | * @param peer Peer to notify (neighbor who sent the connection). | 867 | * @param peer Peer to notify (neighbor who sent the connection). |
868 | */ | 868 | */ |
869 | static void | 869 | static void |
870 | send_broken2 (struct GNUNET_MESH_Hash *connection_id, | 870 | send_broken_unknown (struct GNUNET_MESH_Hash *connection_id, |
871 | const struct GNUNET_PeerIdentity *id1, | 871 | const struct GNUNET_PeerIdentity *id1, |
872 | const struct GNUNET_PeerIdentity *id2, | 872 | const struct GNUNET_PeerIdentity *id2, |
873 | GNUNET_PEER_Id peer_id) | 873 | GNUNET_PEER_Id peer_id) |
874 | { | 874 | { |
875 | struct GNUNET_MESH_ConnectionBroken *msg; | 875 | struct GNUNET_MESH_ConnectionBroken *msg; |
876 | struct MeshPeer *neighbor; | 876 | struct MeshPeer *neighbor; |
@@ -883,7 +883,10 @@ send_broken2 (struct GNUNET_MESH_Hash *connection_id, | |||
883 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN); | 883 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN); |
884 | msg->cid = *connection_id; | 884 | msg->cid = *connection_id; |
885 | msg->peer1 = *id1; | 885 | msg->peer1 = *id1; |
886 | msg->peer2 = *id2; | 886 | if (NULL != id2) |
887 | msg->peer2 = *id2; | ||
888 | else | ||
889 | memset (&msg->peer2, 0, sizeof (msg->peer2)); | ||
887 | neighbor = GMP_get_short (peer_id); | 890 | neighbor = GMP_get_short (peer_id); |
888 | GMP_queue_add (neighbor, msg, | 891 | GMP_queue_add (neighbor, msg, |
889 | GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN, | 892 | GNUNET_MESSAGE_TYPE_MESH_CONNECTION_BROKEN, |
@@ -1608,7 +1611,7 @@ GMC_handle_create (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1608 | GNUNET_break (0); | 1611 | GNUNET_break (0); |
1609 | return GNUNET_OK; | 1612 | return GNUNET_OK; |
1610 | } | 1613 | } |
1611 | send_broken2 (cid, &my_full_id, | 1614 | send_broken_unknown (cid, &my_full_id, |
1612 | GNUNET_PEER_resolve2 (path->peers[own_pos + 1]), | 1615 | GNUNET_PEER_resolve2 (path->peers[own_pos + 1]), |
1613 | path->peers[own_pos - 1]); | 1616 | path->peers[own_pos - 1]); |
1614 | path_destroy (path); | 1617 | path_destroy (path); |