aboutsummaryrefslogtreecommitdiff
path: root/src/hostlist
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-11 13:43:44 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-11 13:43:44 +0000
commitbed8e0d389aacc368b3dd9704d355b284236fea3 (patch)
tree8fb1826c6f7b09fe09f4a0c456ea58699746db3b /src/hostlist
parentbd3ab1e9cafa730d9eaf2d1113467ea89de1916b (diff)
downloadgnunet-bed8e0d389aacc368b3dd9704d355b284236fea3.tar.gz
gnunet-bed8e0d389aacc368b3dd9704d355b284236fea3.zip
fixes
Diffstat (limited to 'src/hostlist')
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist.c25
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_peer1.conf10
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_peer2.conf8
3 files changed, 17 insertions, 26 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c
index a8f092121..3e179e5d9 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist.c
@@ -48,7 +48,6 @@ struct PeerContext
48 struct GNUNET_CONFIGURATION_Handle *cfg; 48 struct GNUNET_CONFIGURATION_Handle *cfg;
49 struct GNUNET_TRANSPORT_Handle *th; 49 struct GNUNET_TRANSPORT_Handle *th;
50 struct GNUNET_MessageHeader *hello; 50 struct GNUNET_MessageHeader *hello;
51 struct GNUNET_ARM_Handle *arm;
52#if START_ARM 51#if START_ARM
53 pid_t arm_pid; 52 pid_t arm_pid;
54#endif 53#endif
@@ -145,7 +144,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
145 "-c", cfgname, NULL); 144 "-c", cfgname, NULL);
146#endif 145#endif
147 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 146 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
148 GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
149 p->th = GNUNET_TRANSPORT_connect (sched, p->cfg, p, NULL, 147 p->th = GNUNET_TRANSPORT_connect (sched, p->cfg, p, NULL,
150 &notify_connect, NULL); 148 &notify_connect, NULL);
151 GNUNET_assert (p->th != NULL); 149 GNUNET_assert (p->th != NULL);
@@ -174,35 +172,16 @@ waitpid_task (void *cls,
174 172
175 173
176static void 174static void
177stop_cb (void *cls, 175stop_arm (struct PeerContext *p)
178 int success)
179{ 176{
180 struct PeerContext *p = cls;
181
182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 177 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
183 success 178 "Asking ARM to stop core service\n");
184 ? "ARM stopped core service\n"
185 : "ARM failed to stop core service\n");
186 GNUNET_ARM_disconnect (p->arm);
187 p->arm = NULL;
188 /* make sure this runs after all other tasks are done */
189 GNUNET_SCHEDULER_add_delayed (sched, 179 GNUNET_SCHEDULER_add_delayed (sched,
190 GNUNET_TIME_UNIT_SECONDS, 180 GNUNET_TIME_UNIT_SECONDS,
191 &waitpid_task, p); 181 &waitpid_task, p);
192} 182}
193 183
194 184
195static void
196stop_arm (struct PeerContext *p)
197{
198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
199 "Asking ARM to stop core service\n");
200 p->arm = GNUNET_ARM_connect (p->cfg, sched, NULL);
201 GNUNET_ARM_stop_service (p->arm, "core", GNUNET_TIME_UNIT_SECONDS,
202 &stop_cb, p);
203}
204
205
206/** 185/**
207 * Try again to connect to transport service. 186 * Try again to connect to transport service.
208 */ 187 */
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
index 31aac4bdf..2a46763bf 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
+++ b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
@@ -13,7 +13,7 @@ DEBUG = NO
13 13
14[arm] 14[arm]
15PORT = 12966 15PORT = 12966
16DEFAULTSERVICES = resolver transport core statistics topology 16DEFAULTSERVICES = hostlist topology
17#GLOBAL_PREFIX = xterm -e gdb -x cmd --args 17#GLOBAL_PREFIX = xterm -e gdb -x cmd --args
18 18
19[statistics] 19[statistics]
@@ -47,4 +47,10 @@ DEBUG = NO
47[topology] 47[topology]
48#DEBUG = YES 48#DEBUG = YES
49#PREFIX = valgrind --tool=memcheck 49#PREFIX = valgrind --tool=memcheck
50DEBUG = NO \ No newline at end of file 50DEBUG = NO
51
52[fs]
53AUTOSTART = NO
54
55[datastore]
56AUTOSTART = NO[fs]
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
index f23488dfd..c256c2829 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
+++ b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
@@ -13,7 +13,7 @@ DEBUG = NO
13 13
14[arm] 14[arm]
15PORT = 22966 15PORT = 22966
16DEFAULTSERVICES = resolver transport core statistics topology 16DEFAULTSERVICES = hostlist topology
17#GLOBAL_PREFIX = xterm -e gdb -x cmd --args 17#GLOBAL_PREFIX = xterm -e gdb -x cmd --args
18DEBUG = NO 18DEBUG = NO
19 19
@@ -47,3 +47,9 @@ HOSTLISTFILE = hostlists_peer2.file
47#DEBUG = YES 47#DEBUG = YES
48#PREFIX = valgrind --tool=memcheck 48#PREFIX = valgrind --tool=memcheck
49DEBUG = NO 49DEBUG = NO
50
51[fs]
52AUTOSTART = NO
53
54[datastore]
55AUTOSTART = NO \ No newline at end of file