From 4e4233047defb061094faab66ab4fa2a6e3ddd8a Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 14 May 2013 16:25:22 +0000 Subject: [PATCH] improved messages --- src/transport/plugin_transport_tcp.c | 14 ++++++++++++-- src/transport/plugin_transport_udp.c | 5 +++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 08fe21573..986eb4ef8 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -520,8 +520,9 @@ tcp_nat_port_map_callback (void *cls, int add_remove, void *arg; size_t args; - LOG (GNUNET_ERROR_TYPE_DEBUG, - "NPMC called with %d for address `%s'\n", add_remove, + LOG (GNUNET_ERROR_TYPE_INFO, + "NAT notification to %s address `%s'\n", + (GNUNET_YES == add_remove) ? "add" : "remove", GNUNET_a2s (addr, addrlen)); /* convert 'addr' to our internal format */ switch (addr->sa_family) @@ -2307,6 +2308,7 @@ libgnunet_plugin_transport_tcp_init (void *cls) unsigned int i; struct GNUNET_TIME_Relative idle_timeout; int ret; + int ret_s; struct sockaddr **addrs; socklen_t *addrlens; @@ -2376,11 +2378,19 @@ libgnunet_plugin_transport_tcp_init (void *cls) GNUNET_SERVICE_get_server_addresses ("transport-tcp", env->cfg, &addrs, &addrlens)))) { + ret_s = ret; + while (ret > 0) + { + ret--; + LOG (GNUNET_ERROR_TYPE_INFO, "Binding to address `%s'\n", GNUNET_a2s (addrs[ret], addrlens[ret])); + } + plugin->nat = GNUNET_NAT_register (env->cfg, GNUNET_YES, aport, (unsigned int) ret, (const struct sockaddr **) addrs, addrlens, &tcp_nat_port_map_callback, &try_connection_reversal, plugin); + ret = ret_s; while (ret > 0) { ret--; diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 3605bfde0..36a3650cf 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c @@ -1851,6 +1851,11 @@ udp_nat_port_map_callback (void *cls, int add_remove, void *arg; size_t args; + LOG (GNUNET_ERROR_TYPE_INFO, + "NAT notification to %s address `%s'\n", + (GNUNET_YES == add_remove) ? "add" : "remove", + GNUNET_a2s (addr, addrlen)); + /* convert 'addr' to our internal format */ switch (addr->sa_family) { -- 2.25.1