diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-01-17 21:07:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-01-17 21:07:12 +0000 |
commit | 96f959b206cb03d23456630db6c9567bd0e807b2 (patch) | |
tree | e9dc495041da805e068fa15569c680bfa1ca5b6c /src/hostlist | |
parent | c549525a287501f14f7acb578b1dffd52add1b37 (diff) | |
download | gnunet-96f959b206cb03d23456630db6c9567bd0e807b2.tar.gz gnunet-96f959b206cb03d23456630db6c9567bd0e807b2.zip |
fixes
Diffstat (limited to 'src/hostlist')
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist.c | 31 | ||||
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist_peer1.conf | 3 | ||||
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist_peer2.conf | 3 |
3 files changed, 23 insertions, 14 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c index 0d5ab561d..904990a83 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist.c +++ b/src/hostlist/test_gnunet_daemon_hostlist.c | |||
@@ -62,10 +62,16 @@ static struct PeerContext p2; | |||
62 | static void | 62 | static void |
63 | clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 63 | clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
64 | { | 64 | { |
65 | GNUNET_TRANSPORT_disconnect (p1.th); | 65 | if (p1.th != NULL) |
66 | p1.th = NULL; | 66 | { |
67 | GNUNET_TRANSPORT_disconnect (p2.th); | 67 | GNUNET_TRANSPORT_disconnect (p1.th); |
68 | p2.th = NULL; | 68 | p1.th = NULL; |
69 | } | ||
70 | if (p2.th != NULL) | ||
71 | { | ||
72 | GNUNET_TRANSPORT_disconnect (p2.th); | ||
73 | p2.th = NULL; | ||
74 | } | ||
69 | GNUNET_SCHEDULER_shutdown (sched); | 75 | GNUNET_SCHEDULER_shutdown (sched); |
70 | } | 76 | } |
71 | 77 | ||
@@ -99,13 +105,16 @@ notify_connect (void *cls, | |||
99 | return; | 105 | return; |
100 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 106 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
101 | "Peers connected, shutting down.\n"); | 107 | "Peers connected, shutting down.\n"); |
102 | GNUNET_assert (ok == 4); | ||
103 | ok = 0; | 108 | ok = 0; |
104 | GNUNET_SCHEDULER_cancel (sched, | 109 | if (timeout_task != GNUNET_SCHEDULER_NO_TASK) |
105 | timeout_task); | 110 | { |
106 | timeout_task = GNUNET_SCHEDULER_NO_TASK; | 111 | GNUNET_SCHEDULER_cancel (sched, |
107 | GNUNET_SCHEDULER_add_now (sched, | 112 | timeout_task); |
108 | &clean_up, NULL); | 113 | timeout_task = GNUNET_SCHEDULER_NO_TASK; |
114 | } | ||
115 | GNUNET_SCHEDULER_add_delayed (sched, | ||
116 | GNUNET_TIME_UNIT_MINUTES, | ||
117 | &clean_up, NULL); | ||
109 | } | 118 | } |
110 | 119 | ||
111 | 120 | ||
@@ -121,8 +130,6 @@ process_hello (void *cls, | |||
121 | return; | 130 | return; |
122 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 131 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
123 | "Received HELLO, starting hostlist service.\n"); | 132 | "Received HELLO, starting hostlist service.\n"); |
124 | GNUNET_assert ( (ok >= 2) && (ok <= 3) ); | ||
125 | ok++; | ||
126 | GNUNET_ARM_start_services (p->cfg, sched, "hostlist", NULL); | 133 | GNUNET_ARM_start_services (p->cfg, sched, "hostlist", NULL); |
127 | } | 134 | } |
128 | 135 | ||
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf index 844e1ded5..6f19661d6 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf +++ b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf | |||
@@ -8,7 +8,7 @@ PORT = 12964 | |||
8 | [transport] | 8 | [transport] |
9 | PORT = 12965 | 9 | PORT = 12965 |
10 | PLUGINS = tcp | 10 | PLUGINS = tcp |
11 | #DEBUG = YES | 11 | DEBUG = YES |
12 | 12 | ||
13 | [arm] | 13 | [arm] |
14 | PORT = 12966 | 14 | PORT = 12966 |
@@ -36,6 +36,7 @@ WEAKRANDOM = YES | |||
36 | HTTPPORT = 12980 | 36 | HTTPPORT = 12980 |
37 | SERVERS = http://localhost:12981/ | 37 | SERVERS = http://localhost:12981/ |
38 | OPTIONS = -b -p | 38 | OPTIONS = -b -p |
39 | DEBUG = YES | ||
39 | #BINARY = /home/grothoff/bin/gnunet-daemon-hostlist | 40 | #BINARY = /home/grothoff/bin/gnunet-daemon-hostlist |
40 | 41 | ||
41 | [topology] | 42 | [topology] |
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf index dd5a599b8..ec34c8a8b 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf +++ b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf | |||
@@ -8,7 +8,7 @@ PORT = 22964 | |||
8 | [transport] | 8 | [transport] |
9 | PORT = 22965 | 9 | PORT = 22965 |
10 | PLUGINS = tcp | 10 | PLUGINS = tcp |
11 | #DEBUG = YES | 11 | DEBUG = YES |
12 | 12 | ||
13 | [arm] | 13 | [arm] |
14 | PORT = 22966 | 14 | PORT = 22966 |
@@ -36,6 +36,7 @@ WEAKRANDOM = YES | |||
36 | HTTPPORT = 12981 | 36 | HTTPPORT = 12981 |
37 | SERVERS = http://localhost:12980/ | 37 | SERVERS = http://localhost:12980/ |
38 | OPTIONS = -b -p | 38 | OPTIONS = -b -p |
39 | DEBUG = YES | ||
39 | #BINARY = /home/grothoff/bin/gnunet-daemon-hostlist | 40 | #BINARY = /home/grothoff/bin/gnunet-daemon-hostlist |
40 | 41 | ||
41 | [topology] | 42 | [topology] |