From d6af5432c3f6a61cd9c1aea68e89e8da39c6219b Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 13 Apr 2010 12:14:08 +0000 Subject: Correct handling of daemon options to en/disable learning and advertising --- src/hostlist/gnunet-daemon-hostlist.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/hostlist/gnunet-daemon-hostlist.c') diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c index 919c80a99..9a12c98f1 100644 --- a/src/hostlist/gnunet-daemon-hostlist.c +++ b/src/hostlist/gnunet-daemon-hostlist.c @@ -168,7 +168,14 @@ static int advertisement_handler (void *cls, struct GNUNET_TIME_Relative latency, uint32_t distance) { - if (advertising && (NULL != client_adv_handler)) + if ( !learning ) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Recieved hostlist advertisement, but I am not learning!\n"); + return GNUNET_NO; + } + + if (learning && (NULL != client_adv_handler)) { (*client_adv_handler) (cls, peer, message, latency, distance); return GNUNET_YES; @@ -303,7 +310,7 @@ run (void *cls, } if (provide_hostlist) { - GNUNET_HOSTLIST_server_start (cfg, sched, stats, core, &server_ch, &server_dh); + GNUNET_HOSTLIST_server_start (cfg, sched, stats, core, &server_ch, &server_dh, advertising ); } if (learning) { -- cgit v1.2.3