aboutsummaryrefslogtreecommitdiff
path: root/src/hostlist
diff options
context:
space:
mode:
Diffstat (limited to 'src/hostlist')
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c18
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.h18
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_client.c83
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_client.h18
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_server.c18
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_server.h18
-rw-r--r--src/hostlist/hostlist.conf4
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist.c36
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c30
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_peer1.conf6
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_peer2.conf6
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_reconnect.c36
-rw-r--r--src/hostlist/test_hostlist_defaults.conf6
-rw-r--r--src/hostlist/test_learning_adv_peer.conf6
-rw-r--r--src/hostlist/test_learning_learn_peer.conf6
-rw-r--r--src/hostlist/test_learning_learn_peer2.conf6
16 files changed, 138 insertions, 177 deletions
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index 854340d3d..31259b829 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2007, 2008, 2009, 2014 GNUnet e.V. 3 Copyright (C) 2007, 2008, 2009, 2014 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20 18
21/** 19/**
diff --git a/src/hostlist/gnunet-daemon-hostlist.h b/src/hostlist/gnunet-daemon-hostlist.h
index f19815b45..e94c9da26 100644
--- a/src/hostlist/gnunet-daemon-hostlist.h
+++ b/src/hostlist/gnunet-daemon-hostlist.h
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2009 GNUnet e.V. 3 Copyright (C) 2009 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20 18
21/** 19/**
diff --git a/src/hostlist/gnunet-daemon-hostlist_client.c b/src/hostlist/gnunet-daemon-hostlist_client.c
index 207cc4a81..43b4e4593 100644
--- a/src/hostlist/gnunet-daemon-hostlist_client.c
+++ b/src/hostlist/gnunet-daemon-hostlist_client.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2001-2010, 2014, 2016 GNUnet e.V. 3 Copyright (C) 2001-2010, 2014, 2016 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20/** 18/**
21 * @file hostlist/gnunet-daemon-hostlist_client.c 19 * @file hostlist/gnunet-daemon-hostlist_client.c
@@ -28,6 +26,7 @@
28#include "gnunet_hello_lib.h" 26#include "gnunet_hello_lib.h"
29#include "gnunet_statistics_service.h" 27#include "gnunet_statistics_service.h"
30#include "gnunet_transport_service.h" 28#include "gnunet_transport_service.h"
29#include "gnunet_peerinfo_service.h"
31#include "gnunet-daemon-hostlist.h" 30#include "gnunet-daemon-hostlist.h"
32#if HAVE_CURL_CURL_H 31#if HAVE_CURL_CURL_H
33#include <curl/curl.h> 32#include <curl/curl.h>
@@ -142,14 +141,6 @@ struct Hostlist
142}; 141};
143 142
144 143
145struct HelloOffer
146{
147 struct HelloOffer *next;
148 struct HelloOffer *prev;
149 struct GNUNET_TRANSPORT_OfferHelloHandle *ohh;
150};
151
152
153/** 144/**
154 * Our configuration. 145 * Our configuration.
155 */ 146 */
@@ -315,24 +306,10 @@ static unsigned int stat_hellos_obtained;
315 */ 306 */
316static unsigned int stat_connection_count; 307static unsigned int stat_connection_count;
317 308
318static struct HelloOffer *ho_head;
319
320static struct HelloOffer *ho_tail;
321
322
323/** 309/**
324 * Hello offer complete. Clean up. 310 * Handle to peerinfo service.
325 */ 311 */
326static void 312static struct GNUNET_PEERINFO_Handle *pi;
327done_offer_hello (void *cls)
328{
329 struct HelloOffer *ho = cls;
330
331 GNUNET_CONTAINER_DLL_remove (ho_head,
332 ho_tail,
333 ho);
334 GNUNET_free (ho);
335}
336 313
337 314
338/** 315/**
@@ -353,7 +330,6 @@ callback_download (void *ptr,
353 static char download_buffer[GNUNET_MAX_MESSAGE_SIZE - 1]; 330 static char download_buffer[GNUNET_MAX_MESSAGE_SIZE - 1];
354 const char *cbuf = ptr; 331 const char *cbuf = ptr;
355 const struct GNUNET_MessageHeader *msg; 332 const struct GNUNET_MessageHeader *msg;
356 struct HelloOffer *ho;
357 size_t total; 333 size_t total;
358 size_t cpy; 334 size_t cpy;
359 size_t left; 335 size_t left;
@@ -413,22 +389,10 @@ callback_download (void *ptr,
413 ("# valid HELLOs downloaded from hostlist servers"), 389 ("# valid HELLOs downloaded from hostlist servers"),
414 1, GNUNET_NO); 390 1, GNUNET_NO);
415 stat_hellos_obtained++; 391 stat_hellos_obtained++;
416 392 (void) GNUNET_PEERINFO_add_peer (pi,
417 ho = GNUNET_new (struct HelloOffer); 393 (const struct GNUNET_HELLO_Message *) msg,
418 ho->ohh = GNUNET_TRANSPORT_offer_hello (cfg, 394 NULL,
419 msg, 395 NULL);
420 &done_offer_hello,
421 ho);
422 if (NULL == ho->ohh)
423 {
424 GNUNET_free (ho);
425 }
426 else
427 {
428 GNUNET_CONTAINER_DLL_insert (ho_head,
429 ho_tail,
430 ho);
431 }
432 } 396 }
433 else 397 else
434 { 398 {
@@ -1567,6 +1531,7 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
1567 stats = st; 1531 stats = st;
1568 1532
1569 /* Read proxy configuration */ 1533 /* Read proxy configuration */
1534 pi = GNUNET_PEERINFO_connect (c);
1570 if (GNUNET_OK == 1535 if (GNUNET_OK ==
1571 GNUNET_CONFIGURATION_get_value_string (cfg, 1536 GNUNET_CONFIGURATION_get_value_string (cfg,
1572 "HOSTLIST", 1537 "HOSTLIST",
@@ -1723,18 +1688,8 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
1723void 1688void
1724GNUNET_HOSTLIST_client_stop () 1689GNUNET_HOSTLIST_client_stop ()
1725{ 1690{
1726 struct HelloOffer *ho;
1727
1728 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1691 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1729 "Hostlist client shutdown\n"); 1692 "Hostlist client shutdown\n");
1730 while (NULL != (ho = ho_head))
1731 {
1732 GNUNET_CONTAINER_DLL_remove (ho_head,
1733 ho_tail,
1734 ho);
1735 GNUNET_TRANSPORT_offer_hello_cancel (ho->ohh);
1736 GNUNET_free (ho);
1737 }
1738 if (NULL != sget) 1693 if (NULL != sget)
1739 { 1694 {
1740 GNUNET_STATISTICS_get_cancel (sget); 1695 GNUNET_STATISTICS_get_cancel (sget);
@@ -1777,7 +1732,11 @@ GNUNET_HOSTLIST_client_stop ()
1777 proxy_username = NULL; 1732 proxy_username = NULL;
1778 GNUNET_free_non_null (proxy_password); 1733 GNUNET_free_non_null (proxy_password);
1779 proxy_password = NULL; 1734 proxy_password = NULL;
1780 1735 if (NULL != pi)
1736 {
1737 GNUNET_PEERINFO_disconnect (pi);
1738 pi = NULL;
1739 }
1781 cfg = NULL; 1740 cfg = NULL;
1782} 1741}
1783 1742
diff --git a/src/hostlist/gnunet-daemon-hostlist_client.h b/src/hostlist/gnunet-daemon-hostlist_client.h
index e41b90876..c7ee072a9 100644
--- a/src/hostlist/gnunet-daemon-hostlist_client.h
+++ b/src/hostlist/gnunet-daemon-hostlist_client.h
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2009 GNUnet e.V. 3 Copyright (C) 2009 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20/** 18/**
21 * @file hostlist/gnunet-daemon-hostlist_client.h 19 * @file hostlist/gnunet-daemon-hostlist_client.h
diff --git a/src/hostlist/gnunet-daemon-hostlist_server.c b/src/hostlist/gnunet-daemon-hostlist_server.c
index 3df6f1ef8..8687d6e95 100644
--- a/src/hostlist/gnunet-daemon-hostlist_server.c
+++ b/src/hostlist/gnunet-daemon-hostlist_server.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2008, 2009, 2010, 2014, 2016 GNUnet e.V. 3 Copyright (C) 2008, 2009, 2010, 2014, 2016 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20 18
21/** 19/**
diff --git a/src/hostlist/gnunet-daemon-hostlist_server.h b/src/hostlist/gnunet-daemon-hostlist_server.h
index d9f778a4b..d30c68131 100644
--- a/src/hostlist/gnunet-daemon-hostlist_server.h
+++ b/src/hostlist/gnunet-daemon-hostlist_server.h
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2009 GNUnet e.V. 3 Copyright (C) 2009 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20 18
21/** 19/**
diff --git a/src/hostlist/hostlist.conf b/src/hostlist/hostlist.conf
index 77cd29e73..32e5d8320 100644
--- a/src/hostlist/hostlist.conf
+++ b/src/hostlist/hostlist.conf
@@ -1,5 +1,5 @@
1[hostlist] 1[hostlist]
2FORCESTART = YES 2IMMEDIATE_START = YES
3NOARMBIND = YES 3NOARMBIND = YES
4BINARY = gnunet-daemon-hostlist 4BINARY = gnunet-daemon-hostlist
5 5
@@ -41,3 +41,5 @@ SERVERS = http://v10.gnunet.org/hostlist https://gnunet.io/hostlist
41# Valid values: HTTP, HTTP_1_0, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME 41# Valid values: HTTP, HTTP_1_0, SOCKS4, SOCKS5, SOCKS4A, SOCKS5_HOSTNAME
42# Default: HTTP 42# Default: HTTP
43# PROXY_TYPE = HTTP 43# PROXY_TYPE = HTTP
44
45
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c
index eb4a85115..c3292939f 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet 2 This file is part of GNUnet
3 Copyright (C) 2009, 2016 GNUnet e.V. 3 Copyright (C) 2009, 2016 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20/** 18/**
21 * @file hostlist/test_gnunet_daemon_hostlist.c 19 * @file hostlist/test_gnunet_daemon_hostlist.c
@@ -265,16 +263,22 @@ main (int argc, char *argv[])
265{ 263{
266 int ret; 264 int ret;
267 265
268 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); 266 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer1.conf",
269 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); 267 "GNUNET_TEST_HOME");
270 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist"); 268 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer2.conf",
269 "GNUNET_TEST_HOME");
270 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_data.conf",
271 "GNUNET_TEST_HOME");
271 GNUNET_log_setup ("test-gnunet-daemon-hostlist", 272 GNUNET_log_setup ("test-gnunet-daemon-hostlist",
272 "WARNING", 273 "WARNING",
273 NULL); 274 NULL);
274 ret = check (); 275 ret = check ();
275 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); 276 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer1.conf",
276 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); 277 "GNUNET_TEST_HOME");
277 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist"); 278 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer2.conf",
279 "GNUNET_TEST_HOME");
280 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_data.conf",
281 "GNUNET_TEST_HOME");
278 return ret; 282 return ret;
279} 283}
280 284
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
index 88ad22a1a..e420a5022 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet 2 This file is part of GNUnet
3 Copyright (C) 2009, 2010, 2011, 2012, 2016 GNUnet e.V. 3 Copyright (C) 2009, 2010, 2011, 2012, 2016 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20/** 18/**
21 * @file hostlist/test_gnunet_daemon_hostlist_learning.c 19 * @file hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -562,14 +560,18 @@ main (int argc, char *argv[])
562{ 560{
563 int ret; 561 int ret;
564 562
565 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); 563 GNUNET_DISK_purge_cfg_dir ("test_learning_learn_peer.conf",
566 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); 564 "GNUNET_TEST_HOME");
565 GNUNET_DISK_purge_cfg_dir ("test_learning_adv_peer.conf",
566 "GNUNET_TEST_HOME");
567 GNUNET_log_setup ("test-gnunet-daemon-hostlist", 567 GNUNET_log_setup ("test-gnunet-daemon-hostlist",
568 "WARNING", 568 "WARNING",
569 NULL); 569 NULL);
570 ret = check (); 570 ret = check ();
571 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); 571 GNUNET_DISK_purge_cfg_dir ("test_learning_learn_peer.conf",
572 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); 572 "GNUNET_TEST_HOME");
573 GNUNET_DISK_purge_cfg_dir ("test_learning_adv_peer.conf",
574 "GNUNET_TEST_HOME");
573 if (GNUNET_YES == 575 if (GNUNET_YES ==
574 GNUNET_DISK_file_test ("hostlists_learn_peer.file")) 576 GNUNET_DISK_file_test ("hostlists_learn_peer.file"))
575 { 577 {
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
index 6269a13fe..00c57c1e5 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
+++ b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
@@ -1,6 +1,6 @@
1@INLINE@ test_hostlist_defaults.conf 1@INLINE@ test_hostlist_defaults.conf
2[PATHS] 2[PATHS]
3GNUNET_TEST_HOME = /tmp/test-gnunet-hostlist-peer-1/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-hostlist-peer-1/
4 4
5[transport-tcp] 5[transport-tcp]
6PORT = 12968 6PORT = 12968
@@ -34,11 +34,11 @@ HTTPPORT = 12980
34HOSTLISTFILE = hostlists_peer1.file 34HOSTLISTFILE = hostlists_peer1.file
35OPTIONS = -b -p 35OPTIONS = -b -p
36SERVERS = http://localhost:22981/ 36SERVERS = http://localhost:22981/
37FORCESTART = YES 37IMMEDIATE_START = YES
38 38
39[ats] 39[ats]
40PORT = 12971 40PORT = 12971
41UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-ats.sock 41UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-ats.sock
42 42
43[topology] 43[topology]
44FORCESTART = YES \ No newline at end of file 44IMMEDIATE_START = YES
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
index 91df6a65d..6bcd63fe7 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
+++ b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
@@ -1,6 +1,6 @@
1@INLINE@ test_hostlist_defaults.conf 1@INLINE@ test_hostlist_defaults.conf
2[PATHS] 2[PATHS]
3GNUNET_TEST_HOME = /tmp/test-gnunet-hostlist-peer-2/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-hostlist-peer-2/
4 4
5[transport-tcp] 5[transport-tcp]
6PORT = 22968 6PORT = 22968
@@ -34,11 +34,11 @@ HTTPPORT = 22981
34HOSTLISTFILE = hostlists_peer2.file 34HOSTLISTFILE = hostlists_peer2.file
35OPTIONS = -b -p 35OPTIONS = -b -p
36SERVERS = http://localhost:12980/ 36SERVERS = http://localhost:12980/
37FORCESTART = YES 37IMMEDIATE_START = YES
38 38
39[ats] 39[ats]
40PORT = 22971 40PORT = 22971
41UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-ats.sock 41UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-ats.sock
42 42
43[topology] 43[topology]
44FORCESTART = YES 44IMMEDIATE_START = YES
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
index 2ebc780a7..dad55f3d3 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet 2 This file is part of GNUnet
3 Copyright (C) 2010, 2016 GNUnet e.V. 3 Copyright (C) 2010, 2016 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20/** 18/**
21 * @file hostlist/test_gnunet_daemon_hostlist_reconnect.c 19 * @file hostlist/test_gnunet_daemon_hostlist_reconnect.c
@@ -242,9 +240,12 @@ main (int argcx,
242 GNUNET_GETOPT_OPTION_END 240 GNUNET_GETOPT_OPTION_END
243 }; 241 };
244 242
245 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); 243 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer1.conf",
246 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); 244 "GNUNET_TEST_HOME");
247 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3"); 245 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer2.conf",
246 "GNUNET_TEST_HOME");
247 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_data.conf",
248 "GNUNET_TEST_HOME");
248 GNUNET_log_setup ("test-gnunet-daemon-hostlist", 249 GNUNET_log_setup ("test-gnunet-daemon-hostlist",
249 "WARNING", 250 "WARNING",
250 NULL); 251 NULL);
@@ -272,9 +273,12 @@ main (int argcx,
272 "%s", 273 "%s",
273 ".\n"); 274 ".\n");
274 } 275 }
275 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); 276 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer1.conf",
276 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); 277 "GNUNET_TEST_HOME");
277 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3"); 278 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer2.conf",
279 "GNUNET_TEST_HOME");
280 GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_data.conf",
281 "GNUNET_TEST_HOME");
278 return ok; 282 return ok;
279} 283}
280 284
diff --git a/src/hostlist/test_hostlist_defaults.conf b/src/hostlist/test_hostlist_defaults.conf
index 2c9e14fc1..dcd2790b0 100644
--- a/src/hostlist/test_hostlist_defaults.conf
+++ b/src/hostlist/test_hostlist_defaults.conf
@@ -1,8 +1,8 @@
1@INLINE@ ../../contrib/no_forcestart.conf 1@INLINE@ ../../contrib/conf/gnunet/no_forcestart.conf
2@INLINE@ ../../contrib/no_autostart_above_core.conf 2@INLINE@ ../../contrib/conf/gnunet/no_autostart_above_core.conf
3 3
4[PATHS] 4[PATHS]
5GNUNET_TEST_HOME = /tmp/test-gnunet-hostlist/ 5GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-hostlist/
6 6
7[transport] 7[transport]
8PLUGINS = tcp 8PLUGINS = tcp
diff --git a/src/hostlist/test_learning_adv_peer.conf b/src/hostlist/test_learning_adv_peer.conf
index 0b010ada1..3bee3c0c7 100644
--- a/src/hostlist/test_learning_adv_peer.conf
+++ b/src/hostlist/test_learning_adv_peer.conf
@@ -1,6 +1,6 @@
1@INLINE@ test_hostlist_defaults.conf 1@INLINE@ test_hostlist_defaults.conf
2[PATHS] 2[PATHS]
3GNUNET_TEST_HOME = /tmp/test-gnunet-hostlist-peer-1/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-hostlist-peer-1/
4 4
5[transport-tcp] 5[transport-tcp]
6PORT = 22968 6PORT = 22968
@@ -35,11 +35,11 @@ HOSTLISTFILE = hostlists_adv_peer.file
35OPTIONS = -p -a 35OPTIONS = -p -a
36SERVERS = http://localhost:12981/ 36SERVERS = http://localhost:12981/
37EXTERNAL_DNS_NAME = localhost 37EXTERNAL_DNS_NAME = localhost
38FORCESTART = YES 38IMMEDIATE_START = YES
39 39
40[ats] 40[ats]
41PORT = 22971 41PORT = 22971
42UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-ats-p2-service-core.sock 42UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-ats-p2-service-core.sock
43 43
44[topology] 44[topology]
45FORCESTART = YES 45IMMEDIATE_START = YES
diff --git a/src/hostlist/test_learning_learn_peer.conf b/src/hostlist/test_learning_learn_peer.conf
index 6675ba364..0dafe6302 100644
--- a/src/hostlist/test_learning_learn_peer.conf
+++ b/src/hostlist/test_learning_learn_peer.conf
@@ -1,6 +1,6 @@
1@INLINE@ test_hostlist_defaults.conf 1@INLINE@ test_hostlist_defaults.conf
2[PATHS] 2[PATHS]
3GNUNET_TEST_HOME = /tmp/test-gnunet-hostlist-peer-2/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-hostlist-peer-2/
4 4
5[transport-tcp] 5[transport-tcp]
6PORT = 12968 6PORT = 12968
@@ -34,11 +34,11 @@ HTTPPORT = 12980
34HOSTLISTFILE = hostlists_learn_peer.file 34HOSTLISTFILE = hostlists_learn_peer.file
35OPTIONS = -b -e 35OPTIONS = -b -e
36SERVERS = http://localhost:12981/ 36SERVERS = http://localhost:12981/
37FORCESTART = YES 37IMMEDIATE_START = YES
38 38
39[ats] 39[ats]
40PORT = 12971 40PORT = 12971
41UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-ats-p1-service-core.sock 41UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-ats-p1-service-core.sock
42 42
43[topology] 43[topology]
44FORCESTART = YES 44IMMEDIATE_START = YES
diff --git a/src/hostlist/test_learning_learn_peer2.conf b/src/hostlist/test_learning_learn_peer2.conf
index 6fd289e49..dc2956dcc 100644
--- a/src/hostlist/test_learning_learn_peer2.conf
+++ b/src/hostlist/test_learning_learn_peer2.conf
@@ -1,6 +1,6 @@
1@INLINE@ test_hostlist_defaults.conf 1@INLINE@ test_hostlist_defaults.conf
2[PATHS] 2[PATHS]
3GNUNET_TEST_HOME = /tmp/test-gnunet-hostlist-peer-3/ 3GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-hostlist-peer-3/
4 4
5[transport-tcp] 5[transport-tcp]
6PORT = 32968 6PORT = 32968
@@ -34,7 +34,7 @@ HTTPPORT = 32980
34HOSTLISTFILE = hostlists_learn_peer2.file 34HOSTLISTFILE = hostlists_learn_peer2.file
35OPTIONS = -b -e 35OPTIONS = -b -e
36SERVERS = http://localhost:12981/ 36SERVERS = http://localhost:12981/
37FORCESTART = YES 37IMMEDIATE_START = YES
38 38
39[topology] 39[topology]
40FORCESTART = YES 40IMMEDIATE_START = YES