aboutsummaryrefslogtreecommitdiff
path: root/src/arm
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-04-24 06:42:44 +0000
committerChristian Grothoff <christian@grothoff.org>2015-04-24 06:42:44 +0000
commit2460a6e001b8bb0f76c5d4292b2c7c6a3d2719b9 (patch)
treee6ec566bf85c8a1a38c177d2e6e2477046335031 /src/arm
parent235be35cc7938c229a2a787cf9dbdeae63232da3 (diff)
downloadgnunet-2460a6e001b8bb0f76c5d4292b2c7c6a3d2719b9.tar.gz
gnunet-2460a6e001b8bb0f76c5d4292b2c7c6a3d2719b9.zip
-indentation and doxygen fixes
Diffstat (limited to 'src/arm')
-rw-r--r--src/arm/arm_api.c75
-rw-r--r--src/arm/test_arm_api.c5
2 files changed, 52 insertions, 28 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index 99d1d110b..f48bcc2d3 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -91,7 +91,7 @@ struct GNUNET_ARM_Handle
91 /** 91 /**
92 * ID of the reconnect task (if any). 92 * ID of the reconnect task (if any).
93 */ 93 */
94 struct GNUNET_SCHEDULER_Task * reconnect_task; 94 struct GNUNET_SCHEDULER_Task *reconnect_task;
95 95
96 /** 96 /**
97 * Current delay we use for re-trying to connect to core. 97 * Current delay we use for re-trying to connect to core.
@@ -109,7 +109,7 @@ struct GNUNET_ARM_Handle
109 unsigned char currently_down; 109 unsigned char currently_down;
110 110
111 /** 111 /**
112 * GNUNET_YES if we're running a service test. 112 * #GNUNET_YES if we're running a service test.
113 */ 113 */
114 unsigned char service_test_is_active; 114 unsigned char service_test_is_active;
115}; 115};
@@ -154,7 +154,7 @@ struct ARMControlMessage
154 GNUNET_ARM_ServiceListCallback list_cont; 154 GNUNET_ARM_ServiceListCallback list_cont;
155 155
156 /** 156 /**
157 * Closure for 'result_cont' or 'list_cont'. 157 * Closure for @e result_cont' or @e list_cont'.
158 */ 158 */
159 void *cont_cls; 159 void *cont_cls;
160 160
@@ -184,7 +184,7 @@ struct ARMControlMessage
184 * Connect to arm. 184 * Connect to arm.
185 * 185 *
186 * @param h arm handle 186 * @param h arm handle
187 * @return GNUNET_OK on success, GNUNET_SYSERR on failure 187 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
188 */ 188 */
189static int 189static int
190reconnect_arm (struct GNUNET_ARM_Handle *h); 190reconnect_arm (struct GNUNET_ARM_Handle *h);
@@ -748,7 +748,7 @@ control_message_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *t
748 * it is not, start the ARM process. 748 * it is not, start the ARM process.
749 * 749 *
750 * @param cls the context for the request that we will report on (struct ARMControlMessage *) 750 * @param cls the context for the request that we will report on (struct ARMControlMessage *)
751 * @param result GNUNET_YES if ARM is running 751 * @param result #GNUNET_YES if ARM is running
752 */ 752 */
753static void 753static void
754arm_service_report (void *cls, 754arm_service_report (void *cls,
@@ -802,10 +802,15 @@ arm_service_report (void *cls,
802 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string ( 802 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (
803 cm->h->cfg, "arm", "OPTIONS", &lopostfix)) 803 cm->h->cfg, "arm", "OPTIONS", &lopostfix))
804 lopostfix = GNUNET_strdup (""); 804 lopostfix = GNUNET_strdup ("");
805 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string ( 805 if (GNUNET_OK !=
806 cm->h->cfg, "arm", "BINARY", &cbinary)) 806 GNUNET_CONFIGURATION_get_value_string (cm->h->cfg,
807 "arm",
808 "BINARY",
809 &cbinary))
807 { 810 {
808 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, "arm", "BINARY"); 811 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
812 "arm",
813 "BINARY");
809 if (cm->result_cont) 814 if (cm->result_cont)
810 cm->result_cont (cm->cont_cls, 815 cm->result_cont (cm->cont_cls,
811 GNUNET_ARM_REQUEST_SENT_OK, "arm", 816 GNUNET_ARM_REQUEST_SENT_OK, "arm",
@@ -815,20 +820,28 @@ arm_service_report (void *cls,
815 GNUNET_free (lopostfix); 820 GNUNET_free (lopostfix);
816 return; 821 return;
817 } 822 }
818 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename ( 823 if (GNUNET_OK !=
819 cm->h->cfg, "arm", "CONFIG", &config)) 824 GNUNET_CONFIGURATION_get_value_filename (cm->h->cfg,
825 "arm", "CONFIG",
826 &config))
820 config = NULL; 827 config = NULL;
821 binary = GNUNET_OS_get_libexec_binary_path (cbinary); 828 binary = GNUNET_OS_get_libexec_binary_path (cbinary);
822 GNUNET_asprintf (&quotedbinary, 829 GNUNET_asprintf (&quotedbinary,
823 "\"%s\"", 830 "\"%s\"",
824 binary); 831 binary);
825 GNUNET_free (cbinary); 832 GNUNET_free (cbinary);
826 if ((GNUNET_YES == GNUNET_CONFIGURATION_have_value ( 833 if ( (GNUNET_YES ==
827 cm->h->cfg, "TESTING", "WEAKRANDOM")) && 834 GNUNET_CONFIGURATION_have_value (cm->h->cfg,
828 (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno ( 835 "TESTING",
829 cm->h->cfg, "TESTING", "WEAKRANDOM")) && 836 "WEAKRANDOM")) &&
830 (GNUNET_NO == GNUNET_CONFIGURATION_have_value ( 837 (GNUNET_YES ==
831 cm->h->cfg, "TESTING", "HOSTFILE"))) 838 GNUNET_CONFIGURATION_get_value_yesno (cm->h->cfg,
839 "TESTING",
840 "WEAKRANDOM")) &&
841 (GNUNET_NO ==
842 GNUNET_CONFIGURATION_have_value (cm->h->cfg,
843 "TESTING",
844 "HOSTFILE")))
832 { 845 {
833 /* Means we are ONLY running locally */ 846 /* Means we are ONLY running locally */
834 /* we're clearly running a test, don't daemonize */ 847 /* we're clearly running a test, don't daemonize */
@@ -839,7 +852,7 @@ arm_service_report (void *cls,
839 lopostfix, NULL); 852 lopostfix, NULL);
840 else 853 else
841 proc = GNUNET_OS_start_process_s (GNUNET_NO, cm->std_inheritance, 854 proc = GNUNET_OS_start_process_s (GNUNET_NO, cm->std_inheritance,
842 NULL, loprefix, quotedbinary, "-c", config, 855 NULL, loprefix, quotedbinary, "-c", config,
843 /* no daemonization! */ 856 /* no daemonization! */
844 lopostfix, NULL); 857 lopostfix, NULL);
845 } 858 }
@@ -863,14 +876,16 @@ arm_service_report (void *cls,
863 if (NULL == proc) 876 if (NULL == proc)
864 { 877 {
865 if (cm->result_cont) 878 if (cm->result_cont)
866 cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, "arm", 879 cm->result_cont (cm->cont_cls,
867 GNUNET_ARM_RESULT_START_FAILED); 880 GNUNET_ARM_REQUEST_SENT_OK, "arm",
881 GNUNET_ARM_RESULT_START_FAILED);
868 GNUNET_free (cm); 882 GNUNET_free (cm);
869 return; 883 return;
870 } 884 }
871 if (cm->result_cont) 885 if (cm->result_cont)
872 cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, "arm", 886 cm->result_cont (cm->cont_cls,
873 GNUNET_ARM_RESULT_STARTING); 887 GNUNET_ARM_REQUEST_SENT_OK, "arm",
888 GNUNET_ARM_RESULT_STARTING);
874 GNUNET_OS_process_destroy (proc); 889 GNUNET_OS_process_destroy (proc);
875 h = cm->h; 890 h = cm->h;
876 GNUNET_free (cm); 891 GNUNET_free (cm);
@@ -968,9 +983,13 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
968 */ 983 */
969 if (GNUNET_NO == h->currently_down) 984 if (GNUNET_NO == h->currently_down)
970 { 985 {
971 LOG (GNUNET_ERROR_TYPE_DEBUG, "ARM is already running\n"); 986 LOG (GNUNET_ERROR_TYPE_DEBUG,
987 "ARM is already running\n");
972 if (NULL != cont) 988 if (NULL != cont)
973 cont (cont_cls, GNUNET_ARM_REQUEST_SENT_OK, "arm", GNUNET_ARM_RESULT_IS_STARTED_ALREADY); 989 cont (cont_cls,
990 GNUNET_ARM_REQUEST_SENT_OK,
991 "arm",
992 GNUNET_ARM_RESULT_IS_STARTED_ALREADY);
974 } 993 }
975 else if (GNUNET_NO == h->service_test_is_active) 994 else if (GNUNET_NO == h->service_test_is_active)
976 { 995 {
@@ -1002,7 +1021,10 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
1002 cm->std_inheritance = std_inheritance; 1021 cm->std_inheritance = std_inheritance;
1003 memcpy (&cm[1], service_name, slen); 1022 memcpy (&cm[1], service_name, slen);
1004 h->service_test_is_active = GNUNET_YES; 1023 h->service_test_is_active = GNUNET_YES;
1005 GNUNET_CLIENT_service_test ("arm", h->cfg, timeout, &arm_service_report, 1024 GNUNET_CLIENT_service_test ("arm",
1025 h->cfg,
1026 timeout,
1027 &arm_service_report,
1006 cm); 1028 cm);
1007 } 1029 }
1008 else 1030 else
@@ -1010,7 +1032,8 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
1010 /* Service test is already running - tell user to chill out and try 1032 /* Service test is already running - tell user to chill out and try
1011 * again later. 1033 * again later.
1012 */ 1034 */
1013 LOG (GNUNET_ERROR_TYPE_DEBUG, "Service test is already in progress, we're busy\n"); 1035 LOG (GNUNET_ERROR_TYPE_DEBUG,
1036 "Service test is already in progress, we're busy\n");
1014 if (NULL != cont) 1037 if (NULL != cont)
1015 cont (cont_cls, GNUNET_ARM_REQUEST_BUSY, NULL, 0); 1038 cont (cont_cls, GNUNET_ARM_REQUEST_BUSY, NULL, 0);
1016 } 1039 }
@@ -1026,7 +1049,7 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
1026 * Stopping arm itself will not invalidate its handle, and 1049 * Stopping arm itself will not invalidate its handle, and
1027 * ARM API will try to restore connection to the ARM service, 1050 * ARM API will try to restore connection to the ARM service,
1028 * even if ARM connection was lost because you asked for ARM to be stopped. 1051 * even if ARM connection was lost because you asked for ARM to be stopped.
1029 * Call GNUNET_ARM_disconnect_and_free () to free the handle and prevent 1052 * Call #GNUNET_ARM_disconnect_and_free() to free the handle and prevent
1030 * further connection attempts. 1053 * further connection attempts.
1031 * 1054 *
1032 * @param h handle to ARM 1055 * @param h handle to ARM
diff --git a/src/arm/test_arm_api.c b/src/arm/test_arm_api.c
index e0bd959ba..67bf45871 100644
--- a/src/arm/test_arm_api.c
+++ b/src/arm/test_arm_api.c
@@ -190,8 +190,9 @@ task (void *cls, char *const *args, const char *cfgfile,
190 if (NULL != cfgfile) 190 if (NULL != cfgfile)
191 { 191 {
192 if (GNUNET_OK != 192 if (GNUNET_OK !=
193 GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG", 193 GNUNET_CONFIGURATION_get_value_filename (cfg,
194 &armconfig)) 194 "arm", "CONFIG",
195 &armconfig))
195 { 196 {
196 GNUNET_CONFIGURATION_set_value_string ((struct GNUNET_CONFIGURATION_Handle 197 GNUNET_CONFIGURATION_set_value_string ((struct GNUNET_CONFIGURATION_Handle
197 *) cfg, "arm", "CONFIG", 198 *) cfg, "arm", "CONFIG",