X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=http.h;h=72abac20f856b45c873cc370f23c7df08b650370;hb=84ef033832af9e0be886214c70b2006b08630072;hp=ed4ea3340e48307e087a311136d1fe4f74b2d607;hpb=302ebfe52192fff9a2c1c612dff22325fd073acc;p=git.git diff --git a/http.h b/http.h index ed4ea3340..72abac20f 100644 --- a/http.h +++ b/http.h @@ -6,7 +6,7 @@ #include #include -#if LIBCURL_VERSION_NUM >= 0x070908 +#if LIBCURL_VERSION_NUM >= 0x071000 #define USE_CURL_MULTI #define DEFAULT_MAX_REQUESTS 5 #endif @@ -18,10 +18,20 @@ #define curl_global_init(a) do { /* nothing */ } while(0) #endif -#if LIBCURL_VERSION_NUM < 0x070c04 +#if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000) #define NO_CURL_EASY_DUPHANDLE #endif +#if LIBCURL_VERSION_NUM < 0x070a03 +#define CURLE_HTTP_RETURNED_ERROR CURLE_HTTP_NOT_FOUND +#endif + +struct slot_results +{ + CURLcode curl_result; + long http_code; +}; + struct active_request_slot { CURL *curl; @@ -29,6 +39,8 @@ struct active_request_slot int in_use; CURLcode curl_result; long http_code; + int *finished; + struct slot_results *results; void *callback_data; void (*callback_func)(void *data); struct active_request_slot *next; @@ -54,9 +66,11 @@ extern struct active_request_slot *get_active_slot(void); extern int start_active_slot(struct active_request_slot *slot); extern void run_active_slot(struct active_request_slot *slot); extern void finish_all_active_slots(void); +extern void release_active_slot(struct active_request_slot *slot); #ifdef USE_CURL_MULTI extern void fill_active_slots(void); +extern void add_fill_function(void *data, int (*fill)(void *)); extern void step_active_slots(void); #endif @@ -66,10 +80,6 @@ extern void http_cleanup(void); extern int data_received; extern int active_requests; -#ifdef USE_CURL_MULTI -extern int max_requests; -extern CURLM *curlm; -#endif #ifndef NO_CURL_EASY_DUPHANDLE extern CURL *curl_default; #endif @@ -90,6 +100,4 @@ extern long curl_low_speed_time; extern struct curl_slist *pragma_header; extern struct curl_slist *no_range_header; -extern struct active_request_slot *active_queue_head; - #endif /* HTTP_H */