http*: move common variables and macros to http.[ch]
[gitweb.git] / http.c
diff --git a/http.c b/http.c
index 2e3d6493ef40e1b34fea8d166d760f0b1fcccafc..3ca60bb8f9f0e42966047205782c71ccb98a0cdb 100644 (file)
--- 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;