102 if (NULL != rc->
task)
121 fd_set except_fd_set;
130 FD_ZERO (&read_fd_set);
131 FD_ZERO (&write_fd_set);
132 FD_ZERO (&except_fd_set);
153 if (NULL == rc->
task)
170 if (NULL != rc->
task)
void * GNUNET_CURL_download_get_result_(struct GNUNET_CURL_DownloadBuffer *db, CURL *eh, long *response_code)
static void clean_result(void *response)
Just a wrapper to avoid casting of function pointers.
static void context_task(void *cls)
Task that runs the context's event loop with the GNUnet scheduler.
static struct GNUNET_TIME_Relative timeout
User defined timestamp for completing operations.
static struct MHD_Response * response
Our canonical response.
static struct GNUNET_FS_Handle * ctx
static char * rp
Relying party.
library to make it easy to download JSON replies over HTTP
void GNUNET_CURL_gnunet_scheduler_reschedule(void *cls)
Implementation of the GNUNET_CURL_RescheduleCallback for GNUnet's scheduler.
struct GNUNET_CURL_RescheduleContext * GNUNET_CURL_gnunet_rc_create_with_parser(struct GNUNET_CURL_Context *ctx, GNUNET_CURL_RawParser rp, GNUNET_CURL_ResponseCleaner rc)
Initialize reschedule context; with custom response parser.
void GNUNET_CURL_get_select_info(struct GNUNET_CURL_Context *ctx, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *except_fd_set, int *max_fd, long *timeout)
Obtain the information for a select() call to wait until GNUNET_CURL_perform() is ready again.
void(* GNUNET_CURL_ResponseCleaner)(void *response)
Deallocate the response.
struct GNUNET_CURL_RescheduleContext * GNUNET_CURL_gnunet_rc_create(struct GNUNET_CURL_Context *ctx)
Initialize reschedule context.
void GNUNET_CURL_perform2(struct GNUNET_CURL_Context *ctx, GNUNET_CURL_RawParser rp, GNUNET_CURL_ResponseCleaner rc)
Run the main event loop for the HTTP interaction.
void *(* GNUNET_CURL_RawParser)(struct GNUNET_CURL_DownloadBuffer *db, CURL *eh, long *response_code)
Parses the raw response we got from the Web server.
void GNUNET_CURL_gnunet_rc_destroy(struct GNUNET_CURL_RescheduleContext *rc)
Destroy reschedule context.
@ GNUNET_SCHEDULER_PRIORITY_DEFAULT
Run with the default priority (normal P2P operations).
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_NETWORK_fdset_destroy(struct GNUNET_NETWORK_FDSet *fds)
Releases the associated memory of an fd set.
void GNUNET_NETWORK_fdset_copy_native(struct GNUNET_NETWORK_FDSet *to, const fd_set *from, int nfds)
Copy a native fd set into the GNUnet representation.
struct GNUNET_NETWORK_FDSet * GNUNET_NETWORK_fdset_create(void)
Creates an fd set.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_select(enum GNUNET_SCHEDULER_Priority prio, struct GNUNET_TIME_Relative delay, const struct GNUNET_NETWORK_FDSet *rs, const struct GNUNET_NETWORK_FDSet *ws, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay or when any of the specified file descriptor set...
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
#define GNUNET_TIME_UNIT_MILLISECONDS
One millisecond.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
Closure for GNUNET_CURL_gnunet_scheduler_reschedule().
struct GNUNET_SCHEDULER_Task * task
Just the task.
GNUNET_CURL_RawParser parser
Parser of the raw response.
struct GNUNET_CURL_Context * ctx
Context we manage.
GNUNET_CURL_ResponseCleaner cleaner
Deallocate the response object.
collection of IO descriptors
Entry in list of pending tasks.
Time for relative time used by GNUnet, in microseconds.