diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-08-12 13:37:12 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-08-12 13:37:12 +0000 |
commit | ec42b7133b9b7816a52a15202dba092114d45694 (patch) | |
tree | 042ea2086d05cebee77e5263eb73b2a7ad199991 /src | |
parent | e35a51347df23fbeeec613c437ea7241a50aba0c (diff) | |
download | gnunet-ec42b7133b9b7816a52a15202dba092114d45694.tar.gz gnunet-ec42b7133b9b7816a52a15202dba092114d45694.zip |
- fix
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh-enc.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c index f0ba32902..38f3751ad 100644 --- a/src/mesh/gnunet-service-mesh-enc.c +++ b/src/mesh/gnunet-service-mesh-enc.c | |||
@@ -1224,6 +1224,22 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1224 | 1224 | ||
1225 | 1225 | ||
1226 | /** | 1226 | /** |
1227 | * Get the static string for a peer ID. | ||
1228 | * | ||
1229 | * @param peer Peer. | ||
1230 | * | ||
1231 | * @return Static string for it's ID. | ||
1232 | */ | ||
1233 | static const char * | ||
1234 | peer2s (const struct MeshPeer *peer) | ||
1235 | { | ||
1236 | if (NULL == peer) | ||
1237 | return "(NULL)"; | ||
1238 | return GNUNET_i2s (GNUNET_PEER_resolve2 (peer->id)); | ||
1239 | } | ||
1240 | |||
1241 | |||
1242 | /** | ||
1227 | * Get the previous hop in a connection | 1243 | * Get the previous hop in a connection |
1228 | * | 1244 | * |
1229 | * @param c Connection. | 1245 | * @param c Connection. |
@@ -1669,6 +1685,7 @@ send_connection_create (struct MeshConnection *connection) | |||
1669 | t = connection->t; | 1685 | t = connection->t; |
1670 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Send connection create\n"); | 1686 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Send connection create\n"); |
1671 | neighbor = connection_get_next_hop (connection); | 1687 | neighbor = connection_get_next_hop (connection); |
1688 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " to %s\n", peer2s (neighbor)); | ||
1672 | queue_add (connection, | 1689 | queue_add (connection, |
1673 | GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE, | 1690 | GNUNET_MESSAGE_TYPE_MESH_CONNECTION_CREATE, |
1674 | sizeof (struct GNUNET_MESH_ConnectionCreate) + | 1691 | sizeof (struct GNUNET_MESH_ConnectionCreate) + |
@@ -1978,20 +1995,6 @@ peer_delete_oldest (void) | |||
1978 | 1995 | ||
1979 | 1996 | ||
1980 | /** | 1997 | /** |
1981 | * Get the static string for a peer ID. | ||
1982 | * | ||
1983 | * @param peer Peer. | ||
1984 | * | ||
1985 | * @return Static string for it's ID. | ||
1986 | */ | ||
1987 | static const char * | ||
1988 | peer2s (const struct MeshPeer *peer) | ||
1989 | { | ||
1990 | return GNUNET_i2s (GNUNET_PEER_resolve2 (peer->id)); | ||
1991 | } | ||
1992 | |||
1993 | |||
1994 | /** | ||
1995 | * Retrieve the MeshPeer stucture associated with the peer, create one | 1998 | * Retrieve the MeshPeer stucture associated with the peer, create one |
1996 | * and insert it in the appropriate structures if the peer is not known yet. | 1999 | * and insert it in the appropriate structures if the peer is not known yet. |
1997 | * | 2000 | * |
@@ -3814,7 +3817,7 @@ tunnel_destroy (struct MeshTunnel2 *t) | |||
3814 | return; | 3817 | return; |
3815 | 3818 | ||
3816 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "destroying tunnel %s\n", | 3819 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "destroying tunnel %s\n", |
3817 | peer2s (t->peer); | 3820 | peer2s (t->peer)); |
3818 | 3821 | ||
3819 | if (GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (tunnels, &t->id, t)) | 3822 | if (GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (tunnels, &t->id, t)) |
3820 | GNUNET_break (0); | 3823 | GNUNET_break (0); |