9 #if LIBCURL_VERSION_NUM >= 0x071000
10 #define USE_CURL_MULTI
11 #define DEFAULT_MAX_REQUESTS 5
14 #if LIBCURL_VERSION_NUM < 0x070704
15 #define curl_global_cleanup() do { /* nothing */ } while(0)
17 #if LIBCURL_VERSION_NUM < 0x070800
18 #define curl_global_init(a) do { /* nothing */ } while(0)
21 #if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000)
22 #define NO_CURL_EASY_DUPHANDLE
25 #if LIBCURL_VERSION_NUM < 0x070a03
26 #define CURLE_HTTP_RETURNED_ERROR CURLE_HTTP_NOT_FOUND
35 struct active_request_slot
43 struct slot_results
*results
;
45 void (*callback_func
)(void *data
);
46 struct active_request_slot
*next
;
56 /* Curl request read/write callbacks */
57 extern size_t fread_buffer(void *ptr
, size_t eltsize
, size_t nmemb
,
58 struct buffer
*buffer
);
59 extern size_t fwrite_buffer(const void *ptr
, size_t eltsize
,
60 size_t nmemb
, struct buffer
*buffer
);
61 extern size_t fwrite_null(const void *ptr
, size_t eltsize
,
62 size_t nmemb
, struct buffer
*buffer
);
64 /* Slot lifecycle functions */
65 extern struct active_request_slot
*get_active_slot(void);
66 extern int start_active_slot(struct active_request_slot
*slot
);
67 extern void run_active_slot(struct active_request_slot
*slot
);
68 extern void finish_all_active_slots(void);
69 extern void release_active_slot(struct active_request_slot
*slot
);
72 extern void fill_active_slots(void);
73 extern void add_fill_function(void *data
, int (*fill
)(void *));
74 extern void step_active_slots(void);
77 extern void http_init(void);
78 extern void http_cleanup(void);
80 extern int data_received
;
81 extern int active_requests
;
83 extern char curl_errorstr
[CURL_ERROR_SIZE
];