WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit f6b0f0c

Browse files
committed
curl: pass long values where expected
Repeat after me: `int` is not the same as `long`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 2b65033 commit f6b0f0c

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

http-push.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static char *xml_entities(const char *s)
195195
static void curl_setup_http_get(CURL *curl, const char *url,
196196
const char *custom_req)
197197
{
198-
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1);
198+
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1l);
199199
curl_easy_setopt(curl, CURLOPT_URL, url);
200200
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, custom_req);
201201
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite_null);
@@ -205,17 +205,17 @@ static void curl_setup_http(CURL *curl, const char *url,
205205
const char *custom_req, struct buffer *buffer,
206206
curl_write_callback write_fn)
207207
{
208-
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
208+
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1l);
209209
curl_easy_setopt(curl, CURLOPT_URL, url);
210210
curl_easy_setopt(curl, CURLOPT_INFILE, buffer);
211211
curl_easy_setopt(curl, CURLOPT_INFILESIZE, buffer->buf.len);
212212
curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
213213
curl_easy_setopt(curl, CURLOPT_SEEKFUNCTION, seek_buffer);
214214
curl_easy_setopt(curl, CURLOPT_SEEKDATA, buffer);
215215
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_fn);
216-
curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
216+
curl_easy_setopt(curl, CURLOPT_NOBODY, 0l);
217217
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, custom_req);
218-
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
218+
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1l);
219219
}
220220

221221
static struct curl_slist *get_dav_token_headers(struct remote_lock *lock, enum dav_header_flag options)

imap-send.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)
14201420

14211421
curl_easy_setopt(curl, CURLOPT_URL, path.buf);
14221422
strbuf_release(&path);
1423-
curl_easy_setopt(curl, CURLOPT_PORT, srvc->port);
1423+
curl_easy_setopt(curl, CURLOPT_PORT, (long)srvc->port);
14241424

14251425
if (srvc->auth_method) {
14261426
struct strbuf auth = STRBUF_INIT;
@@ -1433,8 +1433,8 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)
14331433
if (!srvc->use_ssl)
14341434
curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_TRY);
14351435

1436-
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, srvc->ssl_verify);
1437-
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, srvc->ssl_verify);
1436+
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, (long)srvc->ssl_verify);
1437+
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, (long)srvc->ssl_verify);
14381438

14391439
curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
14401440

remote-curl.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -877,12 +877,12 @@ static int probe_rpc(struct rpc_state *rpc, struct slot_results *results)
877877
headers = curl_slist_append(headers, rpc->hdr_content_type);
878878
headers = curl_slist_append(headers, rpc->hdr_accept);
879879

880-
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
881-
curl_easy_setopt(slot->curl, CURLOPT_POST, 1);
880+
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0l);
881+
curl_easy_setopt(slot->curl, CURLOPT_POST, 1l);
882882
curl_easy_setopt(slot->curl, CURLOPT_URL, rpc->service_url);
883883
curl_easy_setopt(slot->curl, CURLOPT_ENCODING, NULL);
884884
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, "0000");
885-
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, 4);
885+
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, 4l);
886886
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers);
887887
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
888888
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &buf);
@@ -970,8 +970,8 @@ static int post_rpc(struct rpc_state *rpc, int stateless_connect, int flush_rece
970970

971971
slot = get_active_slot();
972972

973-
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
974-
curl_easy_setopt(slot->curl, CURLOPT_POST, 1);
973+
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0l);
974+
curl_easy_setopt(slot->curl, CURLOPT_POST, 1l);
975975
curl_easy_setopt(slot->curl, CURLOPT_URL, rpc->service_url);
976976
curl_easy_setopt(slot->curl, CURLOPT_ENCODING, "");
977977

@@ -1058,7 +1058,7 @@ static int post_rpc(struct rpc_state *rpc, int stateless_connect, int flush_rece
10581058
rpc_in_data.check_pktline = stateless_connect;
10591059
memset(&rpc_in_data.pktline_state, 0, sizeof(rpc_in_data.pktline_state));
10601060
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &rpc_in_data);
1061-
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0);
1061+
curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0l);
10621062

10631063

10641064
rpc->any_written = 0;

0 commit comments

Comments
 (0)