diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-12-14 18:12:04 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-12-14 18:12:04 +0000 |
commit | 4cebadb72b620b901288dfaa49459aa3349cc5e1 (patch) | |
tree | 64cdbb42d2814acecaa673236c5e0c2a886e4103 /src/nat | |
parent | 204e0a6b3e746dafb2812b7e6bdde2f068d1c9ec (diff) | |
download | gnunet-4cebadb72b620b901288dfaa49459aa3349cc5e1.tar.gz gnunet-4cebadb72b620b901288dfaa49459aa3349cc5e1.zip |
fix cast
Diffstat (limited to 'src/nat')
-rw-r--r-- | src/nat/upnp-discover.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/nat/upnp-discover.c b/src/nat/upnp-discover.c index cb1855ccd..b42df5ff2 100644 --- a/src/nat/upnp-discover.c +++ b/src/nat/upnp-discover.c | |||
@@ -182,7 +182,7 @@ callback_download (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
182 | } | 182 | } |
183 | 183 | ||
184 | static void | 184 | static void |
185 | task_download (struct download_cls *cls, | 185 | task_download (void *cls, |
186 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 186 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
187 | 187 | ||
188 | /** | 188 | /** |
@@ -243,7 +243,7 @@ download_prepare (struct download_cls *cls) | |||
243 | rtime, | 243 | rtime, |
244 | grs, | 244 | grs, |
245 | gws, | 245 | gws, |
246 | (GNUNET_SCHEDULER_Task) & task_download, cls); | 246 | & task_download, cls); |
247 | GNUNET_NETWORK_fdset_destroy (gws); | 247 | GNUNET_NETWORK_fdset_destroy (gws); |
248 | GNUNET_NETWORK_fdset_destroy (grs); | 248 | GNUNET_NETWORK_fdset_destroy (grs); |
249 | } | 249 | } |
@@ -255,10 +255,10 @@ download_prepare (struct download_cls *cls) | |||
255 | * @param tc task context | 255 | * @param tc task context |
256 | */ | 256 | */ |
257 | static void | 257 | static void |
258 | task_download (struct download_cls *cls, | 258 | task_download (void *cls, |
259 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 259 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
260 | { | 260 | { |
261 | 261 | struct download_cls *dc = cls; | |
262 | int running; | 262 | int running; |
263 | struct CURLMsg *msg; | 263 | struct CURLMsg *msg; |
264 | CURLMcode mret; | 264 | CURLMcode mret; |
@@ -268,33 +268,33 @@ task_download (struct download_cls *cls, | |||
268 | #if DEBUG_UPNP | 268 | #if DEBUG_UPNP |
269 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "UPnP", | 269 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "UPnP", |
270 | "Shutdown requested while trying to download device description from `%s'\n", | 270 | "Shutdown requested while trying to download device description from `%s'\n", |
271 | cls->url); | 271 | dc->url); |
272 | #endif | 272 | #endif |
273 | cls->caller_cb (NULL, cls->caller_cls); | 273 | dc->caller_cb (NULL, dc->caller_cls); |
274 | download_clean_up (cls); | 274 | download_clean_up (dc); |
275 | return; | 275 | return; |
276 | } | 276 | } |
277 | if (GNUNET_TIME_absolute_get_remaining (cls->end_time).rel_value == 0) | 277 | if (GNUNET_TIME_absolute_get_remaining (dc->end_time).rel_value == 0) |
278 | { | 278 | { |
279 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "UPnP", | 279 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "UPnP", |
280 | _ | 280 | _ |
281 | ("Timeout trying to download UPnP device description from '%s'\n"), | 281 | ("Timeout trying to download UPnP device description from '%s'\n"), |
282 | cls->url); | 282 | dc->url); |
283 | cls->caller_cb (NULL, cls->caller_cls); | 283 | dc->caller_cb (NULL, dc->caller_cls); |
284 | download_clean_up (cls); | 284 | download_clean_up (dc); |
285 | return; | 285 | return; |
286 | } | 286 | } |
287 | 287 | ||
288 | do | 288 | do |
289 | { | 289 | { |
290 | running = 0; | 290 | running = 0; |
291 | mret = curl_multi_perform (cls->multi, &running); | 291 | mret = curl_multi_perform (dc->multi, &running); |
292 | 292 | ||
293 | if (running == 0) | 293 | if (running == 0) |
294 | { | 294 | { |
295 | do | 295 | do |
296 | { | 296 | { |
297 | msg = curl_multi_info_read (cls->multi, &running); | 297 | msg = curl_multi_info_read (dc->multi, &running); |
298 | GNUNET_break (msg != NULL); | 298 | GNUNET_break (msg != NULL); |
299 | if (msg == NULL) | 299 | if (msg == NULL) |
300 | break; | 300 | break; |
@@ -305,23 +305,23 @@ task_download (struct download_cls *cls, | |||
305 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 305 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
306 | _("%s failed for `%s' at %s:%d: `%s'\n"), | 306 | _("%s failed for `%s' at %s:%d: `%s'\n"), |
307 | "curl_multi_perform", | 307 | "curl_multi_perform", |
308 | cls->url, | 308 | dc->url, |
309 | __FILE__, | 309 | __FILE__, |
310 | __LINE__, | 310 | __LINE__, |
311 | curl_easy_strerror (msg->data.result)); | 311 | curl_easy_strerror (msg->data.result)); |
312 | cls->caller_cb (NULL, cls->caller_cls); | 312 | dc->caller_cb (NULL, dc->caller_cls); |
313 | } | 313 | } |
314 | else | 314 | else |
315 | { | 315 | { |
316 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "UPnP", | 316 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "UPnP", |
317 | _ | 317 | _ |
318 | ("Download of device description `%s' completed.\n"), | 318 | ("Download of device description `%s' completed.\n"), |
319 | cls->url); | 319 | dc->url); |
320 | cls->caller_cb (GNUNET_strdup (cls->download_buffer), | 320 | dc->caller_cb (GNUNET_strdup (dc->download_buffer), |
321 | cls->caller_cls); | 321 | dc->caller_cls); |
322 | } | 322 | } |
323 | 323 | ||
324 | download_clean_up (cls); | 324 | download_clean_up (dc); |
325 | return; | 325 | return; |
326 | } | 326 | } |
327 | while ((running > 0)); | 327 | while ((running > 0)); |
@@ -335,11 +335,11 @@ task_download (struct download_cls *cls, | |||
335 | _("%s failed at %s:%d: `%s'\n"), | 335 | _("%s failed at %s:%d: `%s'\n"), |
336 | "curl_multi_perform", __FILE__, __LINE__, | 336 | "curl_multi_perform", __FILE__, __LINE__, |
337 | curl_multi_strerror (mret)); | 337 | curl_multi_strerror (mret)); |
338 | download_clean_up (cls); | 338 | download_clean_up (dc); |
339 | cls->caller_cb (NULL, cls->caller_cls); | 339 | dc->caller_cb (NULL, dc->caller_cls); |
340 | } | 340 | } |
341 | 341 | ||
342 | download_prepare (cls); | 342 | download_prepare (dc); |
343 | } | 343 | } |
344 | 344 | ||
345 | 345 | ||