aboutsummaryrefslogtreecommitdiff
path: root/src/curl
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-08-10 20:58:08 +0200
committerChristian Grothoff <christian@grothoff.org>2022-08-10 20:58:24 +0200
commite9023bbcf93e35bee6e14c9d32b7ac223dcdd48f (patch)
tree10a6f81ab36d6fb5b4fe39076a15840ca8e93fd4 /src/curl
parent4fd0ca3f103310e74066fce93e569b386dd14662 (diff)
downloadgnunet-e9023bbcf93e35bee6e14c9d32b7ac223dcdd48f.tar.gz
gnunet-e9023bbcf93e35bee6e14c9d32b7ac223dcdd48f.zip
-style fixes
Diffstat (limited to 'src/curl')
-rw-r--r--src/curl/curl_reschedule.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/src/curl/curl_reschedule.c b/src/curl/curl_reschedule.c
index a1fe55aa5..0c19bd171 100644
--- a/src/curl/curl_reschedule.c
+++ b/src/curl/curl_reschedule.c
@@ -59,12 +59,6 @@ struct GNUNET_CURL_RescheduleContext
59}; 59};
60 60
61 61
62/**
63 * Initialize reschedule context; with custom response parser
64 *
65 * @param ctx context to manage
66 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule().
67 */
68struct GNUNET_CURL_RescheduleContext * 62struct GNUNET_CURL_RescheduleContext *
69GNUNET_CURL_gnunet_rc_create_with_parser (struct GNUNET_CURL_Context *ctx, 63GNUNET_CURL_gnunet_rc_create_with_parser (struct GNUNET_CURL_Context *ctx,
70 GNUNET_CURL_RawParser rp, 64 GNUNET_CURL_RawParser rp,
@@ -93,12 +87,6 @@ clean_result (void *response)
93} 87}
94 88
95 89
96/**
97 * Initialize reschedule context.
98 *
99 * @param ctx context to manage
100 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule().
101 */
102struct GNUNET_CURL_RescheduleContext * 90struct GNUNET_CURL_RescheduleContext *
103GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx) 91GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx)
104{ 92{
@@ -112,11 +100,6 @@ GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx)
112} 100}
113 101
114 102
115/**
116 * Destroy reschedule context.
117 *
118 * @param rc context to destroy
119 */
120void 103void
121GNUNET_CURL_gnunet_rc_destroy (struct GNUNET_CURL_RescheduleContext *rc) 104GNUNET_CURL_gnunet_rc_destroy (struct GNUNET_CURL_RescheduleContext *rc)
122{ 105{
@@ -159,13 +142,18 @@ context_task (void *cls)
159 &timeout); 142 &timeout);
160 if (timeout >= 0) 143 if (timeout >= 0)
161 delay = 144 delay =
162 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, timeout); 145 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
146 timeout);
163 else 147 else
164 delay = GNUNET_TIME_UNIT_FOREVER_REL; 148 delay = GNUNET_TIME_UNIT_FOREVER_REL;
165 rs = GNUNET_NETWORK_fdset_create (); 149 rs = GNUNET_NETWORK_fdset_create ();
166 GNUNET_NETWORK_fdset_copy_native (rs, &read_fd_set, max_fd + 1); 150 GNUNET_NETWORK_fdset_copy_native (rs,
151 &read_fd_set,
152 max_fd + 1);
167 ws = GNUNET_NETWORK_fdset_create (); 153 ws = GNUNET_NETWORK_fdset_create ();
168 GNUNET_NETWORK_fdset_copy_native (ws, &write_fd_set, max_fd + 1); 154 GNUNET_NETWORK_fdset_copy_native (ws,
155 &write_fd_set,
156 max_fd + 1);
169 if (NULL == rc->task) 157 if (NULL == rc->task)
170 rc->task = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, 158 rc->task = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
171 delay, 159 delay,
@@ -178,15 +166,6 @@ context_task (void *cls)
178} 166}
179 167
180 168
181/**
182 * Implementation of the #GNUNET_CURL_RescheduleCallback for GNUnet's
183 * scheduler. Will run the CURL context using GNUnet's scheduler.
184 * Note that you MUST immediately destroy the reschedule context after
185 * calling #GNUNET_CURL_fini().
186 *
187 * @param cls must point to a `struct GNUNET_CURL_RescheduleContext *`
188 * (pointer to a pointer!)
189 */
190void 169void
191GNUNET_CURL_gnunet_scheduler_reschedule (void *cls) 170GNUNET_CURL_gnunet_scheduler_reschedule (void *cls)
192{ 171{
@@ -194,7 +173,8 @@ GNUNET_CURL_gnunet_scheduler_reschedule (void *cls)
194 173
195 if (NULL != rc->task) 174 if (NULL != rc->task)
196 GNUNET_SCHEDULER_cancel (rc->task); 175 GNUNET_SCHEDULER_cancel (rc->task);
197 rc->task = GNUNET_SCHEDULER_add_now (&context_task, rc); 176 rc->task = GNUNET_SCHEDULER_add_now (&context_task,
177 rc);
198} 178}
199 179
200 180