diff options
Diffstat (limited to 'src/hostlist/test_gnunet_daemon_hostlist.c')
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist.c | 25 |
1 files changed, 2 insertions, 23 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 | ¬ify_connect, NULL); | 148 | ¬ify_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 | ||
176 | static void | 174 | static void |
177 | stop_cb (void *cls, | 175 | stop_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 | ||
195 | static void | ||
196 | stop_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 | */ |