gnunet

Main GNUnet Logic
Log | Files | Refs | Submodules | README | LICENSE

commit 1d422c127740f43e1a28f97dffe78f34d7f26d57
parent 987ae64ee29d86619062823509ff3154694593f4
Author: Bart Polot <bart@net.in.tum.de>
Date:   Thu, 18 Jul 2013 11:53:49 +0000

- doc, warnings

Diffstat:
Msrc/include/gnunet_mesh_service.h | 4+++-
Msrc/mesh/gnunet-service-mesh.c | 2+-
Msrc/mesh/mesh_api.c | 12++++++++++++
3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h @@ -186,8 +186,9 @@ typedef void (GNUNET_MESH_TunnelEndHandler) (void *cls, * @param cfg Configuration to use. * @param cls Closure for the various callbacks that follow (including * handlers in the handlers array). - * @param new_tunnel Function called when an *inbound* tunnel is created. + * @param new_tunnel Function called when an *incoming* tunnel is created. * Can be NULL if no inbound tunnels are desired. + * See @c ports. * @param cleaner Function called when a tunnel is destroyed by the remote peer. * It is NOT called if GNUNET_MESH_tunnel_destroy is called on * the tunnel. @@ -196,6 +197,7 @@ typedef void (GNUNET_MESH_TunnelEndHandler) (void *cls, * receive the next message. Messages of a type that is not * in the handlers array are ignored if received. * @param ports NULL or 0-terminated array of port numbers for incoming tunnels. + * See @c new_tunnel. * * @return handle to the mesh service NULL on error * (in this case, init is never called) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c @@ -2669,7 +2669,7 @@ tunnel_send_destroy (struct MeshTunnel *t) /** - * Cancel all transmissions towards a neighbor that belongs to a certain tunnel. + * Cancel all transmissions towards a neighbor that belong to a certain tunnel. * * @param t Tunnel which to cancel. * @param neighbor Short ID of the neighbor to whom cancel the transmissions. diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c @@ -1320,6 +1320,18 @@ GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, h->reconnect_time = GNUNET_TIME_UNIT_MILLISECONDS; h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; + if (NULL != ports && ports[0] != 0 && NULL == new_tunnel) + { + GNUNET_break (0); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "no new tunnel handler given, ports parameter is useless!!\n"); + } + if ((NULL == ports || ports[0] == 0) && NULL != new_tunnel) + { + GNUNET_break (0); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "no ports given, new tunnel handler will never be called!!\n"); + } /* count handlers */ for (h->n_handlers = 0; handlers && handlers[h->n_handlers].type;