diff options
Diffstat (limited to 'src/arm/arm_api.c')
-rw-r--r-- | src/arm/arm_api.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index f2d2b293a..bc80b779f 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c | |||
@@ -163,12 +163,22 @@ arm_service_report (void *cls, | |||
163 | 163 | ||
164 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) | 164 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) |
165 | { | 165 | { |
166 | #if DEBUG_ARM | ||
167 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
168 | "Looks like `%s' is already running.\n", | ||
169 | "gnunet-service-arm"); | ||
170 | #endif | ||
166 | /* arm is running! */ | 171 | /* arm is running! */ |
167 | if (pos->callback != NULL) | 172 | if (pos->callback != NULL) |
168 | pos->callback (pos->cls, GNUNET_YES); | 173 | pos->callback (pos->cls, GNUNET_YES); |
169 | GNUNET_free (pos); | 174 | GNUNET_free (pos); |
170 | return; | 175 | return; |
171 | } | 176 | } |
177 | #if DEBUG_ARM | ||
178 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
179 | "Looks like `%s' is not running, will start it.\n", | ||
180 | "gnunet-service-arm"); | ||
181 | #endif | ||
172 | /* FIXME: should we check that HOSTNAME for 'arm' is localhost? */ | 182 | /* FIXME: should we check that HOSTNAME for 'arm' is localhost? */ |
173 | /* start service */ | 183 | /* start service */ |
174 | if (GNUNET_OK != | 184 | if (GNUNET_OK != |
@@ -236,7 +246,10 @@ handle_response (void *cls, const struct GNUNET_MessageHeader *msg) | |||
236 | if (msg == NULL) | 246 | if (msg == NULL) |
237 | { | 247 | { |
238 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 248 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
239 | _("Error receiving response from ARM service\n")); | 249 | _("Error receiving response to `%s' request from ARM service\n"), |
250 | (sc->type == GNUNET_MESSAGE_TYPE_ARM_START) | ||
251 | ? "START" | ||
252 | : "STOP"); | ||
240 | GNUNET_CLIENT_disconnect (sc->h->client); | 253 | GNUNET_CLIENT_disconnect (sc->h->client); |
241 | sc->h->client = GNUNET_CLIENT_connect (sc->h->sched, | 254 | sc->h->client = GNUNET_CLIENT_connect (sc->h->sched, |
242 | "arm", | 255 | "arm", |
@@ -304,7 +317,10 @@ change_service (struct GNUNET_ARM_Handle *h, | |||
304 | } | 317 | } |
305 | #if DEBUG_ARM | 318 | #if DEBUG_ARM |
306 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 319 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
307 | _("ARM requests starting of service `%s'.\n"), service_name); | 320 | (type == GNUNET_MESSAGE_TYPE_ARM_START) |
321 | ? _("Requesting start of service `%s'.\n") | ||
322 | : _("Requesting termination of service `%s'.\n"), | ||
323 | service_name); | ||
308 | #endif | 324 | #endif |
309 | sctx = GNUNET_malloc (sizeof (struct RequestContext) + slen); | 325 | sctx = GNUNET_malloc (sizeof (struct RequestContext) + slen); |
310 | sctx->h = h; | 326 | sctx->h = h; |
@@ -355,7 +371,7 @@ GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, | |||
355 | 371 | ||
356 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 372 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
357 | _("Starting service `%s'\n"), service_name); | 373 | _("Starting service `%s'\n"), service_name); |
358 | if (0 == strcmp ("arm", service_name)) | 374 | if (0 == strcasecmp ("arm", service_name)) |
359 | { | 375 | { |
360 | sctx = GNUNET_malloc (sizeof (struct RequestContext)); | 376 | sctx = GNUNET_malloc (sizeof (struct RequestContext)); |
361 | sctx->h = h; | 377 | sctx->h = h; |
@@ -388,7 +404,7 @@ GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, | |||
388 | { | 404 | { |
389 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 405 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
390 | _("Stopping service `%s'\n"), service_name); | 406 | _("Stopping service `%s'\n"), service_name); |
391 | if (0 == strcmp ("arm", service_name)) | 407 | if (0 == strcasecmp ("arm", service_name)) |
392 | { | 408 | { |
393 | GNUNET_CLIENT_service_shutdown (h->client); | 409 | GNUNET_CLIENT_service_shutdown (h->client); |
394 | h->client = NULL; | 410 | h->client = NULL; |