index 1528d4196fe91a62efedcc2f7664c27e1f3fac6c..905b4629a47789705c13745fd56ce0c91adea41b 100644 (file)
--- a/http.h
+++ b/http.h
#include <curl/easy.h>
#include "strbuf.h"
#include <curl/easy.h>
#include "strbuf.h"
+#include "remote.h"
+
+/*
+ * We detect based on the cURL version if multi-transfer is
+ * usable in this implementation and define this symbol accordingly.
+ * This is not something Makefile should set nor users should pass
+ * via CFLAGS.
+ */
+#undef USE_CURL_MULTI
#if LIBCURL_VERSION_NUM >= 0x071000
#define USE_CURL_MULTI
#if LIBCURL_VERSION_NUM >= 0x071000
#define USE_CURL_MULTI
};
/* Curl request read/write callbacks */
};
/* Curl request read/write callbacks */
-extern size_t fread_buffer(void *ptr, size_t eltsize, size_t nmemb,
- struct buffer *buffer);
-extern size_t fwrite_buffer(const void *ptr, size_t eltsize,
- size_t nmemb, struct strbuf *buffer);
-extern size_t fwrite_null(const void *ptr, size_t eltsize,
- size_t nmemb, struct strbuf *buffer);
+extern size_t fread_buffer(void *ptr, size_t eltsize, size_t nmemb, void *strbuf);
+extern size_t fwrite_buffer(const void *ptr, size_t eltsize, size_t nmemb, void *strbuf);
+extern size_t fwrite_null(const void *ptr, size_t eltsize, size_t nmemb, void *strbuf);
/* Slot lifecycle functions */
extern struct active_request_slot *get_active_slot(void);
/* Slot lifecycle functions */
extern struct active_request_slot *get_active_slot(void);
extern void step_active_slots(void);
#endif
extern void step_active_slots(void);
#endif
-extern void http_init(void);
+extern void http_init(struct remote *remote);
extern void http_cleanup(void);
extern int data_received;
extern void http_cleanup(void);
extern int data_received;
#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)
#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)
+extern int http_fetch_ref(const char *base, struct ref *ref);
+
#endif /* HTTP_H */
#endif /* HTTP_H */