aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-08 02:20:37 -0800
committerJunio C Hamano <gitster@pobox.com>2008-03-08 02:20:37 -0800
commit972b9a85301e1576c0fb84555396015663a65452 (patch)
tree0498355725403517d839f7400803d26e4527806d /http.c
parent1f1300b4f16591feaa1387e967752af33d4fffda (diff)
parent9fc6440d783ca773353880aa97c23ed9c640d3c0 (diff)
downloadgit-972b9a85301e1576c0fb84555396015663a65452.tar.gz
git-972b9a85301e1576c0fb84555396015663a65452.tar.xz
Merge branch 'mh/maint-http-proxy-fix' into maint
* mh/maint-http-proxy-fix: Set proxy override with http_init()
Diffstat (limited to 'http.c')
-rw-r--r--http.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/http.c b/http.c
index c7deccb6d..256a5f15f 100644
--- a/http.c
+++ b/http.c
@@ -218,13 +218,16 @@ static CURL* get_curl_handle(void)
return result;
}
-void http_init(void)
+void http_init(struct remote *remote)
{
char *low_speed_limit;
char *low_speed_time;
curl_global_init(CURL_GLOBAL_ALL);
+ if (remote && remote->http_proxy)
+ curl_http_proxy = xstrdup(remote->http_proxy);
+
pragma_header = curl_slist_append(pragma_header, "Pragma: no-cache");
#ifdef USE_CURL_MULTI
@@ -306,6 +309,11 @@ void http_cleanup(void)
curl_slist_free_all(pragma_header);
pragma_header = NULL;
+
+ if (curl_http_proxy) {
+ free(curl_http_proxy);
+ curl_http_proxy = NULL;
+ }
}
struct active_request_slot *get_active_slot(void)