X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=http.c;h=256a5f15f40a8d9389560e1fb08e34a56e9f7140;hb=5d921e2931e5041884d8f86fdccc9004a7b071cc;hp=c7deccb6de6a8a57a2fb57734f05d6ffdc6ae9dc;hpb=ca2c19503cdd5a603024665bee8e9e8533431c9a;p=git.git 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)