diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-04-13 12:14:08 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-04-13 12:14:08 +0000 |
commit | d6af5432c3f6a61cd9c1aea68e89e8da39c6219b (patch) | |
tree | a4155c902ab3587ca4ddb955cead01d48c62fdc4 /src/hostlist/gnunet-daemon-hostlist.c | |
parent | 9c4745fd9fb2bb40c985fe0b7bd79d07b55114fa (diff) | |
download | gnunet-d6af5432c3f6a61cd9c1aea68e89e8da39c6219b.tar.gz gnunet-d6af5432c3f6a61cd9c1aea68e89e8da39c6219b.zip |
Correct handling of daemon options to en/disable learning and advertising
Diffstat (limited to 'src/hostlist/gnunet-daemon-hostlist.c')
-rw-r--r-- | src/hostlist/gnunet-daemon-hostlist.c | 11 |
1 files changed, 9 insertions, 2 deletions
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, | |||
168 | struct GNUNET_TIME_Relative latency, | 168 | struct GNUNET_TIME_Relative latency, |
169 | uint32_t distance) | 169 | uint32_t distance) |
170 | { | 170 | { |
171 | if (advertising && (NULL != client_adv_handler)) | 171 | if ( !learning ) |
172 | { | ||
173 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
174 | "Recieved hostlist advertisement, but I am not learning!\n"); | ||
175 | return GNUNET_NO; | ||
176 | } | ||
177 | |||
178 | if (learning && (NULL != client_adv_handler)) | ||
172 | { | 179 | { |
173 | (*client_adv_handler) (cls, peer, message, latency, distance); | 180 | (*client_adv_handler) (cls, peer, message, latency, distance); |
174 | return GNUNET_YES; | 181 | return GNUNET_YES; |
@@ -303,7 +310,7 @@ run (void *cls, | |||
303 | } | 310 | } |
304 | if (provide_hostlist) | 311 | if (provide_hostlist) |
305 | { | 312 | { |
306 | GNUNET_HOSTLIST_server_start (cfg, sched, stats, core, &server_ch, &server_dh); | 313 | GNUNET_HOSTLIST_server_start (cfg, sched, stats, core, &server_ch, &server_dh, advertising ); |
307 | } | 314 | } |
308 | if (learning) | 315 | if (learning) |
309 | { | 316 | { |