aboutsummaryrefslogtreecommitdiff
path: root/src/arm/arm_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-06-05 21:33:58 +0000
committerChristian Grothoff <christian@grothoff.org>2013-06-05 21:33:58 +0000
commita998e0abbd220035bdb333388da229852980e2cc (patch)
treeaddf062abb3cc68ab1103a415fbdec315dd54a63 /src/arm/arm_api.c
parent4ce2d673d41ad8a8b9e5389b5b97ecb5e77f190d (diff)
downloadgnunet-a998e0abbd220035bdb333388da229852980e2cc.tar.gz
gnunet-a998e0abbd220035bdb333388da229852980e2cc.zip
-cleaning up client api to test for service availability
Diffstat (limited to 'src/arm/arm_api.c')
-rw-r--r--src/arm/arm_api.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index 4ef6b3c27..34f7a6704 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -743,10 +743,11 @@ control_message_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *t
743 * it is not, start the ARM process. 743 * it is not, start the ARM process.
744 * 744 *
745 * @param cls the context for the request that we will report on (struct ARMControlMessage *) 745 * @param cls the context for the request that we will report on (struct ARMControlMessage *)
746 * @param tc why were we called (reason says if ARM is running) 746 * @param result GNUNET_YES if ARM is running
747 */ 747 */
748static void 748static void
749arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 749arm_service_report (void *cls,
750 int result)
750{ 751{
751 struct ARMControlMessage *cm = cls; 752 struct ARMControlMessage *cm = cls;
752 struct GNUNET_ARM_Handle *h; 753 struct GNUNET_ARM_Handle *h;
@@ -759,12 +760,11 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
759 char *lopostfix; 760 char *lopostfix;
760 761
761 test_is_active = cm->h->service_test_is_active; 762 test_is_active = cm->h->service_test_is_active;
762
763 /* FIXME: shouldn't we check for GNUNET_SCHEDULER_REASON_SHUTDOWN ? */
764 if ((GNUNET_YES == test_is_active) && 763 if ((GNUNET_YES == test_is_active) &&
765 (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))) 764 (GNUNET_YES == result))
766 { 765 {
767 LOG (GNUNET_ERROR_TYPE_DEBUG, "Looks like `%s' is already running.\n", 766 LOG (GNUNET_ERROR_TYPE_DEBUG,
767 "Looks like `%s' is already running.\n",
768 "gnunet-service-arm"); 768 "gnunet-service-arm");
769 /* arm is running! */ 769 /* arm is running! */
770 if (cm->result_cont) 770 if (cm->result_cont)
@@ -780,7 +780,7 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
780 GNUNET_CONFIGURATION_destroy (cm->h->cfg); 780 GNUNET_CONFIGURATION_destroy (cm->h->cfg);
781 GNUNET_free (cm->h); 781 GNUNET_free (cm->h);
782 } 782 }
783 if ((0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) || 783 if ((GNUNET_YES == result) ||
784 (GNUNET_NO == test_is_active)) 784 (GNUNET_NO == test_is_active))
785 { 785 {
786 GNUNET_free (cm); 786 GNUNET_free (cm);