/**
* Task that runs the context's event loop with the GNUnet scheduler.
*
- * @param cls the `struct GNUNET_CURL_RescheduleContext`
+ * @param cls a `struct GNUNET_CURL_RescheduleContext *`
*/
static void
context_task (void *cls)
GNUNET_NETWORK_fdset_copy_native (ws,
&write_fd_set,
max_fd + 1);
- rc->task = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
- delay,
- rs,
- ws,
- &context_task,
- rc);
+ 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);
}
* Note that you MUST immediately destroy the reschedule context after
* calling #GNUNET_CURL_fini().
*
- * @param cls must point to a `struct GNUNET_CURL_RescheduleContext`
+ * @param cls must point to a `struct GNUNET_CURL_RescheduleContext *`
+ * (pointer to a pointer!)
*/
void
GNUNET_CURL_gnunet_scheduler_reschedule (void *cls)
{
- struct GNUNET_CURL_RescheduleContext *rc = cls;
+ struct GNUNET_CURL_RescheduleContext *rc = *(void**) cls;
if (NULL != rc->task)
GNUNET_SCHEDULER_cancel (rc->task);