From 72a2c1b9542d68eab32f483a1c53eeec19bc12b3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 9 Feb 2015 14:28:45 +0000 Subject: -do only send HELLO to clients once on startup, do only send fully initialized HELLO to clients if we can help it, even the first one; do not perform blacklist check twice for try_connect --- src/transport/plugin_transport_wlan.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/transport/plugin_transport_wlan.c') diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index a5a72e8cc..42b7d8669 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c @@ -1681,9 +1681,11 @@ send_hello_beacon (void *cls, const struct GNUNET_MessageHeader *hello; hello = plugin->env->get_our_hello (); - hello_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello); - GNUNET_assert (sizeof (struct WlanHeader) + hello_size <= WLAN_MTU); - size = sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) + hello_size; + if (NULL != hello) + { + hello_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello); + GNUNET_assert (sizeof (struct WlanHeader) + hello_size <= WLAN_MTU); + size = sizeof (struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage) + hello_size; { char buf[size] GNUNET_ALIGN; @@ -1706,7 +1708,7 @@ send_hello_beacon (void *cls, GNUNET_STATISTICS_update (plugin->env->stats, _("# HELLO beacons sent"), 1, GNUNET_NO); - } + } } plugin->beacon_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (HELLO_BEACON_SCALING_FACTOR, -- cgit v1.2.3