From c08131d6c72570825bfbedcc2c06175deff274c8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 16 Sep 2019 21:26:06 +0200 Subject: reindentation --- src/curl/curl_reschedule.c | 87 +++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/src/curl/curl_reschedule.c b/src/curl/curl_reschedule.c index 0fdaa5e1f..9001f222d 100644 --- a/src/curl/curl_reschedule.c +++ b/src/curl/curl_reschedule.c @@ -28,14 +28,15 @@ #include "gnunet_util_lib.h" extern void * -GNUNET_CURL_download_get_result_(struct GNUNET_CURL_DownloadBuffer *db, - CURL *eh, - long *response_code); +GNUNET_CURL_download_get_result_ (struct GNUNET_CURL_DownloadBuffer *db, + CURL *eh, + long *response_code); /** * Closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). */ -struct GNUNET_CURL_RescheduleContext { +struct GNUNET_CURL_RescheduleContext +{ /** * Just the task. */ @@ -65,13 +66,13 @@ struct GNUNET_CURL_RescheduleContext { * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). */ struct GNUNET_CURL_RescheduleContext * -GNUNET_CURL_gnunet_rc_create_with_parser(struct GNUNET_CURL_Context *ctx, - GNUNET_CURL_RawParser rp, - GNUNET_CURL_ResponseCleaner rc) +GNUNET_CURL_gnunet_rc_create_with_parser (struct GNUNET_CURL_Context *ctx, + GNUNET_CURL_RawParser rp, + GNUNET_CURL_ResponseCleaner rc) { struct GNUNET_CURL_RescheduleContext *rctx; - rctx = GNUNET_new(struct GNUNET_CURL_RescheduleContext); + rctx = GNUNET_new (struct GNUNET_CURL_RescheduleContext); rctx->ctx = ctx; rctx->parser = rp; rctx->cleaner = rc; @@ -86,9 +87,9 @@ GNUNET_CURL_gnunet_rc_create_with_parser(struct GNUNET_CURL_Context *ctx, * @param response the (JSON) response to clean. */ static void -clean_result(void *response) +clean_result (void *response) { - json_decref(response); + json_decref (response); } /** @@ -98,11 +99,11 @@ clean_result(void *response) * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). */ struct GNUNET_CURL_RescheduleContext * -GNUNET_CURL_gnunet_rc_create(struct GNUNET_CURL_Context *ctx) +GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx) { struct GNUNET_CURL_RescheduleContext *rc; - rc = GNUNET_new(struct GNUNET_CURL_RescheduleContext); + rc = GNUNET_new (struct GNUNET_CURL_RescheduleContext); rc->ctx = ctx; rc->parser = &GNUNET_CURL_download_get_result_; rc->cleaner = &clean_result; @@ -116,11 +117,11 @@ GNUNET_CURL_gnunet_rc_create(struct GNUNET_CURL_Context *ctx) * @param rc context to destroy */ void -GNUNET_CURL_gnunet_rc_destroy(struct GNUNET_CURL_RescheduleContext *rc) +GNUNET_CURL_gnunet_rc_destroy (struct GNUNET_CURL_RescheduleContext *rc) { if (NULL != rc->task) - GNUNET_SCHEDULER_cancel(rc->task); - GNUNET_free(rc); + GNUNET_SCHEDULER_cancel (rc->task); + GNUNET_free (rc); } @@ -130,7 +131,7 @@ GNUNET_CURL_gnunet_rc_destroy(struct GNUNET_CURL_RescheduleContext *rc) * @param cls a `struct GNUNET_CURL_RescheduleContext *` */ static void -context_task(void *cls) +context_task (void *cls) { struct GNUNET_CURL_RescheduleContext *rc = cls; long timeout; @@ -144,36 +145,36 @@ context_task(void *cls) rc->task = NULL; - GNUNET_CURL_perform2(rc->ctx, rc->parser, rc->cleaner); + GNUNET_CURL_perform2 (rc->ctx, rc->parser, rc->cleaner); max_fd = -1; timeout = -1; - FD_ZERO(&read_fd_set); - FD_ZERO(&write_fd_set); - FD_ZERO(&except_fd_set); - GNUNET_CURL_get_select_info(rc->ctx, - &read_fd_set, - &write_fd_set, - &except_fd_set, - &max_fd, - &timeout); + FD_ZERO (&read_fd_set); + FD_ZERO (&write_fd_set); + FD_ZERO (&except_fd_set); + GNUNET_CURL_get_select_info (rc->ctx, + &read_fd_set, + &write_fd_set, + &except_fd_set, + &max_fd, + &timeout); if (timeout >= 0) delay = - GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, timeout); + GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, timeout); else delay = GNUNET_TIME_UNIT_FOREVER_REL; - rs = GNUNET_NETWORK_fdset_create(); - GNUNET_NETWORK_fdset_copy_native(rs, &read_fd_set, max_fd + 1); - ws = GNUNET_NETWORK_fdset_create(); - GNUNET_NETWORK_fdset_copy_native(ws, &write_fd_set, max_fd + 1); + rs = GNUNET_NETWORK_fdset_create (); + GNUNET_NETWORK_fdset_copy_native (rs, &read_fd_set, max_fd + 1); + ws = GNUNET_NETWORK_fdset_create (); + GNUNET_NETWORK_fdset_copy_native (ws, &write_fd_set, max_fd + 1); if (NULL == rc->task) - rc->task = GNUNET_SCHEDULER_add_select(GNUNET_SCHEDULER_PRIORITY_DEFAULT, - delay, - rs, - ws, - &context_task, - rc); - GNUNET_NETWORK_fdset_destroy(rs); - GNUNET_NETWORK_fdset_destroy(ws); + rc->task = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, + delay, + rs, + ws, + &context_task, + rc); + GNUNET_NETWORK_fdset_destroy (rs); + GNUNET_NETWORK_fdset_destroy (ws); } @@ -187,13 +188,13 @@ context_task(void *cls) * (pointer to a pointer!) */ void -GNUNET_CURL_gnunet_scheduler_reschedule(void *cls) +GNUNET_CURL_gnunet_scheduler_reschedule (void *cls) { - struct GNUNET_CURL_RescheduleContext *rc = *(void **)cls; + struct GNUNET_CURL_RescheduleContext *rc = *(void **) cls; if (NULL != rc->task) - GNUNET_SCHEDULER_cancel(rc->task); - rc->task = GNUNET_SCHEDULER_add_now(&context_task, rc); + GNUNET_SCHEDULER_cancel (rc->task); + rc->task = GNUNET_SCHEDULER_add_now (&context_task, rc); } /* end of curl_reschedule.c */ -- cgit v1.2.3