aboutsummaryrefslogtreecommitdiff
path: root/src/hostlist
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2020-05-17 20:02:57 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2020-05-17 20:02:57 +0200
commitd89a4c1ee6f00924233c799e50777ea985d5b213 (patch)
tree215610256687d848ab5c0661360763143d6c193f /src/hostlist
parent3362a671f77099f9f53cb998a45eec073576391a (diff)
downloadgnunet-d89a4c1ee6f00924233c799e50777ea985d5b213.tar.gz
gnunet-d89a4c1ee6f00924233c799e50777ea985d5b213.zip
deps are now required, no need for defines
Diffstat (limited to 'src/hostlist')
-rw-r--r--src/hostlist/Makefile.am4
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c16
2 files changed, 0 insertions, 20 deletions
diff --git a/src/hostlist/Makefile.am b/src/hostlist/Makefile.am
index a8621a2b0..3b534de70 100644
--- a/src/hostlist/Makefile.am
+++ b/src/hostlist/Makefile.am
@@ -10,12 +10,10 @@ if USE_COVERAGE
10 AM_CFLAGS = --coverage -O0 10 AM_CFLAGS = --coverage -O0
11endif 11endif
12 12
13if HAVE_MHD
14 HOSTLIST_SERVER_SOURCES = \ 13 HOSTLIST_SERVER_SOURCES = \
15 gnunet-daemon-hostlist_server.c gnunet-daemon-hostlist_server.h 14 gnunet-daemon-hostlist_server.c gnunet-daemon-hostlist_server.h
16 GN_LIBMHD = $(MHD_LIBS) 15 GN_LIBMHD = $(MHD_LIBS)
17 GN_CPPMHD = $(MHD_CFLAGS) 16 GN_CPPMHD = $(MHD_CFLAGS)
18endif
19 17
20if HAVE_LIBGNURL 18if HAVE_LIBGNURL
21libexec_PROGRAMS = \ 19libexec_PROGRAMS = \
@@ -70,13 +68,11 @@ check_PROGRAMS = \
70endif 68endif
71endif 69endif
72 70
73if HAVE_MHD
74if ENABLE_TEST_RUN 71if ENABLE_TEST_RUN
75AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; 72AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
76TESTS = \ 73TESTS = \
77 $(check_PROGRAMS) 74 $(check_PROGRAMS)
78endif 75endif
79endif
80 76
81test_gnunet_daemon_hostlist_SOURCES = \ 77test_gnunet_daemon_hostlist_SOURCES = \
82 test_gnunet_daemon_hostlist.c 78 test_gnunet_daemon_hostlist.c
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index 704c796b4..54e070f89 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -30,8 +30,6 @@
30#include "gnunet_protocols.h" 30#include "gnunet_protocols.h"
31#include "gnunet_statistics_service.h" 31#include "gnunet_statistics_service.h"
32 32
33#if HAVE_MHD
34
35#include "gnunet-daemon-hostlist_server.h" 33#include "gnunet-daemon-hostlist_server.h"
36 34
37/** 35/**
@@ -49,8 +47,6 @@ static int provide_hostlist;
49 */ 47 */
50static GNUNET_CORE_ConnectEventHandler server_ch; 48static GNUNET_CORE_ConnectEventHandler server_ch;
51 49
52#endif
53
54/** 50/**
55 * Set if we are allowed to learn about peers by accessing 51 * Set if we are allowed to learn about peers by accessing
56 * hostlist servers. 52 * hostlist servers.
@@ -211,13 +207,11 @@ connect_handler (void *cls,
211 (*client_ch)(cls, 207 (*client_ch)(cls,
212 peer, 208 peer,
213 mq)); 209 mq));
214#if HAVE_MHD
215 if (NULL != server_ch) 210 if (NULL != server_ch)
216 GNUNET_assert (NULL == 211 GNUNET_assert (NULL ==
217 (*server_ch)(cls, 212 (*server_ch)(cls,
218 peer, 213 peer,
219 mq)); 214 mq));
220#endif
221 return (void *) peer; 215 return (void *) peer;
222} 216}
223 217
@@ -265,12 +259,10 @@ cleaning_task (void *cls)
265 { 259 {
266 GNUNET_HOSTLIST_client_stop (); 260 GNUNET_HOSTLIST_client_stop ();
267 } 261 }
268#if HAVE_MHD
269 if (provide_hostlist) 262 if (provide_hostlist)
270 { 263 {
271 GNUNET_HOSTLIST_server_stop (); 264 GNUNET_HOSTLIST_server_stop ();
272 } 265 }
273#endif
274 if (NULL != stats) 266 if (NULL != stats)
275 { 267 {
276 GNUNET_STATISTICS_destroy (stats, 268 GNUNET_STATISTICS_destroy (stats,
@@ -306,9 +298,7 @@ run (void *cls,
306 }; 298 };
307 299
308 if ((! bootstrapping) && (! learning) 300 if ((! bootstrapping) && (! learning)
309#if HAVE_MHD
310 && (! provide_hostlist) 301 && (! provide_hostlist)
311#endif
312 ) 302 )
313 { 303 {
314 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 304 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -338,14 +328,12 @@ run (void *cls,
338 learning ? learn_handlers : no_learn_handlers); 328 learning ? learn_handlers : no_learn_handlers);
339 329
340 330
341#if HAVE_MHD
342 if (provide_hostlist) 331 if (provide_hostlist)
343 GNUNET_HOSTLIST_server_start (cfg, 332 GNUNET_HOSTLIST_server_start (cfg,
344 stats, 333 stats,
345 core, 334 core,
346 &server_ch, 335 &server_ch,
347 advertising); 336 advertising);
348#endif
349 GNUNET_SCHEDULER_add_shutdown (&cleaning_task, 337 GNUNET_SCHEDULER_add_shutdown (&cleaning_task,
350 NULL); 338 NULL);
351 339
@@ -370,13 +358,11 @@ int
370main (int argc, char *const *argv) 358main (int argc, char *const *argv)
371{ 359{
372 struct GNUNET_GETOPT_CommandLineOption options[] = { 360 struct GNUNET_GETOPT_CommandLineOption options[] = {
373#if HAVE_MHD
374 GNUNET_GETOPT_option_flag ('a', 361 GNUNET_GETOPT_option_flag ('a',
375 "advertise", 362 "advertise",
376 gettext_noop ( 363 gettext_noop (
377 "advertise our hostlist to other peers"), 364 "advertise our hostlist to other peers"),
378 &advertising), 365 &advertising),
379#endif
380 GNUNET_GETOPT_option_flag ('b', 366 GNUNET_GETOPT_option_flag ('b',
381 "bootstrap", 367 "bootstrap",
382 gettext_noop ( 368 gettext_noop (
@@ -387,12 +373,10 @@ main (int argc, char *const *argv)
387 gettext_noop ( 373 gettext_noop (
388 "enable learning about hostlist servers from other peers"), 374 "enable learning about hostlist servers from other peers"),
389 &learning), 375 &learning),
390#if HAVE_MHD
391 GNUNET_GETOPT_option_flag ('p', 376 GNUNET_GETOPT_option_flag ('p',
392 "provide-hostlist", 377 "provide-hostlist",
393 gettext_noop ("provide a hostlist server"), 378 gettext_noop ("provide a hostlist server"),
394 &provide_hostlist), 379 &provide_hostlist),
395#endif
396 GNUNET_GETOPT_OPTION_END 380 GNUNET_GETOPT_OPTION_END
397 }; 381 };
398 382