aboutsummaryrefslogtreecommitdiff
path: root/src/arm/gnunet-arm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arm/gnunet-arm.c')
-rw-r--r--src/arm/gnunet-arm.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index c19020ccb..ba74e8223 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -116,11 +116,6 @@ static int ret;
116static struct GNUNET_ARM_Handle *h; 116static struct GNUNET_ARM_Handle *h;
117 117
118/** 118/**
119 * Our scheduler.
120 */
121static struct GNUNET_SCHEDULER_Handle *sched;
122
123/**
124 * Our configuration. 119 * Our configuration.
125 */ 120 */
126const struct GNUNET_CONFIGURATION_Handle *cfg; 121const struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -184,8 +179,7 @@ confirm_cb (void *cls, int success)
184 break; 179 break;
185 } 180 }
186 181
187 GNUNET_SCHEDULER_add_continuation (sched, 182 GNUNET_SCHEDULER_add_continuation (&cps_loop,
188 &cps_loop,
189 NULL, 183 NULL,
190 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 184 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
191} 185}
@@ -213,8 +207,7 @@ confirm_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
213 if (quiet != GNUNET_YES) 207 if (quiet != GNUNET_YES)
214 fprintf(stdout, _("Service `%s' is not running.\n"), service); 208 fprintf(stdout, _("Service `%s' is not running.\n"), service);
215 } 209 }
216 GNUNET_SCHEDULER_add_continuation (sched, 210 GNUNET_SCHEDULER_add_continuation (&cps_loop,
217 &cps_loop,
218 NULL, 211 NULL,
219 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 212 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
220} 213}
@@ -224,19 +217,16 @@ confirm_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
224 * Main function that will be run by the scheduler. 217 * Main function that will be run by the scheduler.
225 * 218 *
226 * @param cls closure 219 * @param cls closure
227 * @param s the scheduler to use
228 * @param args remaining command-line arguments 220 * @param args remaining command-line arguments
229 * @param cfgfile name of the configuration file used (for saving, can be NULL!) 221 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
230 * @param c configuration 222 * @param c configuration
231 */ 223 */
232static void 224static void
233run (void *cls, 225run (void *cls,
234 struct GNUNET_SCHEDULER_Handle *s,
235 char *const *args, 226 char *const *args,
236 const char *cfgfile, 227 const char *cfgfile,
237 const struct GNUNET_CONFIGURATION_Handle *c) 228 const struct GNUNET_CONFIGURATION_Handle *c)
238{ 229{
239 sched = s;
240 cfg = c; 230 cfg = c;
241 config_file = cfgfile; 231 config_file = cfgfile;
242 if (GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "SERVICEHOME", &dir) != GNUNET_OK) 232 if (GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "SERVICEHOME", &dir) != GNUNET_OK)
@@ -247,7 +237,7 @@ run (void *cls,
247 "PATHS"); 237 "PATHS");
248 return; 238 return;
249 } 239 }
250 h = GNUNET_ARM_connect (cfg, sched, NULL); 240 h = GNUNET_ARM_connect (cfg, NULL);
251 if (h == NULL) 241 if (h == NULL)
252 { 242 {
253 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 243 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -255,8 +245,7 @@ run (void *cls,
255 ret = 1; 245 ret = 1;
256 return; 246 return;
257 } 247 }
258 GNUNET_SCHEDULER_add_continuation (sched, 248 GNUNET_SCHEDULER_add_continuation (&cps_loop,
259 &cps_loop,
260 NULL, 249 NULL,
261 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 250 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
262} 251}
@@ -330,7 +319,7 @@ cps_loop (void *cls,
330 case 4: 319 case 4:
331 if (test != NULL) 320 if (test != NULL)
332 { 321 {
333 GNUNET_CLIENT_service_test (sched, test, cfg, TEST_TIMEOUT, &confirm_task, test); 322 GNUNET_CLIENT_service_test (test, cfg, TEST_TIMEOUT, &confirm_task, test);
334 return; 323 return;
335 } 324 }
336 break; 325 break;
@@ -342,7 +331,7 @@ cps_loop (void *cls,
342 end = 0; 331 end = 0;
343 start = 1; 332 start = 1;
344 restart = 0; 333 restart = 0;
345 h = GNUNET_ARM_connect (cfg, sched, NULL); 334 h = GNUNET_ARM_connect (cfg, NULL);
346 if (h == NULL) 335 if (h == NULL)
347 { 336 {
348 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 337 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -350,7 +339,7 @@ cps_loop (void *cls,
350 ret = 1; 339 ret = 1;
351 return; 340 return;
352 } 341 }
353 GNUNET_SCHEDULER_add_now(sched, &cps_loop, NULL); 342 GNUNET_SCHEDULER_add_now(&cps_loop, NULL);
354 return; 343 return;
355 } 344 }
356 /* Fall through */ 345 /* Fall through */