Use strbuf in http code

Also, replace whitespaces with tabs in some places

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Mike Hommey
2007-12-09 20:30:59 +01:00
committed by Junio C Hamano
parent e8dc37e0e3
commit 028c297638
5 changed files with 108 additions and 201 deletions

11
http.h
View File

@ -6,6 +6,8 @@
#include <curl/curl.h>
#include <curl/easy.h>
#include "strbuf.h"
#if LIBCURL_VERSION_NUM >= 0x071000
#define USE_CURL_MULTI
#define DEFAULT_MAX_REQUESTS 5
@ -48,18 +50,17 @@ struct active_request_slot
struct buffer
{
size_t posn;
size_t size;
void *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,
struct buffer *buffer);
extern size_t fwrite_buffer(const void *ptr, size_t eltsize,
size_t nmemb, struct buffer *buffer);
size_t nmemb, struct strbuf *buffer);
extern size_t fwrite_null(const void *ptr, size_t eltsize,
size_t nmemb, struct buffer *buffer);
size_t nmemb, struct strbuf *buffer);
/* Slot lifecycle functions */
extern struct active_request_slot *get_active_slot(void);