From: Bart Polot Date: Tue, 17 Jan 2012 19:45:04 +0000 (+0000) Subject: Added debug info for #2071 X-Git-Tag: initial-import-from-subversion-38251~15246 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=19a39da4e28c3190e9c99525001cc95af0ba64dd;p=oweals%2Fgnunet.git Added debug info for #2071 --- diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index eda2c0db5..f0492472a 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -759,7 +759,6 @@ process_tunnel_created (struct GNUNET_MESH_Handle *h, const struct GNUNET_MESH_TunnelNotification *msg) { struct GNUNET_MESH_Tunnel *t; - struct GNUNET_ATS_Information atsi; MESH_TunnelNumber tid; tid = ntohl (msg->tunnel_id); @@ -780,10 +779,16 @@ process_tunnel_created (struct GNUNET_MESH_Handle *h, t->tid = tid; if (NULL != h->new_tunnel) { + struct GNUNET_ATS_Information atsi; + atsi.type = 0; atsi.value = 0; t->ctx = h->new_tunnel (h->cls, t, &msg->peer, &atsi); } +#if MESH_API_DEBUG + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: new incoming tunnel %u\n", + t->tid); +#endif return; } @@ -812,7 +817,9 @@ process_tunnel_destroy (struct GNUNET_MESH_Handle *h, { GNUNET_break (0); } - +#if MESH_API_DEBUG + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: tunnel %u destroyed\n", t->tid); +#endif destroy_tunnel (t); return; } @@ -911,6 +918,13 @@ process_incoming_data (struct GNUNET_MESH_Handle *h, case GNUNET_MESSAGE_TYPE_MESH_MULTICAST: mcast = (struct GNUNET_MESH_Multicast *) message; t = retrieve_tunnel (h, ntohl (mcast->tid)); +#if MESH_API_DEBUG // FIXME debug for #2071 + if (NULL == t) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "mesh: tunnel %u unknown\n", + ntohl (mcast->tid)); + } +#endif payload = (struct GNUNET_MessageHeader *) &mcast[1]; peer = &mcast->oid; break;