From 20aa75ff9f63f68f543b6dde3851f8ba26791fac Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 22 Jul 2013 17:33:44 +0000 Subject: [PATCH] - add port number to debug --- src/mesh/gnunet-service-mesh.c | 7 ++++--- src/mesh/mesh_api.c | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index d6e48fcb8..610b2f01e 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -3936,7 +3936,8 @@ handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer, tid = ntohl (msg->tid); pi = (struct GNUNET_PeerIdentity *) &msg[1]; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - " path is for tunnel %s[%X].\n", GNUNET_i2s (pi), tid); + " path is for tunnel %s[%X]:%u.\n", + GNUNET_i2s (pi), tid, ntohl (msg->port)); t = tunnel_get (pi, tid); if (NULL == t) /* might be a local tunnel */ { @@ -5032,8 +5033,8 @@ handle_local_tunnel_create (void *cls, struct GNUNET_SERVER_Client *client, } t_msg = (struct GNUNET_MESH_TunnelMessage *) message; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " towards %s\n", - GNUNET_i2s (&t_msg->peer)); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " towards %s:%u\n", + GNUNET_i2s (&t_msg->peer), ntohl (t_msg->port)); tid = ntohl (t_msg->tunnel_id); /* Sanity check for duplicate tunnel IDs */ if (NULL != tunnel_get_by_local_id (c, tid)) diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 82f2f1ac8..fc91801ef 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -800,9 +800,11 @@ process_tunnel_created (struct GNUNET_MESH_Handle *h, { struct GNUNET_MESH_Tunnel *t; MESH_TunnelNumber tid; + uint32_t port; tid = ntohl (msg->tunnel_id); - LOG (GNUNET_ERROR_TYPE_DEBUG, "Creating incoming tunnel %X\n", tid); + port = ntohl (msg->port); + LOG (GNUNET_ERROR_TYPE_DEBUG, "Creating incoming tunnel %X:%u\n", tid, port); if (tid < GNUNET_MESH_LOCAL_TUNNEL_ID_SERV) { GNUNET_break (0); @@ -815,7 +817,7 @@ process_tunnel_created (struct GNUNET_MESH_Handle *h, t->peer = GNUNET_PEER_intern (&msg->peer); t->mesh = h; t->tid = tid; - t->port = ntohl (msg->port); + t->port = port; if (0 != (msg->opt & GNUNET_MESH_OPTION_NOBUFFER)) t->nobuffer = GNUNET_YES; else @@ -1444,7 +1446,9 @@ GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, struct GNUNET_MESH_Tunnel *t; struct GNUNET_MESH_TunnelMessage msg; - LOG (GNUNET_ERROR_TYPE_DEBUG, "Creating new tunnel\n"); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "Creating new tunnel to %s:%u\n", + GNUNET_i2s (peer), port); t = create_tunnel (h, 0); LOG (GNUNET_ERROR_TYPE_DEBUG, " at %p\n", t); LOG (GNUNET_ERROR_TYPE_DEBUG, " number %X\n", t->tid); -- 2.25.1