diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-04-14 20:45:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-04-14 20:45:25 +0000 |
commit | 08676aaa5b76a0723c8c60ee510aec3652e50774 (patch) | |
tree | 0c1ccb9bd806733aba38f76c79499cb0f3cec048 /src/arm/arm_api.c | |
parent | ce52e258a28a17f5c319549fda1b5fbb8f6169a7 (diff) | |
download | gnunet-08676aaa5b76a0723c8c60ee510aec3652e50774.tar.gz gnunet-08676aaa5b76a0723c8c60ee510aec3652e50774.zip |
-remove unnecessary arguments from ARM callbacks
Diffstat (limited to 'src/arm/arm_api.c')
-rw-r--r-- | src/arm/arm_api.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index f221dac7b..3514a8f28 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c | |||
@@ -230,7 +230,7 @@ reconnect_arm_later (struct GNUNET_ARM_Handle *h) | |||
230 | */ | 230 | */ |
231 | h->retry_backoff = GNUNET_TIME_STD_BACKOFF (h->retry_backoff); | 231 | h->retry_backoff = GNUNET_TIME_STD_BACKOFF (h->retry_backoff); |
232 | if (NULL != h->conn_status) | 232 | if (NULL != h->conn_status) |
233 | h->conn_status (h->conn_status_cls, h, GNUNET_NO); | 233 | h->conn_status (h->conn_status_cls, GNUNET_NO); |
234 | } | 234 | } |
235 | 235 | ||
236 | /** | 236 | /** |
@@ -311,7 +311,7 @@ transmit_arm_message (void *cls, size_t size, void *buf) | |||
311 | 311 | ||
312 | end: | 312 | end: |
313 | if ((GNUNET_YES == notify_connection) && (NULL != h->conn_status)) | 313 | if ((GNUNET_YES == notify_connection) && (NULL != h->conn_status)) |
314 | h->conn_status (h->conn_status_cls, h, GNUNET_YES); | 314 | h->conn_status (h->conn_status_cls, GNUNET_YES); |
315 | return msize; | 315 | return msize; |
316 | } | 316 | } |
317 | 317 | ||
@@ -373,7 +373,7 @@ reconnect_arm (struct GNUNET_ARM_Handle *h) | |||
373 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 373 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
374 | "arm_api, GNUNET_CLIENT_connect returned NULL\n"); | 374 | "arm_api, GNUNET_CLIENT_connect returned NULL\n"); |
375 | if (NULL != h->conn_status) | 375 | if (NULL != h->conn_status) |
376 | h->conn_status (h->conn_status_cls, h, GNUNET_SYSERR); | 376 | h->conn_status (h->conn_status_cls, GNUNET_SYSERR); |
377 | return GNUNET_SYSERR; | 377 | return GNUNET_SYSERR; |
378 | } | 378 | } |
379 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 379 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -443,7 +443,7 @@ GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h) | |||
443 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cm->timeout_task_id); | 443 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cm->timeout_task_id); |
444 | GNUNET_SCHEDULER_cancel (cm->timeout_task_id); | 444 | GNUNET_SCHEDULER_cancel (cm->timeout_task_id); |
445 | if (NULL != cm->result_cont) | 445 | if (NULL != cm->result_cont) |
446 | cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_DISCONNECTED, | 446 | cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_DISCONNECTED, |
447 | NULL, 0); | 447 | NULL, 0); |
448 | /* FIXME: What about list callback? */ | 448 | /* FIXME: What about list callback? */ |
449 | GNUNET_free_non_null (cm->msg); | 449 | GNUNET_free_non_null (cm->msg); |
@@ -492,9 +492,9 @@ control_message_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *t | |||
492 | cm->h->control_sent_tail, cm); | 492 | cm->h->control_sent_tail, cm); |
493 | } | 493 | } |
494 | if (NULL != cm->result_cont) | 494 | if (NULL != cm->result_cont) |
495 | cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_TIMEOUT, NULL, 0); | 495 | cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_TIMEOUT, NULL, 0); |
496 | else if (NULL != cm->list_cont) | 496 | else if (NULL != cm->list_cont) |
497 | cm->list_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_TIMEOUT, 0, NULL); | 497 | cm->list_cont (cm->cont_cls, GNUNET_ARM_REQUEST_TIMEOUT, 0, NULL); |
498 | GNUNET_free_non_null (cm->msg); | 498 | GNUNET_free_non_null (cm->msg); |
499 | GNUNET_free (cm); | 499 | GNUNET_free (cm); |
500 | } | 500 | } |
@@ -535,7 +535,9 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
535 | "gnunet-service-arm"); | 535 | "gnunet-service-arm"); |
536 | /* arm is running! */ | 536 | /* arm is running! */ |
537 | if (cm->result_cont) | 537 | if (cm->result_cont) |
538 | cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_SENT_OK, "arm", GNUNET_ARM_RESULT_IS_STARTED_ALREADY); | 538 | cm->result_cont (cm->cont_cls, |
539 | GNUNET_ARM_REQUEST_SENT_OK, "arm", | ||
540 | GNUNET_ARM_RESULT_IS_STARTED_ALREADY); | ||
539 | } | 541 | } |
540 | if (GNUNET_NO == test_is_active) | 542 | if (GNUNET_NO == test_is_active) |
541 | { | 543 | { |
@@ -566,7 +568,9 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
566 | { | 568 | { |
567 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, "arm", "BINARY"); | 569 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, "arm", "BINARY"); |
568 | if (cm->result_cont) | 570 | if (cm->result_cont) |
569 | cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_SENT_OK, "arm", GNUNET_ARM_RESULT_IS_NOT_KNOWN); | 571 | cm->result_cont (cm->cont_cls, |
572 | GNUNET_ARM_REQUEST_SENT_OK, "arm", | ||
573 | GNUNET_ARM_RESULT_IS_NOT_KNOWN); | ||
570 | GNUNET_free (cm); | 574 | GNUNET_free (cm); |
571 | GNUNET_free (loprefix); | 575 | GNUNET_free (loprefix); |
572 | GNUNET_free (lopostfix); | 576 | GNUNET_free (lopostfix); |
@@ -615,13 +619,13 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
615 | if (NULL == proc) | 619 | if (NULL == proc) |
616 | { | 620 | { |
617 | if (cm->result_cont) | 621 | if (cm->result_cont) |
618 | cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_SENT_OK, "arm", | 622 | cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, "arm", |
619 | GNUNET_ARM_RESULT_START_FAILED); | 623 | GNUNET_ARM_RESULT_START_FAILED); |
620 | GNUNET_free (cm); | 624 | GNUNET_free (cm); |
621 | return; | 625 | return; |
622 | } | 626 | } |
623 | if (cm->result_cont) | 627 | if (cm->result_cont) |
624 | cm->result_cont (cm->cont_cls, cm->h, GNUNET_ARM_REQUEST_SENT_OK, "arm", | 628 | cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, "arm", |
625 | GNUNET_ARM_RESULT_STARTING); | 629 | GNUNET_ARM_RESULT_STARTING); |
626 | GNUNET_OS_process_destroy (proc); | 630 | GNUNET_OS_process_destroy (proc); |
627 | h = cm->h; | 631 | h = cm->h; |
@@ -655,7 +659,7 @@ change_service (struct GNUNET_ARM_Handle *h, const char *service_name, | |||
655 | { | 659 | { |
656 | GNUNET_break (0); | 660 | GNUNET_break (0); |
657 | if (cb != NULL) | 661 | if (cb != NULL) |
658 | cb (cb_cls, h, GNUNET_ARM_REQUEST_TOO_LONG, NULL, 0); | 662 | cb (cb_cls, GNUNET_ARM_REQUEST_TOO_LONG, NULL, 0); |
659 | return; | 663 | return; |
660 | } | 664 | } |
661 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Requesting %s of service `%s'.\n", | 665 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Requesting %s of service `%s'.\n", |
@@ -718,7 +722,7 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h, | |||
718 | { | 722 | { |
719 | LOG (GNUNET_ERROR_TYPE_DEBUG, "ARM is already running\n"); | 723 | LOG (GNUNET_ERROR_TYPE_DEBUG, "ARM is already running\n"); |
720 | if (NULL != cont) | 724 | if (NULL != cont) |
721 | cont (cont_cls, h, GNUNET_ARM_REQUEST_SENT_OK, "arm", GNUNET_ARM_RESULT_IS_STARTED_ALREADY); | 725 | cont (cont_cls, GNUNET_ARM_REQUEST_SENT_OK, "arm", GNUNET_ARM_RESULT_IS_STARTED_ALREADY); |
722 | } | 726 | } |
723 | else if (GNUNET_NO == h->service_test_is_active) | 727 | else if (GNUNET_NO == h->service_test_is_active) |
724 | { | 728 | { |
@@ -760,7 +764,7 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h, | |||
760 | */ | 764 | */ |
761 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Service test is already in progress, we're busy\n"); | 765 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Service test is already in progress, we're busy\n"); |
762 | if (NULL != cont) | 766 | if (NULL != cont) |
763 | cont (cont_cls, h, GNUNET_ARM_REQUEST_BUSY, NULL, 0); | 767 | cont (cont_cls, GNUNET_ARM_REQUEST_BUSY, NULL, 0); |
764 | } | 768 | } |
765 | return; | 769 | return; |
766 | } | 770 | } |
@@ -966,12 +970,12 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
966 | (const char *) &cm->msg[1], ntohs (msg->type)); | 970 | (const char *) &cm->msg[1], ntohs (msg->type)); |
967 | result = (enum GNUNET_ARM_Result) ntohl (res->result); | 971 | result = (enum GNUNET_ARM_Result) ntohl (res->result); |
968 | if (NULL != cm->result_cont) | 972 | if (NULL != cm->result_cont) |
969 | cm->result_cont (cm->cont_cls, h, GNUNET_ARM_REQUEST_SENT_OK, | 973 | cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, |
970 | (const char *) &cm->msg[1], result); | 974 | (const char *) &cm->msg[1], result); |
971 | break; | 975 | break; |
972 | case GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT: | 976 | case GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT: |
973 | if (NULL != cm->list_cont) | 977 | if (NULL != cm->list_cont) |
974 | cm->list_cont (cm->cont_cls, h, GNUNET_ARM_REQUEST_SENT_OK, rcount, | 978 | cm->list_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, rcount, |
975 | list); | 979 | list); |
976 | GNUNET_free (list); | 980 | GNUNET_free (list); |
977 | break; | 981 | break; |