diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
commit | 61c39c60565b386e0e12ea669556b030e8cd7180 (patch) | |
tree | 59109aeab8297bdc996faca8c4e38ec7426c36cf /src/arm | |
parent | 780eb09dd8040ecf8649d40ddf8314464e0fc48e (diff) | |
download | gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.tar.gz gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.zip |
-remove trailing whitespace
Diffstat (limited to 'src/arm')
-rw-r--r-- | src/arm/arm.h | 14 | ||||
-rw-r--r-- | src/arm/arm_api.c | 60 | ||||
-rw-r--r-- | src/arm/arm_monitor_api.c | 2 | ||||
-rw-r--r-- | src/arm/do_start_process.c | 2 | ||||
-rw-r--r-- | src/arm/gnunet-arm.c | 52 | ||||
-rw-r--r-- | src/arm/gnunet-service-arm.c | 54 | ||||
-rw-r--r-- | src/arm/test_arm_api.c | 24 | ||||
-rw-r--r-- | src/arm/test_exponential_backoff.c | 10 | ||||
-rw-r--r-- | src/arm/test_gnunet_service_arm.c | 20 |
9 files changed, 119 insertions, 119 deletions
diff --git a/src/arm/arm.h b/src/arm/arm.h index aad16fd71..7010a0842 100644 --- a/src/arm/arm.h +++ b/src/arm/arm.h | |||
@@ -42,10 +42,10 @@ struct GNUNET_ARM_StatusMessage | |||
42 | { | 42 | { |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * Reply to client, of type is GNUNET_MESSAGE_TYPE_ARM_STATUS. | 45 | * Reply to client, of type is GNUNET_MESSAGE_TYPE_ARM_STATUS. |
46 | */ | 46 | */ |
47 | struct GNUNET_MessageHeader header; | 47 | struct GNUNET_MessageHeader header; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Status from the 'enum GNUNET_ARM_ServiceStatus' | 50 | * Status from the 'enum GNUNET_ARM_ServiceStatus' |
51 | */ | 51 | */ |
@@ -58,12 +58,12 @@ struct GNUNET_ARM_Message | |||
58 | { | 58 | { |
59 | /** | 59 | /** |
60 | * Reply to client, type is GNUNET_MESSAGE_TYPE_ARM_RESULT or | 60 | * Reply to client, type is GNUNET_MESSAGE_TYPE_ARM_RESULT or |
61 | * GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT. | 61 | * GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT. |
62 | * OR | 62 | * OR |
63 | * Request from client, type is GNUNET_MESSAGE_TYPE_ARM_REQUEST | 63 | * Request from client, type is GNUNET_MESSAGE_TYPE_ARM_REQUEST |
64 | */ | 64 | */ |
65 | struct GNUNET_MessageHeader header; | 65 | struct GNUNET_MessageHeader header; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * ID of a request that is being replied to. | 68 | * ID of a request that is being replied to. |
69 | * OR | 69 | * OR |
@@ -85,7 +85,7 @@ struct GNUNET_ARM_ResultMessage | |||
85 | * Reply to client, of type is GNUNET_MESSAGE_TYPE_ARM_RESULT, with an ID. | 85 | * Reply to client, of type is GNUNET_MESSAGE_TYPE_ARM_RESULT, with an ID. |
86 | */ | 86 | */ |
87 | struct GNUNET_ARM_Message arm_msg; | 87 | struct GNUNET_ARM_Message arm_msg; |
88 | 88 | ||
89 | /** | 89 | /** |
90 | * Result from the 'enum GNUNET_ARM_Result' | 90 | * Result from the 'enum GNUNET_ARM_Result' |
91 | */ | 91 | */ |
@@ -93,8 +93,8 @@ struct GNUNET_ARM_ResultMessage | |||
93 | }; | 93 | }; |
94 | 94 | ||
95 | /** | 95 | /** |
96 | * Reply from ARM to client for the | 96 | * Reply from ARM to client for the |
97 | * GNUNET_MESSAGE_TYPE_ARM_LIST request followed by count | 97 | * GNUNET_MESSAGE_TYPE_ARM_LIST request followed by count |
98 | * '\0' terminated strings. header->size contains the | 98 | * '\0' terminated strings. header->size contains the |
99 | * total size (including all strings). | 99 | * total size (including all strings). |
100 | */ | 100 | */ |
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index f844551e4..6dfe65702 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c | |||
@@ -243,7 +243,7 @@ reconnect_arm_later (struct GNUNET_ARM_Handle *h) | |||
243 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); | 243 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); |
244 | h->reconnect_task = | 244 | h->reconnect_task = |
245 | GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_task, h); | 245 | GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_task, h); |
246 | /* Don't clear pending messages on disconnection, deliver them later | 246 | /* Don't clear pending messages on disconnection, deliver them later |
247 | clear_pending_messages (h, GNUNET_ARM_REQUEST_DISCONNECTED); | 247 | clear_pending_messages (h, GNUNET_ARM_REQUEST_DISCONNECTED); |
248 | GNUNET_assert (NULL == h->control_pending_head); | 248 | GNUNET_assert (NULL == h->control_pending_head); |
249 | */ | 249 | */ |
@@ -285,7 +285,7 @@ arm_termination_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
285 | 285 | ||
286 | if (NULL != msg) | 286 | if (NULL != msg) |
287 | { | 287 | { |
288 | GNUNET_break (0); | 288 | GNUNET_break (0); |
289 | GNUNET_CLIENT_receive (h->client, &arm_termination_handler, h, | 289 | GNUNET_CLIENT_receive (h->client, &arm_termination_handler, h, |
290 | GNUNET_TIME_UNIT_FOREVER_REL); | 290 | GNUNET_TIME_UNIT_FOREVER_REL); |
291 | return; | 291 | return; |
@@ -296,10 +296,10 @@ arm_termination_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
296 | GNUNET_CLIENT_disconnect (h->client); | 296 | GNUNET_CLIENT_disconnect (h->client); |
297 | h->client = NULL; | 297 | h->client = NULL; |
298 | if (NULL != cm->result_cont) | 298 | if (NULL != cm->result_cont) |
299 | cm->result_cont (cm->cont_cls, | 299 | cm->result_cont (cm->cont_cls, |
300 | GNUNET_ARM_REQUEST_SENT_OK, | 300 | GNUNET_ARM_REQUEST_SENT_OK, |
301 | (const char *) &cm->msg[1], | 301 | (const char *) &cm->msg[1], |
302 | GNUNET_ARM_RESULT_STOPPED); | 302 | GNUNET_ARM_RESULT_STOPPED); |
303 | GNUNET_free (cm->msg); | 303 | GNUNET_free (cm->msg); |
304 | GNUNET_free (cm); | 304 | GNUNET_free (cm); |
305 | } | 305 | } |
@@ -354,7 +354,7 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
354 | { | 354 | { |
355 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Message with unknown id %llu\n", id); | 355 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Message with unknown id %llu\n", id); |
356 | return; | 356 | return; |
357 | } | 357 | } |
358 | fail = GNUNET_NO; | 358 | fail = GNUNET_NO; |
359 | switch (ntohs (msg->type)) | 359 | switch (ntohs (msg->type)) |
360 | { | 360 | { |
@@ -377,7 +377,7 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
377 | rcount = ntohs (lres->count); | 377 | rcount = ntohs (lres->count); |
378 | { | 378 | { |
379 | unsigned int i; | 379 | unsigned int i; |
380 | 380 | ||
381 | list = GNUNET_malloc (sizeof (const char *) * rcount); | 381 | list = GNUNET_malloc (sizeof (const char *) * rcount); |
382 | pos = (const char *)&lres[1]; | 382 | pos = (const char *)&lres[1]; |
383 | for (i = 0; i < rcount; i++) | 383 | for (i = 0; i < rcount; i++) |
@@ -429,9 +429,9 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
429 | if (NULL != h->thm) | 429 | if (NULL != h->thm) |
430 | { | 430 | { |
431 | GNUNET_break (0); | 431 | GNUNET_break (0); |
432 | cm->result_cont (h->thm->cont_cls, | 432 | cm->result_cont (h->thm->cont_cls, |
433 | GNUNET_ARM_REQUEST_SENT_OK, | 433 | GNUNET_ARM_REQUEST_SENT_OK, |
434 | (const char *) &h->thm->msg[1], | 434 | (const char *) &h->thm->msg[1], |
435 | GNUNET_ARM_RESULT_IS_NOT_KNOWN); | 435 | GNUNET_ARM_RESULT_IS_NOT_KNOWN); |
436 | GNUNET_free (h->thm->msg); | 436 | GNUNET_free (h->thm->msg); |
437 | GNUNET_free (h->thm); | 437 | GNUNET_free (h->thm); |
@@ -440,12 +440,12 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
440 | GNUNET_CLIENT_receive (h->client, &arm_termination_handler, h, | 440 | GNUNET_CLIENT_receive (h->client, &arm_termination_handler, h, |
441 | GNUNET_TIME_UNIT_FOREVER_REL); | 441 | GNUNET_TIME_UNIT_FOREVER_REL); |
442 | return; | 442 | return; |
443 | } | 443 | } |
444 | GNUNET_CLIENT_receive (h->client, &client_notify_handler, h, | 444 | GNUNET_CLIENT_receive (h->client, &client_notify_handler, h, |
445 | GNUNET_TIME_UNIT_FOREVER_REL); | 445 | GNUNET_TIME_UNIT_FOREVER_REL); |
446 | switch (ntohs (msg->type)) | 446 | switch (ntohs (msg->type)) |
447 | { | 447 | { |
448 | case GNUNET_MESSAGE_TYPE_ARM_RESULT: | 448 | case GNUNET_MESSAGE_TYPE_ARM_RESULT: |
449 | res = (const struct GNUNET_ARM_ResultMessage *) msg; | 449 | res = (const struct GNUNET_ARM_ResultMessage *) msg; |
450 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 450 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
451 | "Received response from ARM for service `%s': %u\n", | 451 | "Received response from ARM for service `%s': %u\n", |
@@ -461,7 +461,7 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
461 | list); | 461 | list); |
462 | GNUNET_free (list); | 462 | GNUNET_free (list); |
463 | break; | 463 | break; |
464 | } | 464 | } |
465 | GNUNET_free (cm->msg); | 465 | GNUNET_free (cm->msg); |
466 | GNUNET_free (cm); | 466 | GNUNET_free (cm); |
467 | } | 467 | } |
@@ -473,7 +473,7 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
473 | * @param cls closure with the 'struct GNUNET_ARM_Handle' | 473 | * @param cls closure with the 'struct GNUNET_ARM_Handle' |
474 | * @param size number of bytes available in buf | 474 | * @param size number of bytes available in buf |
475 | * @param buf where the callee should write the message | 475 | * @param buf where the callee should write the message |
476 | * @return number of bytes written to buf | 476 | * @return number of bytes written to buf |
477 | */ | 477 | */ |
478 | static size_t | 478 | static size_t |
479 | transmit_arm_message (void *cls, size_t size, void *buf) | 479 | transmit_arm_message (void *cls, size_t size, void *buf) |
@@ -490,7 +490,7 @@ transmit_arm_message (void *cls, size_t size, void *buf) | |||
490 | "transmit_arm_message is running with %p buffer of size %lu. ARM is known to be %s\n", | 490 | "transmit_arm_message is running with %p buffer of size %lu. ARM is known to be %s\n", |
491 | buf, size, h->currently_down ? "unconnected" : "connected"); | 491 | buf, size, h->currently_down ? "unconnected" : "connected"); |
492 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); | 492 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); |
493 | h->cth = NULL; | 493 | h->cth = NULL; |
494 | if ((GNUNET_YES == h->currently_down) && (NULL != buf)) | 494 | if ((GNUNET_YES == h->currently_down) && (NULL != buf)) |
495 | { | 495 | { |
496 | h->currently_down = GNUNET_NO; | 496 | h->currently_down = GNUNET_NO; |
@@ -658,14 +658,14 @@ void | |||
658 | GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h) | 658 | GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h) |
659 | { | 659 | { |
660 | struct ARMControlMessage *cm; | 660 | struct ARMControlMessage *cm; |
661 | 661 | ||
662 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from ARM service\n"); | 662 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from ARM service\n"); |
663 | if (NULL != h->cth) | 663 | if (NULL != h->cth) |
664 | { | 664 | { |
665 | GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth); | 665 | GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth); |
666 | h->cth = NULL; | 666 | h->cth = NULL; |
667 | } | 667 | } |
668 | while ((NULL != (cm = h->control_pending_head)) | 668 | while ((NULL != (cm = h->control_pending_head)) |
669 | || (NULL != (cm = h->control_sent_head)) ) | 669 | || (NULL != (cm = h->control_sent_head)) ) |
670 | { | 670 | { |
671 | if (NULL != h->control_pending_head) | 671 | if (NULL != h->control_pending_head) |
@@ -764,13 +764,13 @@ arm_service_report (void *cls, | |||
764 | if ((GNUNET_YES == test_is_active) && | 764 | if ((GNUNET_YES == test_is_active) && |
765 | (GNUNET_YES == result)) | 765 | (GNUNET_YES == result)) |
766 | { | 766 | { |
767 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 767 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
768 | "Looks like `%s' is already running.\n", | 768 | "Looks like `%s' is already running.\n", |
769 | "gnunet-service-arm"); | 769 | "gnunet-service-arm"); |
770 | /* arm is running! */ | 770 | /* arm is running! */ |
771 | if (cm->result_cont) | 771 | if (cm->result_cont) |
772 | cm->result_cont (cm->cont_cls, | 772 | cm->result_cont (cm->cont_cls, |
773 | GNUNET_ARM_REQUEST_SENT_OK, "arm", | 773 | GNUNET_ARM_REQUEST_SENT_OK, "arm", |
774 | GNUNET_ARM_RESULT_IS_STARTED_ALREADY); | 774 | GNUNET_ARM_RESULT_IS_STARTED_ALREADY); |
775 | } | 775 | } |
776 | if (GNUNET_NO == test_is_active) | 776 | if (GNUNET_NO == test_is_active) |
@@ -802,8 +802,8 @@ arm_service_report (void *cls, | |||
802 | { | 802 | { |
803 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, "arm", "BINARY"); | 803 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, "arm", "BINARY"); |
804 | if (cm->result_cont) | 804 | if (cm->result_cont) |
805 | cm->result_cont (cm->cont_cls, | 805 | cm->result_cont (cm->cont_cls, |
806 | GNUNET_ARM_REQUEST_SENT_OK, "arm", | 806 | GNUNET_ARM_REQUEST_SENT_OK, "arm", |
807 | GNUNET_ARM_RESULT_IS_NOT_KNOWN); | 807 | GNUNET_ARM_RESULT_IS_NOT_KNOWN); |
808 | GNUNET_free (cm); | 808 | GNUNET_free (cm); |
809 | GNUNET_free (loprefix); | 809 | GNUNET_free (loprefix); |
@@ -935,9 +935,9 @@ change_service (struct GNUNET_ARM_Handle *h, const char *service_name, | |||
935 | */ | 935 | */ |
936 | void | 936 | void |
937 | GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h, | 937 | GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h, |
938 | const char *service_name, | 938 | const char *service_name, |
939 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 939 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
940 | struct GNUNET_TIME_Relative timeout, | 940 | struct GNUNET_TIME_Relative timeout, |
941 | GNUNET_ARM_ResultCallback cont, | 941 | GNUNET_ARM_ResultCallback cont, |
942 | void *cont_cls) | 942 | void *cont_cls) |
943 | { | 943 | { |
@@ -1026,14 +1026,14 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h, | |||
1026 | */ | 1026 | */ |
1027 | void | 1027 | void |
1028 | GNUNET_ARM_request_service_stop (struct GNUNET_ARM_Handle *h, | 1028 | GNUNET_ARM_request_service_stop (struct GNUNET_ARM_Handle *h, |
1029 | const char *service_name, | 1029 | const char *service_name, |
1030 | struct GNUNET_TIME_Relative timeout, | 1030 | struct GNUNET_TIME_Relative timeout, |
1031 | GNUNET_ARM_ResultCallback cont, | 1031 | GNUNET_ARM_ResultCallback cont, |
1032 | void *cont_cls) | 1032 | void *cont_cls) |
1033 | { | 1033 | { |
1034 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1034 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1035 | "Stopping service `%s' within %s\n", | 1035 | "Stopping service `%s' within %s\n", |
1036 | service_name, | 1036 | service_name, |
1037 | GNUNET_STRINGS_relative_time_to_string (timeout, GNUNET_NO)); | 1037 | GNUNET_STRINGS_relative_time_to_string (timeout, GNUNET_NO)); |
1038 | change_service (h, service_name, timeout, cont, cont_cls, | 1038 | change_service (h, service_name, timeout, cont, cont_cls, |
1039 | GNUNET_MESSAGE_TYPE_ARM_STOP); | 1039 | GNUNET_MESSAGE_TYPE_ARM_STOP); |
@@ -1051,14 +1051,14 @@ GNUNET_ARM_request_service_stop (struct GNUNET_ARM_Handle *h, | |||
1051 | void | 1051 | void |
1052 | GNUNET_ARM_request_service_list (struct GNUNET_ARM_Handle *h, | 1052 | GNUNET_ARM_request_service_list (struct GNUNET_ARM_Handle *h, |
1053 | struct GNUNET_TIME_Relative timeout, | 1053 | struct GNUNET_TIME_Relative timeout, |
1054 | GNUNET_ARM_ServiceListCallback cont, | 1054 | GNUNET_ARM_ServiceListCallback cont, |
1055 | void *cont_cls) | 1055 | void *cont_cls) |
1056 | { | 1056 | { |
1057 | struct ARMControlMessage *cm; | 1057 | struct ARMControlMessage *cm; |
1058 | struct GNUNET_ARM_Message *msg; | 1058 | struct GNUNET_ARM_Message *msg; |
1059 | 1059 | ||
1060 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1060 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1061 | "Requesting LIST from ARM service with timeout: %s\n", | 1061 | "Requesting LIST from ARM service with timeout: %s\n", |
1062 | GNUNET_STRINGS_relative_time_to_string (timeout, GNUNET_YES)); | 1062 | GNUNET_STRINGS_relative_time_to_string (timeout, GNUNET_YES)); |
1063 | cm = GNUNET_malloc (sizeof (struct ARMControlMessage)); | 1063 | cm = GNUNET_malloc (sizeof (struct ARMControlMessage)); |
1064 | cm->h = h; | 1064 | cm->h = h; |
diff --git a/src/arm/arm_monitor_api.c b/src/arm/arm_monitor_api.c index f8d41e790..7b403fde8 100644 --- a/src/arm/arm_monitor_api.c +++ b/src/arm/arm_monitor_api.c | |||
@@ -167,7 +167,7 @@ init_timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
167 | * @param cls closure with the 'struct GNUNET_ARM_MonitorHandle' | 167 | * @param cls closure with the 'struct GNUNET_ARM_MonitorHandle' |
168 | * @param size number of bytes available in buf | 168 | * @param size number of bytes available in buf |
169 | * @param buf where the callee should write the message | 169 | * @param buf where the callee should write the message |
170 | * @return number of bytes written to buf | 170 | * @return number of bytes written to buf |
171 | */ | 171 | */ |
172 | static size_t | 172 | static size_t |
173 | transmit_monitoring_init_message (void *cls, size_t size, void *buf) | 173 | transmit_monitoring_init_message (void *cls, size_t size, void *buf) |
diff --git a/src/arm/do_start_process.c b/src/arm/do_start_process.c index 95ec74405..d8ee1f0c3 100644 --- a/src/arm/do_start_process.c +++ b/src/arm/do_start_process.c | |||
@@ -122,7 +122,7 @@ do_start_process (int pipe_control, unsigned int std_inheritance, | |||
122 | va_end (ap); | 122 | va_end (ap); |
123 | argv[argv_size] = NULL; | 123 | argv[argv_size] = NULL; |
124 | binary_path = argv[0]; | 124 | binary_path = argv[0]; |
125 | proc = GNUNET_OS_start_process_v (pipe_control, std_inheritance, lsocks, | 125 | proc = GNUNET_OS_start_process_v (pipe_control, std_inheritance, lsocks, |
126 | binary_path, argv); | 126 | binary_path, argv); |
127 | while (argv_size > 0) | 127 | while (argv_size > 0) |
128 | GNUNET_free (argv[--argv_size]); | 128 | GNUNET_free (argv[--argv_size]); |
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index 85cb1f45d..80d3e9c03 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c | |||
@@ -167,7 +167,7 @@ delete_files () | |||
167 | { | 167 | { |
168 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 168 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
169 | _("Failed to remove servicehome directory %s\n"), dir); | 169 | _("Failed to remove servicehome directory %s\n"), dir); |
170 | 170 | ||
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
@@ -269,7 +269,7 @@ ret_string (enum GNUNET_ARM_Result result) | |||
269 | * @param cls closure | 269 | * @param cls closure |
270 | * @param tc scheudler context | 270 | * @param tc scheudler context |
271 | */ | 271 | */ |
272 | static void | 272 | static void |
273 | action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 273 | action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
274 | 274 | ||
275 | 275 | ||
@@ -283,11 +283,11 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | |||
283 | * GNUNET_SYSERR on error. | 283 | * GNUNET_SYSERR on error. |
284 | */ | 284 | */ |
285 | static void | 285 | static void |
286 | conn_status (void *cls, | 286 | conn_status (void *cls, |
287 | int connected) | 287 | int connected) |
288 | { | 288 | { |
289 | static int once; | 289 | static int once; |
290 | 290 | ||
291 | if ( (GNUNET_SYSERR == connected) && | 291 | if ( (GNUNET_SYSERR == connected) && |
292 | (0 == once) ) | 292 | (0 == once) ) |
293 | { | 293 | { |
@@ -335,7 +335,7 @@ start_callback (void *cls, | |||
335 | GNUNET_free (msg); | 335 | GNUNET_free (msg); |
336 | GNUNET_SCHEDULER_shutdown (); | 336 | GNUNET_SCHEDULER_shutdown (); |
337 | return; | 337 | return; |
338 | } | 338 | } |
339 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM service [re]start successful\n"); | 339 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM service [re]start successful\n"); |
340 | start = 0; | 340 | start = 0; |
341 | GNUNET_SCHEDULER_add_now (action_loop, NULL); | 341 | GNUNET_SCHEDULER_add_now (action_loop, NULL); |
@@ -355,7 +355,7 @@ start_callback (void *cls, | |||
355 | * according to ARM | 355 | * according to ARM |
356 | */ | 356 | */ |
357 | static void | 357 | static void |
358 | stop_callback (void *cls, | 358 | stop_callback (void *cls, |
359 | enum GNUNET_ARM_RequestStatus rs, const char *service, | 359 | enum GNUNET_ARM_RequestStatus rs, const char *service, |
360 | enum GNUNET_ARM_Result result) | 360 | enum GNUNET_ARM_Result result) |
361 | { | 361 | { |
@@ -363,7 +363,7 @@ stop_callback (void *cls, | |||
363 | 363 | ||
364 | if (GNUNET_ARM_REQUEST_SENT_OK != rs) | 364 | if (GNUNET_ARM_REQUEST_SENT_OK != rs) |
365 | { | 365 | { |
366 | GNUNET_asprintf (&msg, "%s", | 366 | GNUNET_asprintf (&msg, "%s", |
367 | _("Failed to send a stop request to the ARM service: %s\n")); | 367 | _("Failed to send a stop request to the ARM service: %s\n")); |
368 | FPRINTF (stdout, msg, req_string (rs)); | 368 | FPRINTF (stdout, msg, req_string (rs)); |
369 | GNUNET_free (msg); | 369 | GNUNET_free (msg); |
@@ -380,14 +380,14 @@ stop_callback (void *cls, | |||
380 | GNUNET_SCHEDULER_shutdown (); | 380 | GNUNET_SCHEDULER_shutdown (); |
381 | return; | 381 | return; |
382 | } | 382 | } |
383 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 383 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
384 | "ARM service shutdown successful\n"); | 384 | "ARM service shutdown successful\n"); |
385 | end = 0; | 385 | end = 0; |
386 | if (restart) | 386 | if (restart) |
387 | { | 387 | { |
388 | restart = 0; | 388 | restart = 0; |
389 | start = 1; | 389 | start = 1; |
390 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 390 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
391 | "Initiating an ARM restart\n"); | 391 | "Initiating an ARM restart\n"); |
392 | } | 392 | } |
393 | GNUNET_SCHEDULER_add_now (&action_loop, NULL); | 393 | GNUNET_SCHEDULER_add_now (&action_loop, NULL); |
@@ -407,12 +407,12 @@ stop_callback (void *cls, | |||
407 | * according to ARM | 407 | * according to ARM |
408 | */ | 408 | */ |
409 | static void | 409 | static void |
410 | init_callback (void *cls, | 410 | init_callback (void *cls, |
411 | enum GNUNET_ARM_RequestStatus rs, const char *service, | 411 | enum GNUNET_ARM_RequestStatus rs, const char *service, |
412 | enum GNUNET_ARM_Result result) | 412 | enum GNUNET_ARM_Result result) |
413 | { | 413 | { |
414 | char *msg; | 414 | char *msg; |
415 | 415 | ||
416 | if (GNUNET_ARM_REQUEST_SENT_OK != rs) | 416 | if (GNUNET_ARM_REQUEST_SENT_OK != rs) |
417 | { | 417 | { |
418 | GNUNET_asprintf (&msg, _("Failed to send a request to start the `%s' service: %%s\n"), init); | 418 | GNUNET_asprintf (&msg, _("Failed to send a request to start the `%s' service: %%s\n"), init); |
@@ -431,8 +431,8 @@ init_callback (void *cls, | |||
431 | GNUNET_SCHEDULER_shutdown (); | 431 | GNUNET_SCHEDULER_shutdown (); |
432 | return; | 432 | return; |
433 | } | 433 | } |
434 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 434 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
435 | "Service %s [re]started successfully\n", | 435 | "Service %s [re]started successfully\n", |
436 | init); | 436 | init); |
437 | init = NULL; | 437 | init = NULL; |
438 | GNUNET_SCHEDULER_add_now (&action_loop, NULL); | 438 | GNUNET_SCHEDULER_add_now (&action_loop, NULL); |
@@ -452,7 +452,7 @@ init_callback (void *cls, | |||
452 | * according to ARM | 452 | * according to ARM |
453 | */ | 453 | */ |
454 | static void | 454 | static void |
455 | term_callback (void *cls, | 455 | term_callback (void *cls, |
456 | enum GNUNET_ARM_RequestStatus rs, const char *service, | 456 | enum GNUNET_ARM_RequestStatus rs, const char *service, |
457 | enum GNUNET_ARM_Result result) | 457 | enum GNUNET_ARM_Result result) |
458 | { | 458 | { |
@@ -470,7 +470,7 @@ term_callback (void *cls, | |||
470 | if ((GNUNET_ARM_RESULT_STOPPED != result) && | 470 | if ((GNUNET_ARM_RESULT_STOPPED != result) && |
471 | (GNUNET_ARM_RESULT_IS_STOPPED_ALREADY != result)) | 471 | (GNUNET_ARM_RESULT_IS_STOPPED_ALREADY != result)) |
472 | { | 472 | { |
473 | GNUNET_asprintf (&msg, | 473 | GNUNET_asprintf (&msg, |
474 | _("Failed to kill the `%s' service: %s\n"), | 474 | _("Failed to kill the `%s' service: %s\n"), |
475 | term, ret_string (result)); | 475 | term, ret_string (result)); |
476 | FPRINTF (stdout, msg, service); | 476 | FPRINTF (stdout, msg, service); |
@@ -479,7 +479,7 @@ term_callback (void *cls, | |||
479 | return; | 479 | return; |
480 | } | 480 | } |
481 | 481 | ||
482 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 482 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
483 | "Service %s stopped successfully\n", term); | 483 | "Service %s stopped successfully\n", term); |
484 | term = NULL; | 484 | term = NULL; |
485 | GNUNET_SCHEDULER_add_now (&action_loop, NULL); | 485 | GNUNET_SCHEDULER_add_now (&action_loop, NULL); |
@@ -497,7 +497,7 @@ term_callback (void *cls, | |||
497 | * @param list list of services that are running | 497 | * @param list list of services that are running |
498 | */ | 498 | */ |
499 | static void | 499 | static void |
500 | list_callback (void *cls, | 500 | list_callback (void *cls, |
501 | enum GNUNET_ARM_RequestStatus rs, unsigned int count, | 501 | enum GNUNET_ARM_RequestStatus rs, unsigned int count, |
502 | const char *const*list) | 502 | const char *const*list) |
503 | { | 503 | { |
@@ -546,7 +546,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
546 | if (NULL != term) | 546 | if (NULL != term) |
547 | { | 547 | { |
548 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Termination action\n"); | 548 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Termination action\n"); |
549 | GNUNET_ARM_request_service_stop (h, term, | 549 | GNUNET_ARM_request_service_stop (h, term, |
550 | (0 == timeout.rel_value_us) ? STOP_TIMEOUT : timeout, | 550 | (0 == timeout.rel_value_us) ? STOP_TIMEOUT : timeout, |
551 | &term_callback, NULL); | 551 | &term_callback, NULL); |
552 | return; | 552 | return; |
@@ -556,7 +556,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
556 | if (end || restart) | 556 | if (end || restart) |
557 | { | 557 | { |
558 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "End action\n"); | 558 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "End action\n"); |
559 | GNUNET_ARM_request_service_stop (h, "arm", | 559 | GNUNET_ARM_request_service_stop (h, "arm", |
560 | (0 == timeout.rel_value_us) ? STOP_TIMEOUT_ARM : timeout, | 560 | (0 == timeout.rel_value_us) ? STOP_TIMEOUT_ARM : timeout, |
561 | &stop_callback, NULL); | 561 | &stop_callback, NULL); |
562 | return; | 562 | return; |
@@ -585,7 +585,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
585 | } | 585 | } |
586 | break; | 586 | break; |
587 | case 4: | 587 | case 4: |
588 | if (list) | 588 | if (list) |
589 | { | 589 | { |
590 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 590 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
591 | "Going to list all running services controlled by ARM.\n"); | 591 | "Going to list all running services controlled by ARM.\n"); |
@@ -593,10 +593,10 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
593 | (0 == timeout.rel_value_us) ? LIST_TIMEOUT : timeout, | 593 | (0 == timeout.rel_value_us) ? LIST_TIMEOUT : timeout, |
594 | &list_callback, &list); | 594 | &list_callback, &list); |
595 | return; | 595 | return; |
596 | } | 596 | } |
597 | break; | 597 | break; |
598 | case 5: | 598 | case 5: |
599 | if (monitor) | 599 | if (monitor) |
600 | { | 600 | { |
601 | if (! quiet) | 601 | if (! quiet) |
602 | fprintf (stderr, | 602 | fprintf (stderr, |
@@ -621,7 +621,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
621 | * @param status status of the service | 621 | * @param status status of the service |
622 | */ | 622 | */ |
623 | static void | 623 | static void |
624 | srv_status (void *cls, | 624 | srv_status (void *cls, |
625 | const char *service, enum GNUNET_ARM_ServiceStatus status) | 625 | const char *service, enum GNUNET_ARM_ServiceStatus status) |
626 | { | 626 | { |
627 | const char *msg; | 627 | const char *msg; |
@@ -663,8 +663,8 @@ srv_status (void *cls, | |||
663 | * @param c configuration | 663 | * @param c configuration |
664 | */ | 664 | */ |
665 | static void | 665 | static void |
666 | run (void *cls, | 666 | run (void *cls, |
667 | char *const *args, | 667 | char *const *args, |
668 | const char *cfgfile, | 668 | const char *cfgfile, |
669 | const struct GNUNET_CONFIGURATION_Handle *c) | 669 | const struct GNUNET_CONFIGURATION_Handle *c) |
670 | { | 670 | { |
@@ -672,7 +672,7 @@ run (void *cls, | |||
672 | 672 | ||
673 | cfg = GNUNET_CONFIGURATION_dup (c); | 673 | cfg = GNUNET_CONFIGURATION_dup (c); |
674 | config_file = cfgfile; | 674 | config_file = cfgfile; |
675 | if (GNUNET_OK != | 675 | if (GNUNET_OK != |
676 | GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "SERVICEHOME", &dir)) | 676 | GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "SERVICEHOME", &dir)) |
677 | { | 677 | { |
678 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | 678 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, |
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 906f0adde..1196b20aa 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -259,7 +259,7 @@ write_result (void *cls, size_t size, void *buf) | |||
259 | return 0; /* error, not much we can do */ | 259 | return 0; /* error, not much we can do */ |
260 | } | 260 | } |
261 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 261 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
262 | "Sending status response %u to client\n", | 262 | "Sending status response %u to client\n", |
263 | (unsigned int) msg->result); | 263 | (unsigned int) msg->result); |
264 | msize = msg->arm_msg.header.size; | 264 | msize = msg->arm_msg.header.size; |
265 | GNUNET_assert (size >= msize); | 265 | GNUNET_assert (size >= msize); |
@@ -275,7 +275,7 @@ write_result (void *cls, size_t size, void *buf) | |||
275 | 275 | ||
276 | /** | 276 | /** |
277 | * Transmit the list of running services. | 277 | * Transmit the list of running services. |
278 | * | 278 | * |
279 | * @param cls pointer to `struct GNUNET_ARM_ListResultMessage` with the message | 279 | * @param cls pointer to `struct GNUNET_ARM_ListResultMessage` with the message |
280 | * @param size number of bytes available in @a buf | 280 | * @param size number of bytes available in @a buf |
281 | * @param buf where to copy the message, NULL on error | 281 | * @param buf where to copy the message, NULL on error |
@@ -286,7 +286,7 @@ write_list_result (void *cls, size_t size, void *buf) | |||
286 | { | 286 | { |
287 | struct GNUNET_ARM_ListResultMessage *msg = cls; | 287 | struct GNUNET_ARM_ListResultMessage *msg = cls; |
288 | size_t rslt_size; | 288 | size_t rslt_size; |
289 | 289 | ||
290 | if (buf == NULL) | 290 | if (buf == NULL) |
291 | { | 291 | { |
292 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 292 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -294,14 +294,14 @@ write_list_result (void *cls, size_t size, void *buf) | |||
294 | GNUNET_free (msg); | 294 | GNUNET_free (msg); |
295 | return 0; /* error, not much we can do */ | 295 | return 0; /* error, not much we can do */ |
296 | } | 296 | } |
297 | 297 | ||
298 | rslt_size = msg->arm_msg.header.size; | 298 | rslt_size = msg->arm_msg.header.size; |
299 | GNUNET_assert (size >= rslt_size); | 299 | GNUNET_assert (size >= rslt_size); |
300 | msg->arm_msg.header.size = htons (msg->arm_msg.header.size); | 300 | msg->arm_msg.header.size = htons (msg->arm_msg.header.size); |
301 | msg->arm_msg.header.type = htons (msg->arm_msg.header.type); | 301 | msg->arm_msg.header.type = htons (msg->arm_msg.header.type); |
302 | msg->arm_msg.request_id = GNUNET_htonll (msg->arm_msg.request_id); | 302 | msg->arm_msg.request_id = GNUNET_htonll (msg->arm_msg.request_id); |
303 | msg->count = htons (msg->count); | 303 | msg->count = htons (msg->count); |
304 | 304 | ||
305 | memcpy (buf, msg, rslt_size); | 305 | memcpy (buf, msg, rslt_size); |
306 | GNUNET_free (msg); | 306 | GNUNET_free (msg); |
307 | return rslt_size; | 307 | return rslt_size; |
@@ -319,7 +319,7 @@ write_list_result (void *cls, size_t size, void *buf) | |||
319 | * @return NULL if it was not found | 319 | * @return NULL if it was not found |
320 | */ | 320 | */ |
321 | static void | 321 | static void |
322 | signal_result (struct GNUNET_SERVER_Client *client, | 322 | signal_result (struct GNUNET_SERVER_Client *client, |
323 | const char *name, | 323 | const char *name, |
324 | uint64_t request_id, | 324 | uint64_t request_id, |
325 | enum GNUNET_ARM_Result result) | 325 | enum GNUNET_ARM_Result result) |
@@ -335,7 +335,7 @@ signal_result (struct GNUNET_SERVER_Client *client, | |||
335 | msg->arm_msg.request_id = request_id; | 335 | msg->arm_msg.request_id = request_id; |
336 | 336 | ||
337 | GNUNET_SERVER_notify_transmit_ready (client, msize, | 337 | GNUNET_SERVER_notify_transmit_ready (client, msize, |
338 | GNUNET_TIME_UNIT_FOREVER_REL, | 338 | GNUNET_TIME_UNIT_FOREVER_REL, |
339 | write_result, msg); | 339 | write_result, msg); |
340 | } | 340 | } |
341 | 341 | ||
@@ -492,7 +492,7 @@ start_process (struct ServiceList *sl, struct GNUNET_SERVER_Client *client, uint | |||
492 | if (NULL == sl->config) | 492 | if (NULL == sl->config) |
493 | sl->proc = | 493 | sl->proc = |
494 | do_start_process (sl->pipe_control, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 494 | do_start_process (sl->pipe_control, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
495 | lsocks, loprefix, binary, | 495 | lsocks, loprefix, binary, |
496 | options, NULL); | 496 | options, NULL); |
497 | else | 497 | else |
498 | sl->proc = | 498 | sl->proc = |
@@ -693,7 +693,7 @@ handle_start (void *cls, struct GNUNET_SERVER_Client *client, | |||
693 | uint64_t request_id; | 693 | uint64_t request_id; |
694 | struct GNUNET_ARM_Message *amsg; | 694 | struct GNUNET_ARM_Message *amsg; |
695 | 695 | ||
696 | amsg = (struct GNUNET_ARM_Message *) message; | 696 | amsg = (struct GNUNET_ARM_Message *) message; |
697 | request_id = GNUNET_ntohll (amsg->request_id); | 697 | request_id = GNUNET_ntohll (amsg->request_id); |
698 | size = ntohs (amsg->header.size); | 698 | size = ntohs (amsg->header.size); |
699 | size -= sizeof (struct GNUNET_ARM_Message); | 699 | size -= sizeof (struct GNUNET_ARM_Message); |
@@ -762,7 +762,7 @@ handle_stop (void *cls, struct GNUNET_SERVER_Client *client, | |||
762 | uint64_t request_id; | 762 | uint64_t request_id; |
763 | struct GNUNET_ARM_Message *amsg; | 763 | struct GNUNET_ARM_Message *amsg; |
764 | 764 | ||
765 | amsg = (struct GNUNET_ARM_Message *) message; | 765 | amsg = (struct GNUNET_ARM_Message *) message; |
766 | request_id = GNUNET_ntohll (amsg->request_id); | 766 | request_id = GNUNET_ntohll (amsg->request_id); |
767 | size = ntohs (amsg->header.size); | 767 | size = ntohs (amsg->header.size); |
768 | size -= sizeof (struct GNUNET_ARM_Message); | 768 | size -= sizeof (struct GNUNET_ARM_Message); |
@@ -847,10 +847,10 @@ handle_list (void *cls, struct GNUNET_SERVER_Client *client, | |||
847 | size_t total_size; | 847 | size_t total_size; |
848 | struct ServiceList *sl; | 848 | struct ServiceList *sl; |
849 | uint16_t count; | 849 | uint16_t count; |
850 | 850 | ||
851 | if (NULL == client) | 851 | if (NULL == client) |
852 | return; | 852 | return; |
853 | 853 | ||
854 | request = (struct GNUNET_ARM_Message *) message; | 854 | request = (struct GNUNET_ARM_Message *) message; |
855 | count = 0; | 855 | count = 0; |
856 | string_list_size = 0; | 856 | string_list_size = 0; |
@@ -866,16 +866,16 @@ handle_list (void *cls, struct GNUNET_SERVER_Client *client, | |||
866 | } | 866 | } |
867 | } | 867 | } |
868 | 868 | ||
869 | total_size = sizeof (struct GNUNET_ARM_ListResultMessage) | 869 | total_size = sizeof (struct GNUNET_ARM_ListResultMessage) |
870 | + string_list_size; | 870 | + string_list_size; |
871 | msg = GNUNET_malloc (total_size); | 871 | msg = GNUNET_malloc (total_size); |
872 | msg->arm_msg.header.size = total_size; | 872 | msg->arm_msg.header.size = total_size; |
873 | msg->arm_msg.header.type = GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT; | 873 | msg->arm_msg.header.type = GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT; |
874 | msg->arm_msg.request_id = GNUNET_ntohll (request->request_id); | 874 | msg->arm_msg.request_id = GNUNET_ntohll (request->request_id); |
875 | msg->count = count; | 875 | msg->count = count; |
876 | 876 | ||
877 | char *pos = (char *)&msg[1]; | 877 | char *pos = (char *)&msg[1]; |
878 | for (sl = running_head; sl != NULL; sl = sl->next) | 878 | for (sl = running_head; sl != NULL; sl = sl->next) |
879 | { | 879 | { |
880 | if (sl->proc != NULL) | 880 | if (sl->proc != NULL) |
881 | { | 881 | { |
@@ -884,7 +884,7 @@ handle_list (void *cls, struct GNUNET_SERVER_Client *client, | |||
884 | pos += s; | 884 | pos += s; |
885 | } | 885 | } |
886 | } | 886 | } |
887 | 887 | ||
888 | GNUNET_SERVER_notify_transmit_ready (client, | 888 | GNUNET_SERVER_notify_transmit_ready (client, |
889 | total_size, | 889 | total_size, |
890 | GNUNET_TIME_UNIT_FOREVER_REL, | 890 | GNUNET_TIME_UNIT_FOREVER_REL, |
@@ -926,7 +926,7 @@ list_count (struct ServiceList *running_head) | |||
926 | unsigned int res = 0; | 926 | unsigned int res = 0; |
927 | 927 | ||
928 | for (res = 0, i = running_head; i; i = i->next, res++) | 928 | for (res = 0, i = running_head; i; i = i->next, res++) |
929 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 929 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
930 | "%s\n", | 930 | "%s\n", |
931 | i->name); | 931 | i->name); |
932 | return res; | 932 | return res; |
@@ -946,7 +946,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
946 | struct ServiceList *nxt; | 946 | struct ServiceList *nxt; |
947 | struct ServiceListeningInfo *sli; | 947 | struct ServiceListeningInfo *sli; |
948 | 948 | ||
949 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 949 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
950 | "First shutdown phase\n"); | 950 | "First shutdown phase\n"); |
951 | if (GNUNET_SCHEDULER_NO_TASK != child_restart_task) | 951 | if (GNUNET_SCHEDULER_NO_TASK != child_restart_task) |
952 | { | 952 | { |
@@ -979,7 +979,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
979 | nxt = pos->next; | 979 | nxt = pos->next; |
980 | if (pos->proc != NULL) | 980 | if (pos->proc != NULL) |
981 | { | 981 | { |
982 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 982 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
983 | "Stopping service `%s'\n", | 983 | "Stopping service `%s'\n", |
984 | pos->name); | 984 | pos->name); |
985 | pos->killed_at = GNUNET_TIME_absolute_get (); | 985 | pos->killed_at = GNUNET_TIME_absolute_get (); |
@@ -996,7 +996,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
996 | do_shutdown (); | 996 | do_shutdown (); |
997 | else | 997 | else |
998 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 998 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
999 | "Delaying shutdown, have %u childs still running\n", | 999 | "Delaying shutdown, have %u childs still running\n", |
1000 | list_count (running_head)); | 1000 | list_count (running_head)); |
1001 | } | 1001 | } |
1002 | 1002 | ||
@@ -1063,12 +1063,12 @@ delayed_restart_task (void *cls, | |||
1063 | } | 1063 | } |
1064 | if (lowestRestartDelay.rel_value_us != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) | 1064 | if (lowestRestartDelay.rel_value_us != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
1065 | { | 1065 | { |
1066 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1066 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1067 | "Will restart process in %s\n", | 1067 | "Will restart process in %s\n", |
1068 | GNUNET_STRINGS_relative_time_to_string (lowestRestartDelay, GNUNET_YES)); | 1068 | GNUNET_STRINGS_relative_time_to_string (lowestRestartDelay, GNUNET_YES)); |
1069 | child_restart_task = | 1069 | child_restart_task = |
1070 | GNUNET_SCHEDULER_add_delayed_with_priority (lowestRestartDelay, | 1070 | GNUNET_SCHEDULER_add_delayed_with_priority (lowestRestartDelay, |
1071 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 1071 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
1072 | &delayed_restart_task, NULL); | 1072 | &delayed_restart_task, NULL); |
1073 | } | 1073 | } |
1074 | } | 1074 | } |
@@ -1275,7 +1275,7 @@ setup_service (void *cls, const char *section) | |||
1275 | { | 1275 | { |
1276 | if (NULL != config) | 1276 | if (NULL != config) |
1277 | { | 1277 | { |
1278 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_WARNING, | 1278 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_WARNING, |
1279 | section, "CONFIG", | 1279 | section, "CONFIG", |
1280 | STRERROR (errno)); | 1280 | STRERROR (errno)); |
1281 | GNUNET_free (config); | 1281 | GNUNET_free (config); |
@@ -1293,7 +1293,7 @@ setup_service (void *cls, const char *section) | |||
1293 | #else | 1293 | #else |
1294 | if (GNUNET_CONFIGURATION_have_value (cfg, section, "PIPECONTROL")) | 1294 | if (GNUNET_CONFIGURATION_have_value (cfg, section, "PIPECONTROL")) |
1295 | sl->pipe_control = GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "PIPECONTROL"); | 1295 | sl->pipe_control = GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "PIPECONTROL"); |
1296 | #endif | 1296 | #endif |
1297 | GNUNET_CONTAINER_DLL_insert (running_head, running_tail, sl); | 1297 | GNUNET_CONTAINER_DLL_insert (running_head, running_tail, sl); |
1298 | if (GNUNET_YES != | 1298 | if (GNUNET_YES != |
1299 | GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "AUTOSTART")) | 1299 | GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "AUTOSTART")) |
@@ -1363,9 +1363,9 @@ run (void *cls, struct GNUNET_SERVER_Handle *serv, | |||
1363 | static const struct GNUNET_SERVER_MessageHandler handlers[] = { | 1363 | static const struct GNUNET_SERVER_MessageHandler handlers[] = { |
1364 | {&handle_start, NULL, GNUNET_MESSAGE_TYPE_ARM_START, 0}, | 1364 | {&handle_start, NULL, GNUNET_MESSAGE_TYPE_ARM_START, 0}, |
1365 | {&handle_stop, NULL, GNUNET_MESSAGE_TYPE_ARM_STOP, 0}, | 1365 | {&handle_stop, NULL, GNUNET_MESSAGE_TYPE_ARM_STOP, 0}, |
1366 | {&handle_monitor, NULL, GNUNET_MESSAGE_TYPE_ARM_MONITOR, | 1366 | {&handle_monitor, NULL, GNUNET_MESSAGE_TYPE_ARM_MONITOR, |
1367 | sizeof (struct GNUNET_MessageHeader)}, | 1367 | sizeof (struct GNUNET_MessageHeader)}, |
1368 | {&handle_list, NULL, GNUNET_MESSAGE_TYPE_ARM_LIST, | 1368 | {&handle_list, NULL, GNUNET_MESSAGE_TYPE_ARM_LIST, |
1369 | sizeof (struct GNUNET_ARM_Message)}, | 1369 | sizeof (struct GNUNET_ARM_Message)}, |
1370 | {NULL, NULL, 0, 0} | 1370 | {NULL, NULL, 0, 0} |
1371 | }; | 1371 | }; |
@@ -1456,7 +1456,7 @@ main (int argc, char *const *argv) | |||
1456 | GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); | 1456 | GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); |
1457 | ret = | 1457 | ret = |
1458 | (GNUNET_OK == | 1458 | (GNUNET_OK == |
1459 | GNUNET_SERVICE_run (argc, argv, "arm", | 1459 | GNUNET_SERVICE_run (argc, argv, "arm", |
1460 | GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN, &run, NULL)) ? 0 : 1; | 1460 | GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN, &run, NULL)) ? 0 : 1; |
1461 | GNUNET_SIGNAL_handler_uninstall (shc_chld); | 1461 | GNUNET_SIGNAL_handler_uninstall (shc_chld); |
1462 | shc_chld = NULL; | 1462 | shc_chld = NULL; |
diff --git a/src/arm/test_arm_api.c b/src/arm/test_arm_api.c index a36d5939b..cdb173d5c 100644 --- a/src/arm/test_arm_api.c +++ b/src/arm/test_arm_api.c | |||
@@ -43,9 +43,9 @@ static int ok = 1; | |||
43 | static int phase = 0; | 43 | static int phase = 0; |
44 | 44 | ||
45 | static void | 45 | static void |
46 | arm_stop_cb (void *cls, | 46 | arm_stop_cb (void *cls, |
47 | enum GNUNET_ARM_RequestStatus status, | 47 | enum GNUNET_ARM_RequestStatus status, |
48 | const char *servicename, | 48 | const char *servicename, |
49 | enum GNUNET_ARM_Result result) | 49 | enum GNUNET_ARM_Result result) |
50 | { | 50 | { |
51 | /* (6), a stop request should be sent to ARM successfully */ | 51 | /* (6), a stop request should be sent to ARM successfully */ |
@@ -59,8 +59,8 @@ arm_stop_cb (void *cls, | |||
59 | 59 | ||
60 | 60 | ||
61 | static void | 61 | static void |
62 | resolver_stop_cb (void *cls, | 62 | resolver_stop_cb (void *cls, |
63 | enum GNUNET_ARM_RequestStatus status, | 63 | enum GNUNET_ARM_RequestStatus status, |
64 | const char *servicename, enum GNUNET_ARM_Result result) | 64 | const char *servicename, enum GNUNET_ARM_Result result) |
65 | { | 65 | { |
66 | /* (5), a stop request should be sent to ARM successfully. | 66 | /* (5), a stop request should be sent to ARM successfully. |
@@ -104,9 +104,9 @@ dns_notify (void *cls, const struct sockaddr *addr, socklen_t addrlen) | |||
104 | 104 | ||
105 | 105 | ||
106 | static void | 106 | static void |
107 | resolver_start_cb (void *cls, | 107 | resolver_start_cb (void *cls, |
108 | enum GNUNET_ARM_RequestStatus status, | 108 | enum GNUNET_ARM_RequestStatus status, |
109 | const char *servicename, | 109 | const char *servicename, |
110 | enum GNUNET_ARM_Result result) | 110 | enum GNUNET_ARM_Result result) |
111 | { | 111 | { |
112 | /* (2), the start request for resolver should be sent successfully | 112 | /* (2), the start request for resolver should be sent successfully |
@@ -129,7 +129,7 @@ trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
129 | 129 | ||
130 | 130 | ||
131 | static void | 131 | static void |
132 | arm_conn (void *cls, | 132 | arm_conn (void *cls, |
133 | int connected) | 133 | int connected) |
134 | { | 134 | { |
135 | if (GNUNET_SYSERR == connected) | 135 | if (GNUNET_SYSERR == connected) |
@@ -163,9 +163,9 @@ arm_conn (void *cls, | |||
163 | 163 | ||
164 | 164 | ||
165 | static void | 165 | static void |
166 | arm_start_cb (void *cls, | 166 | arm_start_cb (void *cls, |
167 | enum GNUNET_ARM_RequestStatus status, | 167 | enum GNUNET_ARM_RequestStatus status, |
168 | const char *servicename, | 168 | const char *servicename, |
169 | enum GNUNET_ARM_Result result) | 169 | enum GNUNET_ARM_Result result) |
170 | { | 170 | { |
171 | /* (0) The request should be "sent" successfully | 171 | /* (0) The request should be "sent" successfully |
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c index 08c4fd8ee..0561c3ea8 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c | |||
@@ -122,12 +122,12 @@ service_shutdown_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
122 | { | 122 | { |
123 | struct ShutdownContext *shutdown_ctx = cls; | 123 | struct ShutdownContext *shutdown_ctx = cls; |
124 | 124 | ||
125 | if (NULL == msg) | 125 | if (NULL == msg) |
126 | { | 126 | { |
127 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service shutdown complete.\n"); | 127 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service shutdown complete.\n"); |
128 | if (shutdown_ctx->cont != NULL) | 128 | if (shutdown_ctx->cont != NULL) |
129 | shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_NO); | 129 | shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_NO); |
130 | 130 | ||
131 | GNUNET_SCHEDULER_cancel (shutdown_ctx->cancel_task); | 131 | GNUNET_SCHEDULER_cancel (shutdown_ctx->cancel_task); |
132 | GNUNET_CLIENT_disconnect (shutdown_ctx->sock); | 132 | GNUNET_CLIENT_disconnect (shutdown_ctx->sock); |
133 | GNUNET_free (shutdown_ctx); | 133 | GNUNET_free (shutdown_ctx); |
@@ -253,7 +253,7 @@ kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
253 | if (NULL != cbData) | 253 | if (NULL != cbData) |
254 | { | 254 | { |
255 | waitedFor = GNUNET_TIME_absolute_get_duration (startedWaitingAt); | 255 | waitedFor = GNUNET_TIME_absolute_get_duration (startedWaitingAt); |
256 | LOG ("Waited for: %s\n", | 256 | LOG ("Waited for: %s\n", |
257 | GNUNET_STRINGS_relative_time_to_string (waitedFor, GNUNET_YES)); | 257 | GNUNET_STRINGS_relative_time_to_string (waitedFor, GNUNET_YES)); |
258 | } | 258 | } |
259 | else | 259 | else |
@@ -347,7 +347,7 @@ arm_start_cb (void *cls, enum GNUNET_ARM_RequestStatus status, const char *servi | |||
347 | GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK); | 347 | GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK); |
348 | GNUNET_break (result == GNUNET_ARM_RESULT_STARTING); | 348 | GNUNET_break (result == GNUNET_ARM_RESULT_STARTING); |
349 | GNUNET_break (phase == 0); | 349 | GNUNET_break (phase == 0); |
350 | LOG ("Sent 'START' request for arm to ARM %s\n", | 350 | LOG ("Sent 'START' request for arm to ARM %s\n", |
351 | (status == GNUNET_ARM_REQUEST_SENT_OK) ? "successfully" : "unsuccessfully"); | 351 | (status == GNUNET_ARM_REQUEST_SENT_OK) ? "successfully" : "unsuccessfully"); |
352 | } | 352 | } |
353 | 353 | ||
@@ -431,7 +431,7 @@ init () | |||
431 | return GNUNET_SYSERR; | 431 | return GNUNET_SYSERR; |
432 | GNUNET_assert (0 < GNUNET_asprintf (&binary, "%s/%s", pwd, BINARY)); | 432 | GNUNET_assert (0 < GNUNET_asprintf (&binary, "%s/%s", pwd, BINARY)); |
433 | GNUNET_CONFIGURATION_set_value_string (cfg, SERVICE, "BINARY", binary); | 433 | GNUNET_CONFIGURATION_set_value_string (cfg, SERVICE, "BINARY", binary); |
434 | GNUNET_free (binary); | 434 | GNUNET_free (binary); |
435 | if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, CFGFILENAME)) | 435 | if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, CFGFILENAME)) |
436 | { | 436 | { |
437 | GNUNET_CONFIGURATION_destroy (cfg); | 437 | GNUNET_CONFIGURATION_destroy (cfg); |
diff --git a/src/arm/test_gnunet_service_arm.c b/src/arm/test_gnunet_service_arm.c index e53322aa5..60feb9c19 100644 --- a/src/arm/test_gnunet_service_arm.c +++ b/src/arm/test_gnunet_service_arm.c | |||
@@ -18,7 +18,7 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file arm/test_gnunet_service_arm.c | 21 | * @file arm/test_gnunet_service_arm.c |
22 | * @brief testcase for gnunet-service-arm.c; tests ARM by making it start the resolver | 22 | * @brief testcase for gnunet-service-arm.c; tests ARM by making it start the resolver |
23 | * @author Safey | 23 | * @author Safey |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
@@ -55,9 +55,9 @@ trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
55 | 55 | ||
56 | 56 | ||
57 | static void | 57 | static void |
58 | arm_stop_cb (void *cls, | 58 | arm_stop_cb (void *cls, |
59 | enum GNUNET_ARM_RequestStatus status, | 59 | enum GNUNET_ARM_RequestStatus status, |
60 | const char *servicename, | 60 | const char *servicename, |
61 | enum GNUNET_ARM_Result result) | 61 | enum GNUNET_ARM_Result result) |
62 | { | 62 | { |
63 | GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK); | 63 | GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK); |
@@ -69,12 +69,12 @@ arm_stop_cb (void *cls, | |||
69 | 69 | ||
70 | 70 | ||
71 | static void | 71 | static void |
72 | service_list (void *cls, | 72 | service_list (void *cls, |
73 | enum GNUNET_ARM_RequestStatus rs, | 73 | enum GNUNET_ARM_RequestStatus rs, |
74 | unsigned int count, const char *const*list) | 74 | unsigned int count, const char *const*list) |
75 | { | 75 | { |
76 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 76 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
77 | "%u services are are currently running\n", | 77 | "%u services are are currently running\n", |
78 | count); | 78 | count); |
79 | GNUNET_break (count == 1); | 79 | GNUNET_break (count == 1); |
80 | GNUNET_break (0 == strcasecmp (list[0], "resolver (gnunet-service-resolver)")); | 80 | GNUNET_break (0 == strcasecmp (list[0], "resolver (gnunet-service-resolver)")); |
@@ -107,9 +107,9 @@ hostNameResolveCB (void *cls, const struct sockaddr *addr, socklen_t addrlen) | |||
107 | 107 | ||
108 | 108 | ||
109 | static void | 109 | static void |
110 | arm_start_cb (void *cls, | 110 | arm_start_cb (void *cls, |
111 | enum GNUNET_ARM_RequestStatus status, | 111 | enum GNUNET_ARM_RequestStatus status, |
112 | const char *servicename, | 112 | const char *servicename, |
113 | enum GNUNET_ARM_Result result) | 113 | enum GNUNET_ARM_Result result) |
114 | { | 114 | { |
115 | GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK); | 115 | GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK); |