summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2009-06-06 08:43:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-06-06 17:56:27 (GMT)
commite917674597cc0b345ad2d6e29fd1a03e1039615a (patch)
tree26e4286aff1bf9b6364e56d21314dde48f45b56d /http.c
parentdf005219dd4a4c7c310c1e1ab5946f9ba69cc82d (diff)
downloadgit-e917674597cc0b345ad2d6e29fd1a03e1039615a.zip
git-e917674597cc0b345ad2d6e29fd1a03e1039615a.tar.gz
git-e917674597cc0b345ad2d6e29fd1a03e1039615a.tar.bz2
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 <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
-rw-r--r--http.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/http.c b/http.c
index 2e3d649..3ca60bb 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;