diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-08-10 20:58:08 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-08-10 20:58:24 +0200 |
commit | e9023bbcf93e35bee6e14c9d32b7ac223dcdd48f (patch) | |
tree | 10a6f81ab36d6fb5b4fe39076a15840ca8e93fd4 /src/curl | |
parent | 4fd0ca3f103310e74066fce93e569b386dd14662 (diff) | |
download | gnunet-e9023bbcf93e35bee6e14c9d32b7ac223dcdd48f.tar.gz gnunet-e9023bbcf93e35bee6e14c9d32b7ac223dcdd48f.zip |
-style fixes
Diffstat (limited to 'src/curl')
-rw-r--r-- | src/curl/curl_reschedule.c | 40 |
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 | */ | ||
68 | struct GNUNET_CURL_RescheduleContext * | 62 | struct GNUNET_CURL_RescheduleContext * |
69 | GNUNET_CURL_gnunet_rc_create_with_parser (struct GNUNET_CURL_Context *ctx, | 63 | GNUNET_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 | */ | ||
102 | struct GNUNET_CURL_RescheduleContext * | 90 | struct GNUNET_CURL_RescheduleContext * |
103 | GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx) | 91 | GNUNET_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 | */ | ||
120 | void | 103 | void |
121 | GNUNET_CURL_gnunet_rc_destroy (struct GNUNET_CURL_RescheduleContext *rc) | 104 | GNUNET_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 | */ | ||
190 | void | 169 | void |
191 | GNUNET_CURL_gnunet_scheduler_reschedule (void *cls) | 170 | GNUNET_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 | ||