mirror of
https://github.com/curl/curl.git
synced 2026-08-25 07:23:31 +03:00
CURLOPT: drop redundant long casts
Also: - CURLOPT_HSTS_CTRL.md: sync macro definitions with `curl/curl.h`. Perhaps it'd be better to delete copies like this? - keep existing casts within the documentation to make sure it applies to older curl versions as well. - CURLOPT_IPRESOLVE.md: re-add a long cast to man page, for consistency with the above. Closes #17791
This commit is contained in:
parent
fc98a630cf
commit
5debe7cb34
32 changed files with 43 additions and 46 deletions
|
|
@ -129,7 +129,7 @@ static int setup_hx_download(CURL *hnd, const char *url, struct transfer_d *t,
|
|||
curl_easy_setopt(hnd, CURLOPT_XFERINFOFUNCTION, my_progress_d_cb);
|
||||
curl_easy_setopt(hnd, CURLOPT_XFERINFODATA, t);
|
||||
if(use_earlydata)
|
||||
curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_EARLYDATA);
|
||||
curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, CURLSSLOPT_EARLYDATA);
|
||||
if(forbid_reuse_d)
|
||||
curl_easy_setopt(hnd, CURLOPT_FORBID_REUSE, 1L);
|
||||
if(host)
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ static int setup_hx_upload(CURL *hnd, const char *url, struct transfer_u *t,
|
|||
curl_easy_setopt(hnd, CURLOPT_WRITEFUNCTION, my_write_u_cb);
|
||||
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, t);
|
||||
if(use_earlydata)
|
||||
curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_EARLYDATA);
|
||||
curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, CURLSSLOPT_EARLYDATA);
|
||||
|
||||
if(!t->method || !strcmp("PUT", t->method))
|
||||
curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ static CURLcode test_lib1511(char *URL)
|
|||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
easy_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
easy_setopt(curl, CURLOPT_TIMECONDITION, (long)CURL_TIMECOND_IFMODSINCE);
|
||||
easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
|
||||
|
||||
/* TIMEVALUE in the future */
|
||||
easy_setopt(curl, CURLOPT_TIMEVALUE, 1566210680L);
|
||||
|
|
|
|||
|
|
@ -57,11 +57,11 @@ static CURLcode test_lib1513(char *URL)
|
|||
easy_init(curl);
|
||||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
easy_setopt(curl, CURLOPT_TIMEOUT, (long)7);
|
||||
easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1);
|
||||
easy_setopt(curl, CURLOPT_TIMEOUT, 7L);
|
||||
easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
|
||||
easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressKiller);
|
||||
easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL);
|
||||
easy_setopt(curl, CURLOPT_NOPROGRESS, (long)0);
|
||||
easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
|
|
|
|||
|
|
@ -62,11 +62,11 @@ static CURLcode test_lib1555(char *URL)
|
|||
easy_init(t1555_curl);
|
||||
|
||||
easy_setopt(t1555_curl, CURLOPT_URL, URL);
|
||||
easy_setopt(t1555_curl, CURLOPT_TIMEOUT, (long)7);
|
||||
easy_setopt(t1555_curl, CURLOPT_NOSIGNAL, (long)1);
|
||||
easy_setopt(t1555_curl, CURLOPT_TIMEOUT, 7L);
|
||||
easy_setopt(t1555_curl, CURLOPT_NOSIGNAL, 1L);
|
||||
easy_setopt(t1555_curl, CURLOPT_PROGRESSFUNCTION, progressCallback);
|
||||
easy_setopt(t1555_curl, CURLOPT_PROGRESSDATA, NULL);
|
||||
easy_setopt(t1555_curl, CURLOPT_NOPROGRESS, (long)0);
|
||||
easy_setopt(t1555_curl, CURLOPT_NOPROGRESS, 0L);
|
||||
|
||||
res = curl_easy_perform(t1555_curl);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ static CURLcode test_lib1568(char *URL)
|
|||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
||||
curl_easy_setopt(hnd, CURLOPT_USERPWD, "testuser:testpass");
|
||||
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "lib1568");
|
||||
curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST);
|
||||
curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
|
||||
curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
|
||||
curl_easy_setopt(hnd, CURLOPT_PORT, strtol(libtest_arg2, NULL, 10));
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ static CURLcode test_lib1593(char *URL)
|
|||
easy_init(curl);
|
||||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
easy_setopt(curl, CURLOPT_TIMECONDITION, (long)CURL_TIMECOND_IFMODSINCE);
|
||||
easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
|
||||
/* Some TIMEVALUE; it doesn't matter. */
|
||||
easy_setopt(curl, CURLOPT_TIMEVALUE, 1566210680L);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ static CURLcode test_lib1599(char *URL)
|
|||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, URL);
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_NETRC, (long)CURL_NETRC_REQUIRED);
|
||||
curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_REQUIRED);
|
||||
curl_easy_setopt(curl, CURLOPT_NETRC_FILE, libtest_arg2);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
|
|
|||
|
|
@ -73,8 +73,7 @@ static CURLcode test_lib1662(char *URL)
|
|||
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/2000");
|
||||
curl_easy_setopt(hnd, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
|
||||
curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION,
|
||||
(long)CURL_HTTP_VERSION_2TLS);
|
||||
curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
|
||||
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L);
|
||||
curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ static CURLcode test_lib2309(char *URL)
|
|||
curl_easy_setopt(curl, CURLOPT_URL, URL);
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg3);
|
||||
curl_easy_setopt(curl, CURLOPT_NETRC, (long)CURL_NETRC_REQUIRED);
|
||||
curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_REQUIRED);
|
||||
curl_easy_setopt(curl, CURLOPT_NETRC_FILE, libtest_arg2);
|
||||
|
||||
curldupe = curl_easy_duphandle(curl);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ static CURLcode test_lib2502(char *URL)
|
|||
easy_setopt(curl[i], CURLOPT_URL, target_url);
|
||||
/* go http2 */
|
||||
easy_setopt(curl[i], CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_3ONLY);
|
||||
easy_setopt(curl[i], CURLOPT_CONNECTTIMEOUT_MS, (long)5000);
|
||||
easy_setopt(curl[i], CURLOPT_CONNECTTIMEOUT_MS, 5000L);
|
||||
easy_setopt(curl[i], CURLOPT_CAINFO, libtest_arg4);
|
||||
/* wait for first connection established to see if we can share it */
|
||||
easy_setopt(curl[i], CURLOPT_PIPEWAIT, 1L);
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ static CURLcode test_lib510(char *URL)
|
|||
test_setopt(curl, CURLOPT_HTTPHEADER, slist);
|
||||
|
||||
if(testnum == 565) {
|
||||
test_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST);
|
||||
test_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
|
||||
test_setopt(curl, CURLOPT_USERPWD, "foo:bar");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ static CURLcode init(int num, CURLM *cm, const char *url, const char *userpwd,
|
|||
if(res)
|
||||
goto init_failed;
|
||||
|
||||
res_easy_setopt(testeh[num], CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY);
|
||||
res_easy_setopt(testeh[num], CURLOPT_PROXYAUTH, CURLAUTH_ANY);
|
||||
if(res)
|
||||
goto init_failed;
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ static CURLcode test_lib547(char *URL)
|
|||
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
|
||||
test_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3);
|
||||
test_setopt(curl, CURLOPT_PROXYAUTH,
|
||||
(long) (CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC) );
|
||||
CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ static CURLcode test_lib552(char *URL)
|
|||
|
||||
/* Accept any auth. But for this bug configure proxy with DIGEST, basic
|
||||
might work too, not NTLM */
|
||||
test_setopt(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY);
|
||||
test_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ static CURLcode test_lib555(char *URL)
|
|||
easy_setopt(curl, CURLOPT_PROXY, libtest_arg2);
|
||||
easy_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3);
|
||||
easy_setopt(curl, CURLOPT_PROXYAUTH,
|
||||
(long) (CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC) );
|
||||
CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM);
|
||||
|
||||
multi_init(m);
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ static CURLcode test_lib579(char *URL)
|
|||
/* enforce chunked transfer by setting the header */
|
||||
test_setopt(curl, CURLOPT_HTTPHEADER, slist);
|
||||
|
||||
test_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST);
|
||||
test_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
|
||||
test_setopt(curl, CURLOPT_USERPWD, "foo:bar");
|
||||
|
||||
/* we want to use our own progress function */
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ static CURLcode test_lib583(char *URL)
|
|||
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
easy_setopt(curl, CURLOPT_URL, URL);
|
||||
easy_setopt(curl, CURLOPT_INFILESIZE, (long)5);
|
||||
easy_setopt(curl, CURLOPT_INFILESIZE, 5L);
|
||||
|
||||
multi_add_handle(multiHandle, curl);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@
|
|||
|
||||
It is reproducible by the following steps:
|
||||
|
||||
- Use a proxy that offers NTLM and Negotiate ( CURLOPT_PROXY and
|
||||
CURLOPT_PROXYPORT)
|
||||
- Tell libcurl NOT to use Negotiate CURL_EASY_SETOPT(CURLOPT_PROXYAUTH,
|
||||
CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM)
|
||||
- Use a proxy that offers NTLM and Negotiate
|
||||
(CURLOPT_PROXY and CURLOPT_PROXYPORT)
|
||||
- Tell libcurl NOT to use Negotiate
|
||||
curl_easy_setopt(CURLOPT_PROXYAUTH,
|
||||
CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM)
|
||||
- Start the request
|
||||
*/
|
||||
|
||||
|
|
@ -59,7 +60,7 @@ static CURLcode test_lib590(char *URL)
|
|||
test_setopt(curl, CURLOPT_URL, URL);
|
||||
test_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
test_setopt(curl, CURLOPT_PROXYAUTH,
|
||||
(long) (CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM));
|
||||
CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM);
|
||||
test_setopt(curl, CURLOPT_PROXY, libtest_arg2); /* set in first.c */
|
||||
|
||||
/* set the name + password twice to test that the API is fine with it */
|
||||
|
|
|
|||
|
|
@ -80,8 +80,7 @@ static CURLcode test_cert_blob(const char *url, const char *cafile)
|
|||
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "CURLOPT_CAINFO_BLOB");
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS,
|
||||
(long)CURLSSLOPT_REVOKE_BEST_EFFORT);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_REVOKE_BEST_EFFORT);
|
||||
|
||||
blob.data = certdata;
|
||||
blob.len = certsize;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static CURLcode test_lib694(char *URL)
|
|||
test_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
test_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
test_setopt(curl, CURLOPT_HTTPAUTH,
|
||||
(long) (CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM));
|
||||
CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM);
|
||||
test_setopt(curl, CURLOPT_USERPWD, "me:password");
|
||||
|
||||
do {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue