diff options
Diffstat (limited to 'http.h')
-rw-r--r-- | http.h | 30 |
1 files changed, 12 insertions, 18 deletions
@@ -42,16 +42,13 @@ #define NO_CURL_IOCTL #endif -struct slot_results -{ +struct slot_results { CURLcode curl_result; long http_code; }; -struct active_request_slot -{ +struct active_request_slot { CURL *curl; - FILE *local; int in_use; CURLcode curl_result; long http_code; @@ -62,16 +59,15 @@ struct active_request_slot struct active_request_slot *next; }; -struct buffer -{ +struct buffer { struct strbuf buf; size_t posn; }; /* Curl request read/write callbacks */ -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); +extern size_t fread_buffer(char *ptr, size_t eltsize, size_t nmemb, void *strbuf); +extern size_t fwrite_buffer(char *ptr, size_t eltsize, size_t nmemb, void *strbuf); +extern size_t fwrite_null(char *ptr, size_t eltsize, size_t nmemb, void *strbuf); #ifndef NO_CURL_IOCTL extern curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp); #endif @@ -89,10 +85,10 @@ extern void add_fill_function(void *data, int (*fill)(void *)); extern void step_active_slots(void); #endif -extern void http_init(struct remote *remote); +extern void http_init(struct remote *remote, const char *url, + int proactive_auth); extern void http_cleanup(void); -extern int data_received; extern int active_requests; extern int http_is_verbose; extern size_t http_post_buffer; @@ -131,7 +127,7 @@ extern char *get_remote_object_url(const char *url, const char *hex, #define HTTP_NOAUTH 5 /* - * Requests an url and stores the result in a strbuf. + * Requests a URL and stores the result in a strbuf. * * If the result pointer is NULL, a HTTP HEAD request is made instead of GET. */ @@ -149,8 +145,7 @@ extern int http_fetch_ref(const char *base, struct ref *ref); extern int http_get_info_packs(const char *base_url, struct packed_git **packs_head); -struct http_pack_request -{ +struct http_pack_request { char *url; struct packed_git *target; struct packed_git **lst; @@ -166,8 +161,7 @@ extern int finish_http_pack_request(struct http_pack_request *preq); extern void release_http_pack_request(struct http_pack_request *preq); /* Helpers for fetching object */ -struct http_object_request -{ +struct http_object_request { char *url; char tmpfile[PATH_MAX]; int localfile; @@ -177,7 +171,7 @@ struct http_object_request unsigned char sha1[20]; unsigned char real_sha1[20]; git_SHA_CTX c; - z_stream stream; + git_zstream stream; int zret; int rename; struct active_request_slot *slot; |