1
1
diff --git a/http.c b/http.c
2
- index d5396a3ce2..2cfb042e53 100644
2
+ index bf6889a30c..f7e2a585ff 100644
3
3
--- a/http.c
4
4
+++ b/http.c
5
5
@@ -64,7 +64,7 @@ static char *ssl_key_type;
@@ -11,7 +11,7 @@ index d5396a3ce2..2cfb042e53 100644
11
11
static long curl_low_speed_limit = -1;
12
12
static long curl_low_speed_time = -1;
13
13
static int curl_ftp_no_epsv;
14
- @@ -419 ,11 +419 ,13 @@ static int http_options(const char *var, const char *value,
14
+ @@ -423 ,11 +423 ,13 @@ static int http_options(const char *var, const char *value,
15
15
curl_ssl_try = git_config_bool(var, value);
16
16
return 0;
17
17
}
@@ -25,78 +25,7 @@ index d5396a3ce2..2cfb042e53 100644
25
25
26
26
if (!strcmp("http.schannelcheckrevoke", var)) {
27
27
if (value && !strcmp(value, "best-effort")) {
28
- @@ -731,7 +733,7 @@ static int has_proxy_cert_password(void)
29
-
30
- static void set_curl_keepalive(CURL *c)
31
- {
32
- - curl_easy_setopt(c, CURLOPT_TCP_KEEPALIVE, 1);
33
- + curl_easy_setopt(c, CURLOPT_TCP_KEEPALIVE, 1L);
34
- }
35
-
36
- /* Return 1 if redactions have been made, 0 otherwise. */
37
- @@ -1032,13 +1034,13 @@ static CURL *get_curl_handle(void)
38
- die("curl_easy_init failed");
39
-
40
- if (!curl_ssl_verify) {
41
- - curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0);
42
- - curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 0);
43
- + curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0L);
44
- + curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 0L);
45
- } else {
46
- /* Verify authenticity of the peer's certificate */
47
- - curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 1);
48
- + curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 1L);
49
- /* The name in the cert must match whom we tried to connect */
50
- - curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 2);
51
- + curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 2L);
52
- }
53
-
54
- if (curl_http_version) {
55
- @@ -1141,8 +1143,8 @@ static CURL *get_curl_handle(void)
56
- curl_low_speed_time);
57
- }
58
-
59
- - curl_easy_setopt(result, CURLOPT_MAXREDIRS, 20);
60
- - curl_easy_setopt(result, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
61
- + curl_easy_setopt(result, CURLOPT_MAXREDIRS, 20L);
62
- + curl_easy_setopt(result, CURLOPT_POSTREDIR, (long)CURL_REDIR_POST_ALL);
63
-
64
- #ifdef GIT_CURL_HAVE_CURLOPT_PROTOCOLS_STR
65
- {
66
- @@ -1175,7 +1177,7 @@ static CURL *get_curl_handle(void)
67
- user_agent ? user_agent : git_user_agent());
68
-
69
- if (curl_ftp_no_epsv)
70
- - curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);
71
- + curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0L);
72
-
73
- if (curl_ssl_try)
74
- curl_easy_setopt(result, CURLOPT_USE_SSL, CURLUSESSL_TRY);
75
- @@ -1217,18 +1219,18 @@ static CURL *get_curl_handle(void)
76
-
77
- if (starts_with(curl_http_proxy, "socks5h"))
78
- curl_easy_setopt(result,
79
- - CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
80
- + CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS5_HOSTNAME);
81
- else if (starts_with(curl_http_proxy, "socks5"))
82
- curl_easy_setopt(result,
83
- - CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
84
- + CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS5);
85
- else if (starts_with(curl_http_proxy, "socks4a"))
86
- curl_easy_setopt(result,
87
- - CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
88
- + CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS4A);
89
- else if (starts_with(curl_http_proxy, "socks"))
90
- curl_easy_setopt(result,
91
- - CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
92
- + CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS4);
93
- else if (starts_with(curl_http_proxy, "https")) {
94
- - curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_HTTPS);
95
- + curl_easy_setopt(result, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTPS);
96
-
97
- if (http_proxy_ssl_cert)
98
- curl_easy_setopt(result, CURLOPT_PROXY_SSLCERT, http_proxy_ssl_cert);
99
- @@ -1337,9 +1339,6 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
28
+ @@ -1380,9 +1382,6 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
100
29
}
101
30
}
102
31
@@ -106,79 +35,11 @@ index d5396a3ce2..2cfb042e53 100644
106
35
if (proactive_auth && http_proactive_auth == PROACTIVE_AUTH_NONE)
107
36
http_proactive_auth = PROACTIVE_AUTH_IF_CREDENTIALS;
108
37
109
- @@ -1427 ,7 +1426 ,6 @@ void http_cleanup(void)
38
+ @@ -1470 ,7 +1469 ,6 @@ void http_cleanup(void)
110
39
curl_easy_cleanup(curl_default);
111
40
112
41
curl_multi_cleanup(curlm);
113
42
- curl_global_cleanup();
114
43
115
44
string_list_clear(&extra_http_headers, 0);
116
45
117
- @@ -1533,9 +1531,9 @@ struct active_request_slot *get_active_slot(void)
118
- curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, NULL);
119
- curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, NULL);
120
- curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, -1L);
121
- - curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0);
122
- - curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
123
- - curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 1);
124
- + curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0L);
125
- + curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1L);
126
- + curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 1L);
127
- curl_easy_setopt(slot->curl, CURLOPT_RANGE, NULL);
128
-
129
- /*
130
- @@ -1544,9 +1542,9 @@ struct active_request_slot *get_active_slot(void)
131
- * HTTP_FOLLOW_* cases themselves.
132
- */
133
- if (http_follow_config == HTTP_FOLLOW_ALWAYS)
134
- - curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 1);
135
- + curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 1L);
136
- else
137
- - curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 0);
138
- + curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 0L);
139
-
140
- curl_easy_setopt(slot->curl, CURLOPT_IPRESOLVE, git_curl_ipresolve);
141
- curl_easy_setopt(slot->curl, CURLOPT_HTTPAUTH, http_auth_methods);
142
- @@ -2113,12 +2111,12 @@ static int http_request(const char *url,
143
- int ret;
144
-
145
- slot = get_active_slot();
146
- - curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
147
- + curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1L);
148
-
149
- if (!result) {
150
- - curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1);
151
- + curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1L);
152
- } else {
153
- - curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
154
- + curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0L);
155
- curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, result);
156
-
157
- if (target == HTTP_REQUEST_FILE) {
158
- @@ -2144,7 +2142,7 @@ static int http_request(const char *url,
159
- strbuf_addstr(&buf, " no-cache");
160
- if (options && options->initial_request &&
161
- http_follow_config == HTTP_FOLLOW_INITIAL)
162
- - curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 1);
163
- + curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 1L);
164
-
165
- headers = curl_slist_append(headers, buf.buf);
166
-
167
- @@ -2163,7 +2161,7 @@ static int http_request(const char *url,
168
- curl_easy_setopt(slot->curl, CURLOPT_URL, url);
169
- curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers);
170
- curl_easy_setopt(slot->curl, CURLOPT_ENCODING, "");
171
- - curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0);
172
- + curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0L);
173
-
174
- ret = run_one_slot(slot, &results);
175
-
176
- @@ -2743,7 +2741,7 @@ struct http_object_request *new_http_object_request(const char *base_url,
177
- freq->headers = object_request_headers();
178
-
179
- curl_easy_setopt(freq->slot->curl, CURLOPT_WRITEDATA, freq);
180
- - curl_easy_setopt(freq->slot->curl, CURLOPT_FAILONERROR, 0);
181
- + curl_easy_setopt(freq->slot->curl, CURLOPT_FAILONERROR, 0L);
182
- curl_easy_setopt(freq->slot->curl, CURLOPT_WRITEFUNCTION, fwrite_sha1_file);
183
- curl_easy_setopt(freq->slot->curl, CURLOPT_ERRORBUFFER, freq->errorstr);
184
- curl_easy_setopt(freq->slot->curl, CURLOPT_URL, freq->url);
0 commit comments