From e917674597cc0b345ad2d6e29fd1a03e1039615a Mon Sep 17 00:00:00 2001 From: Tay Ray Chuan Date: Sat, 6 Jun 2009 16:43:41 +0800 Subject: http*: move common variables and macros to http.[ch] Move RANGE_HEADER_SIZE to http.h. Create no_pragma_header, the curl header list containing the header "Pragma:" in http.[ch]. It is allocated in http_init, and freed in http_cleanup. This replaces the no_pragma_header in http-push.c, and the no_pragma_header member in walker_data in http-walker.c. Create http_is_verbose. It is to be used by methods in http.c, and is modified at the entry points of http.c's users, namely http-push.c (when parsing options) and http-walker.c (in get_http_walker). Signed-off-by: Tay Ray Chuan Signed-off-by: Junio C Hamano --- http.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'http.c') diff --git a/http.c b/http.c index 2e3d6493ef..3ca60bb8f9 100644 --- a/http.c +++ b/http.c @@ -2,6 +2,7 @@ int data_received; int active_requests; +int http_is_verbose; #ifdef USE_CURL_MULTI static int max_requests = -1; @@ -29,6 +30,8 @@ static char *user_name, *user_pass; static struct curl_slist *pragma_header; +struct curl_slist *no_pragma_header; + static struct active_request_slot *active_queue_head; size_t fread_buffer(void *ptr, size_t eltsize, size_t nmemb, void *buffer_) @@ -276,6 +279,8 @@ void http_init(struct remote *remote) char *low_speed_limit; char *low_speed_time; + http_is_verbose = 0; + git_config(http_options, NULL); curl_global_init(CURL_GLOBAL_ALL); @@ -284,6 +289,7 @@ void http_init(struct remote *remote) curl_http_proxy = xstrdup(remote->http_proxy); pragma_header = curl_slist_append(pragma_header, "Pragma: no-cache"); + no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:"); #ifdef USE_CURL_MULTI { @@ -366,6 +372,9 @@ void http_cleanup(void) curl_slist_free_all(pragma_header); pragma_header = NULL; + curl_slist_free_all(no_pragma_header); + no_pragma_header = NULL; + if (curl_http_proxy) { free((void *)curl_http_proxy); curl_http_proxy = NULL; -- cgit v1.2.3