diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-11 13:56:04 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-11 13:56:04 +0000 |
commit | 49c0f18440004f0d0752fac11644407edcc9e271 (patch) | |
tree | 092bc3ac962e67d6e6a424f941813adba86e6f66 /src | |
parent | 8e027d831f80d890baed5199ff6516e37d4df726 (diff) | |
download | gnunet-49c0f18440004f0d0752fac11644407edcc9e271.tar.gz gnunet-49c0f18440004f0d0752fac11644407edcc9e271.zip |
stuff
Diffstat (limited to 'src')
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist_learning.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index 82e77b15f..4a8cbcf32 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c | |||
@@ -60,7 +60,6 @@ struct PeerContext | |||
60 | struct GNUNET_CONFIGURATION_Handle *cfg; | 60 | struct GNUNET_CONFIGURATION_Handle *cfg; |
61 | struct GNUNET_TRANSPORT_Handle *th; | 61 | struct GNUNET_TRANSPORT_Handle *th; |
62 | struct GNUNET_MessageHeader *hello; | 62 | struct GNUNET_MessageHeader *hello; |
63 | struct GNUNET_ARM_Handle *arm; | ||
64 | struct GNUNET_CORE_Handle *core; | 63 | struct GNUNET_CORE_Handle *core; |
65 | struct GNUNET_STATISTICS_Handle *stats; | 64 | struct GNUNET_STATISTICS_Handle *stats; |
66 | #if START_ARM | 65 | #if START_ARM |
@@ -92,25 +91,6 @@ waitpid_task (void *cls, | |||
92 | } | 91 | } |
93 | 92 | ||
94 | 93 | ||
95 | static void | ||
96 | stop_cb (void *cls, | ||
97 | int success) | ||
98 | { | ||
99 | struct PeerContext *p = cls; | ||
100 | |||
101 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
102 | success | ||
103 | ? "ARM stopped core service\n" | ||
104 | : "ARM failed to stop core service\n"); | ||
105 | GNUNET_ARM_disconnect (p->arm); | ||
106 | p->arm = NULL; | ||
107 | /* make sure this runs after all other tasks are done */ | ||
108 | GNUNET_SCHEDULER_add_delayed (sched, | ||
109 | GNUNET_TIME_UNIT_SECONDS, | ||
110 | &waitpid_task, p); | ||
111 | } | ||
112 | |||
113 | |||
114 | static void shutdown_testcase() | 94 | static void shutdown_testcase() |
115 | { | 95 | { |
116 | if (timeout_task != GNUNET_SCHEDULER_NO_TASK) | 96 | if (timeout_task != GNUNET_SCHEDULER_NO_TASK) |
@@ -149,13 +129,10 @@ static void shutdown_testcase() | |||
149 | } | 129 | } |
150 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 130 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
151 | "Asking ARM to stop core services\n"); | 131 | "Asking ARM to stop core services\n"); |
152 | learn_peer.arm = GNUNET_ARM_connect (learn_peer.cfg, sched, NULL); | 132 | GNUNET_SCHEDULER_add_now (sched, |
153 | GNUNET_ARM_stop_service (learn_peer.arm, "core", GNUNET_TIME_UNIT_SECONDS, | 133 | &waitpid_task, &learn_peer); |
154 | &stop_cb, &learn_peer); | 134 | GNUNET_SCHEDULER_add_now (sched, |
155 | adv_peer.arm = GNUNET_ARM_connect (adv_peer.cfg, sched, NULL); | 135 | &waitpid_task, &adv_peer); |
156 | GNUNET_ARM_stop_service (adv_peer.arm, "core", GNUNET_TIME_UNIT_SECONDS, | ||
157 | &stop_cb, &adv_peer); | ||
158 | |||
159 | GNUNET_SCHEDULER_shutdown (sched); | 136 | GNUNET_SCHEDULER_shutdown (sched); |
160 | } | 137 | } |
161 | 138 | ||
@@ -367,8 +344,6 @@ setup_learn_peer (struct PeerContext *p, const char *cfgname) | |||
367 | } | 344 | } |
368 | if ( NULL != filename) GNUNET_free ( filename ); | 345 | if ( NULL != filename) GNUNET_free ( filename ); |
369 | 346 | ||
370 | GNUNET_ARM_start_services (p->cfg, sched, "core", NULL); | ||
371 | |||
372 | p->core = GNUNET_CORE_connect (sched, p->cfg, | 347 | p->core = GNUNET_CORE_connect (sched, p->cfg, |
373 | GNUNET_TIME_UNIT_FOREVER_REL, | 348 | GNUNET_TIME_UNIT_FOREVER_REL, |
374 | NULL, | 349 | NULL, |
@@ -396,7 +371,6 @@ setup_adv_peer (struct PeerContext *p, const char *cfgname) | |||
396 | "-c", cfgname, NULL); | 371 | "-c", cfgname, NULL); |
397 | #endif | 372 | #endif |
398 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 373 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
399 | GNUNET_ARM_start_services (p->cfg, sched, "core", NULL); | ||
400 | p->stats = GNUNET_STATISTICS_create (sched, "hostlist", p->cfg); | 374 | p->stats = GNUNET_STATISTICS_create (sched, "hostlist", p->cfg); |
401 | GNUNET_assert ( NULL != p->stats ); | 375 | GNUNET_assert ( NULL != p->stats ); |
402 | } | 376 | } |