summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-09 14:28:45 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-09 14:28:45 +0000
commit72a2c1b9542d68eab32f483a1c53eeec19bc12b3 (patch)
tree36fe4082af27fba371e51bb838d8a0435e032432 /src/transport/gnunet-service-transport.c
parent6806f421c1164921cfa265ddc7009c08986bc915 (diff)
-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
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r--src/transport/gnunet-service-transport.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 336925f4f..65519914a 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -215,6 +215,11 @@ transmit_our_hello (void *cls,
{
const struct GNUNET_MessageHeader *hello = cls;
+ if (0 ==
+ memcmp (peer,
+ &GST_my_identity,
+ sizeof (struct GNUNET_PeerIdentity)))
+ return; /* not to ourselves */
if (GNUNET_NO == GST_neighbours_test_connected (peer))
return;
@@ -236,8 +241,13 @@ static void
process_hello_update (void *cls,
const struct GNUNET_MessageHeader *hello)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Broadcasting HELLO to clients\n");
GST_clients_broadcast (hello, GNUNET_NO);
- GST_neighbours_iterate (&transmit_our_hello, (void *) hello);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Broadcasting HELLO to neighbours\n");
+ GST_neighbours_iterate (&transmit_our_hello,
+ (void *) hello);
}
@@ -1051,14 +1061,18 @@ run (void *cls,
"Limiting number of sockets to %u: validation %u, neighbors: %u\n",
max_fd, (max_fd / 3), (max_fd / 3) * 2);
- friend_only = GNUNET_CONFIGURATION_get_value_yesno (GST_cfg, "topology",
- "FRIENDS-ONLY");
+ friend_only = GNUNET_CONFIGURATION_get_value_yesno (GST_cfg,
+ "topology",
+ "FRIENDS-ONLY");
if (GNUNET_SYSERR == friend_only)
friend_only = GNUNET_NO; /* According to topology defaults */
/* start subsystems */
- GST_hello_start (friend_only, &process_hello_update, NULL );
- GNUNET_assert(NULL != GST_hello_get());
- GST_blacklist_start (GST_server, GST_cfg, &GST_my_identity);
+ GST_hello_start (friend_only,
+ &process_hello_update,
+ NULL);
+ GST_blacklist_start (GST_server,
+ GST_cfg,
+ &GST_my_identity);
is = GNUNET_ATS_scanner_init ();
GST_ats_connect = GNUNET_ATS_connectivity_init (GST_cfg);
GST_ats = GNUNET_ATS_scheduling_init (GST_cfg,