Lines Matching refs:curl
12 * are also available at https://curl.se/docs/copyright.html.
21 * SPDX-License-Identifier: curl
101 "More details here: https://curl.se/docs/sslcerts.html\n\n" \
102 "curl failed to verify the legitimacy of the server and therefore " \
338 my_setopt(per->curl, CURLOPT_INFILESIZE_LARGE, uploadfilesize);
378 CURL *curl = per->curl;
382 if(!curl || !config)
402 fprintf(tool_stderr, "curl: (%d) %s\n", result,
410 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &code);
414 "curl: (%d) The requested URL returned error: %ld\n",
421 rc = fwrite_xattr(curl, per->this_url, fileno(outs->stream));
434 curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &cond_unmet);
480 curl_easy_getinfo(curl, CURLINFO_OS_ERRNO, &oserrno);
491 curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
495 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response);
522 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response);
523 curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme);
552 curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry_after);
637 errorf(config->global, "curl: (%d) Failed writing body", result);
658 curl_easy_getinfo(curl, CURLINFO_FILETIME_T, &filetime);
679 curl_easy_cleanup(per->curl);
874 CURL *curl;
949 curl = curl_easy_init();
950 if(curl)
955 curl_easy_cleanup(curl);
964 curl_easy_cleanup(curl);
970 curl_easy_cleanup(curl);
977 per->curl = curl;
1167 result = add_file_name_to_url(per->curl, &per->this_url,
1268 result = curl_easy_setopt(curl, CURLOPT_SHARE, share);
1282 result = curl_easy_setopt(curl, CURLOPT_QUICK_EXIT, 1L);
1287 my_setopt(curl, CURLOPT_TCP_NODELAY, 0L);
1290 my_setopt(curl, CURLOPT_TCP_FASTOPEN, 1L);
1293 my_setopt(curl, CURLOPT_WRITEDATA, per);
1294 my_setopt(curl, CURLOPT_INTERLEAVEDATA, per);
1297 my_setopt(curl, CURLOPT_WRITEFUNCTION, tool_write_cb);
1306 my_setopt(curl, CURLOPT_READDATA, per);
1308 my_setopt(curl, CURLOPT_READFUNCTION, tool_read_cb);
1312 my_setopt(curl, CURLOPT_SEEKDATA, per);
1313 my_setopt(curl, CURLOPT_SEEKFUNCTION, tool_seek_cb);
1321 my_setopt(curl, CURLOPT_BUFFERSIZE, size);
1328 my_setopt(curl, CURLOPT_BUFFERSIZE, (long)config->recvpersecond);
1330 my_setopt(curl, CURLOPT_BUFFERSIZE, (long)BUFFER_SIZE);
1333 my_setopt_str(curl, CURLOPT_URL, per->this_url);
1334 my_setopt(curl, CURLOPT_NOPROGRESS,
1337 my_setopt(curl, CURLOPT_NOBODY, 1L);
1340 my_setopt_str(curl, CURLOPT_XOAUTH2_BEARER, config->oauth_bearer);
1342 my_setopt_str(curl, CURLOPT_PROXY, config->proxy);
1353 my_setopt_enum(curl, CURLOPT_PROXYTYPE, config->proxyver);
1355 my_setopt_str(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd);
1358 my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel?1L:0L);
1362 my_setopt_str(curl, CURLOPT_PRE_PROXY, config->preproxy);
1366 my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
1369 my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
1372 my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
1375 my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
1378 my_setopt_bitmask(curl, CURLOPT_PROXYAUTH,
1382 my_setopt_str(curl, CURLOPT_NOPROXY, config->noproxy);
1384 my_setopt(curl, CURLOPT_SUPPRESS_CONNECT_HEADERS,
1387 my_setopt(curl, CURLOPT_FAILONERROR, config->failonerror?1L:0L);
1388 my_setopt(curl, CURLOPT_REQUEST_TARGET, config->request_target);
1389 my_setopt(curl, CURLOPT_UPLOAD, per->uploadfile?1L:0L);
1390 my_setopt(curl, CURLOPT_DIRLISTONLY, config->dirlistonly?1L:0L);
1391 my_setopt(curl, CURLOPT_APPEND, config->ftp_append?1L:0L);
1394 my_setopt_enum(curl, CURLOPT_NETRC, (long)CURL_NETRC_OPTIONAL);
1396 my_setopt_enum(curl, CURLOPT_NETRC, (long)CURL_NETRC_REQUIRED);
1398 my_setopt_enum(curl, CURLOPT_NETRC, (long)CURL_NETRC_IGNORED);
1401 my_setopt_str(curl, CURLOPT_NETRC_FILE, config->netrc_file);
1403 my_setopt(curl, CURLOPT_TRANSFERTEXT, config->use_ascii?1L:0L);
1405 my_setopt_str(curl, CURLOPT_LOGIN_OPTIONS, config->login_options);
1406 my_setopt_str(curl, CURLOPT_USERPWD, config->userpwd);
1407 my_setopt_str(curl, CURLOPT_RANGE, config->range);
1410 my_setopt(curl, CURLOPT_ERRORBUFFER, global_errorbuffer);
1412 my_setopt(curl, CURLOPT_TIMEOUT_MS, config->timeout_ms);
1421 my_setopt_str(curl, CURLOPT_POSTFIELDS,
1423 my_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE,
1436 result = tool2curlmime(curl, config->mimeroot, &config->mimepost);
1438 my_setopt_mimepost(curl, CURLOPT_MIMEPOST, config->mimepost);
1449 my_setopt(curl, CURLOPT_MIME_OPTIONS, config->mime_options);
1453 my_setopt_bitmask(curl, CURLOPT_HTTPAUTH, (long)config->authtype);
1455 my_setopt_slist(curl, CURLOPT_HTTPHEADER, config->headers);
1458 my_setopt_str(curl, CURLOPT_REFERER, config->referer);
1459 my_setopt_str(curl, CURLOPT_USERAGENT, config->useragent);
1465 my_setopt(curl, CURLOPT_FOLLOWLOCATION,
1467 my_setopt(curl, CURLOPT_UNRESTRICTED_AUTH,
1469 my_setopt_str(curl, CURLOPT_AWS_SIGV4, config->aws_sigv4);
1470 my_setopt(curl, CURLOPT_AUTOREFERER, config->autoreferer?1L:0L);
1474 my_setopt_slist(curl, CURLOPT_PROXYHEADER, config->proxyheaders);
1475 my_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_SEPARATE);
1479 my_setopt(curl, CURLOPT_MAXREDIRS, config->maxredirs);
1482 my_setopt_enum(curl, CURLOPT_HTTP_VERSION, config->httpversion);
1484 my_setopt_enum(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
1486 /* curl 7.19.1 (the 301 version existed in 7.18.2),
1494 my_setopt(curl, CURLOPT_POSTREDIR, postRedir);
1498 my_setopt_str(curl, CURLOPT_ACCEPT_ENCODING, "");
1502 my_setopt(curl, CURLOPT_TRANSFER_ENCODING, 1L);
1504 my_setopt(curl, CURLOPT_HTTP09_ALLOWED,
1514 my_setopt_str(curl, CURLOPT_FTPPORT, config->ftpport);
1515 my_setopt(curl, CURLOPT_LOW_SPEED_LIMIT,
1517 my_setopt(curl, CURLOPT_LOW_SPEED_TIME, config->low_speed_time);
1518 my_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE,
1520 my_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE,
1524 my_setopt(curl, CURLOPT_RESUME_FROM_LARGE, config->resume_from);
1526 my_setopt(curl, CURLOPT_RESUME_FROM_LARGE, CURL_OFF_T_C(0));
1528 my_setopt_str(curl, CURLOPT_KEYPASSWD, config->key_passwd);
1529 my_setopt_str(curl, CURLOPT_PROXY_KEYPASSWD, config->proxy_key_passwd);
1534 my_setopt_str(curl, CURLOPT_SSH_PRIVATE_KEYFILE, config->key);
1536 my_setopt_str(curl, CURLOPT_SSH_PUBLIC_KEYFILE, config->pubkey);
1540 my_setopt_str(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,
1545 my_setopt_str(curl, CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256,
1550 my_setopt(curl, CURLOPT_SSH_COMPRESSION, 1L);
1554 my_setopt_str(curl, CURLOPT_CAINFO, config->cacert);
1556 my_setopt_str(curl, CURLOPT_PROXY_CAINFO, config->proxy_cacert);
1559 result = res_setopt_str(curl, CURLOPT_CAPATH, config->capath);
1571 result = res_setopt_str(curl, CURLOPT_PROXY_CAPATH,
1587 my_setopt_str(curl, CURLOPT_CRLFILE, config->crlfile);
1589 my_setopt_str(curl, CURLOPT_PROXY_CRLFILE, config->proxy_crlfile);
1591 my_setopt_str(curl, CURLOPT_PROXY_CRLFILE, config->crlfile);
1594 my_setopt_str(curl, CURLOPT_PINNEDPUBLICKEY, config->pinnedpubkey);
1597 my_setopt_str(curl, CURLOPT_SSL_EC_CURVES, config->ssl_ec_curves);
1600 my_setopt_str(curl, CURLOPT_CERTINFO, 1L);
1643 /* In debug build of curl tool, using
1675 my_setopt_str(curl, CURLOPT_SSLCERT_BLOB, &structblob);
1684 my_setopt_str(curl, CURLOPT_SSLCERT, config->cert);
1685 my_setopt_str(curl, CURLOPT_PROXY_SSLCERT, config->proxy_cert);
1686 my_setopt_str(curl, CURLOPT_SSLCERTTYPE, config->cert_type);
1687 my_setopt_str(curl, CURLOPT_PROXY_SSLCERTTYPE,
1718 my_setopt_str(curl, CURLOPT_SSLKEY_BLOB, &structblob);
1727 my_setopt_str(curl, CURLOPT_SSLKEY, config->key);
1728 my_setopt_str(curl, CURLOPT_PROXY_SSLKEY, config->proxy_key);
1729 my_setopt_str(curl, CURLOPT_SSLKEYTYPE, config->key_type);
1730 my_setopt_str(curl, CURLOPT_PROXY_SSLKEYTYPE,
1733 my_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
1734 my_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
1737 my_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
1739 /* my_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L); */
1743 my_setopt(curl, CURLOPT_DOH_SSL_VERIFYPEER, 0L);
1744 my_setopt(curl, CURLOPT_DOH_SSL_VERIFYHOST, 0L);
1748 my_setopt(curl, CURLOPT_PROXY_SSL_VERIFYPEER, 0L);
1749 my_setopt(curl, CURLOPT_PROXY_SSL_VERIFYHOST, 0L);
1752 my_setopt(curl, CURLOPT_PROXY_SSL_VERIFYPEER, 1L);
1756 my_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L);
1759 my_setopt(curl, CURLOPT_DOH_SSL_VERIFYSTATUS, 1L);
1762 my_setopt(curl, CURLOPT_SSL_FALSESTART, 1L);
1764 my_setopt_enum(curl, CURLOPT_SSLVERSION,
1767 my_setopt_enum(curl, CURLOPT_PROXY_SSLVERSION,
1784 my_setopt_bitmask(curl, CURLOPT_SSL_OPTIONS, mask);
1797 my_setopt_bitmask(curl, CURLOPT_PROXY_SSL_OPTIONS, mask);
1802 my_setopt(curl, CURLOPT_PATH_AS_IS, 1L);
1808 /* new in curl 7.19.6 */
1809 result = res_setopt_str(curl, CURLOPT_SSH_KNOWNHOSTS, known);
1823 my_setopt(curl, CURLOPT_FILETIME, 1L);
1826 my_setopt(curl, CURLOPT_CRLF, config->crlf?1L:0L);
1827 my_setopt_slist(curl, CURLOPT_QUOTE, config->quote);
1828 my_setopt_slist(curl, CURLOPT_POSTQUOTE, config->postquote);
1829 my_setopt_slist(curl, CURLOPT_PREQUOTE, config->prequote);
1852 my_setopt_str(curl, CURLOPT_COOKIE, curlx_dyn_ptr(&cookies));
1860 my_setopt_str(curl, CURLOPT_COOKIEFILE, cfl->data);
1865 my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar);
1868 my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession?1L:0L);
1870 my_setopt_enum(curl, CURLOPT_TIMECONDITION, (long)config->timecond);
1871 my_setopt(curl, CURLOPT_TIMEVALUE_LARGE, config->condtime);
1872 my_setopt_str(curl, CURLOPT_CUSTOMREQUEST, config->customrequest);
1874 my_setopt(curl, CURLOPT_STDERR, tool_stderr);
1877 my_setopt_str(curl, CURLOPT_INTERFACE, config->iface);
1878 my_setopt_str(curl, CURLOPT_KRBLEVEL, config->krblevel);
1885 my_setopt(curl, CURLOPT_XFERINFOFUNCTION, tool_progress_cb);
1886 my_setopt(curl, CURLOPT_XFERINFODATA, per);
1891 my_setopt(curl, CURLOPT_NOPROGRESS, 0L);
1892 my_setopt(curl, CURLOPT_XFERINFOFUNCTION, tool_readbusy_cb);
1893 my_setopt(curl, CURLOPT_XFERINFODATA, per);
1898 my_setopt_str(curl, CURLOPT_DNS_SERVERS, config->dns_servers);
1902 my_setopt_str(curl, CURLOPT_DNS_INTERFACE, config->dns_interface);
1904 my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP4, config->dns_ipv4_addr);
1906 my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP6, config->dns_ipv6_addr);
1909 my_setopt_slist(curl, CURLOPT_TELNETOPTIONS, config->telnet_options);
1912 my_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, config->connecttimeout_ms);
1915 my_setopt_str(curl, CURLOPT_DOH_URL, config->doh_url);
1918 my_setopt_str(curl, CURLOPT_SSL_CIPHER_LIST, config->cipher_list);
1921 my_setopt_str(curl, CURLOPT_PROXY_SSL_CIPHER_LIST,
1925 my_setopt_str(curl, CURLOPT_TLS13_CIPHERS, config->cipher13_list);
1928 my_setopt_str(curl, CURLOPT_PROXY_TLS13_CIPHERS,
1934 my_setopt(curl, CURLOPT_FTP_USE_EPSV, 0L);
1939 my_setopt(curl, CURLOPT_FTP_USE_EPRT, 0L);
1942 my_setopt(curl, CURLOPT_DEBUGFUNCTION, tool_debug_cb);
1943 my_setopt(curl, CURLOPT_DEBUGDATA, config);
1944 my_setopt(curl, CURLOPT_VERBOSE, 1L);
1947 /* new in curl 7.9.3 */
1949 result = res_setopt_str(curl, CURLOPT_SSLENGINE, config->engine);
1954 /* new in curl 7.10.7, extended in 7.19.4. Modified to use
1956 my_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS,
1961 /* new in curl 7.10.8 */
1963 my_setopt(curl, CURLOPT_MAXFILESIZE_LARGE,
1966 my_setopt(curl, CURLOPT_IPRESOLVE, config->ip_version);
1968 /* new in curl 7.15.5 */
1970 my_setopt_enum(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
1972 /* new in curl 7.11.0 */
1974 my_setopt_enum(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_TRY);
1976 /* new in curl 7.16.0 */
1978 my_setopt_enum(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_CONTROL);
1980 /* new in curl 7.16.1 */
1982 my_setopt_enum(curl, CURLOPT_FTP_SSL_CCC,
1985 /* new in curl 7.19.4 */
1987 my_setopt_str(curl, CURLOPT_SOCKS5_GSSAPI_NEC, 1L);
1989 /* new in curl 7.55.0 */
1991 my_setopt_bitmask(curl, CURLOPT_SOCKS5_AUTH,
1994 /* new in curl 7.43.0 */
1996 my_setopt_str(curl, CURLOPT_PROXY_SERVICE_NAME,
1999 /* new in curl 7.43.0 */
2001 my_setopt_str(curl, CURLOPT_SERVICE_NAME,
2004 /* curl 7.13.0 */
2005 my_setopt_str(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account);
2006 my_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl?1L:0L);
2008 /* curl 7.14.2 */
2009 my_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, config->ftp_skip_ip?1L:0L);
2011 /* curl 7.15.1 */
2013 my_setopt(curl, CURLOPT_FTP_FILEMETHOD,
2016 /* curl 7.15.2 */
2018 my_setopt(curl, CURLOPT_LOCALPORT, config->localport);
2019 my_setopt_str(curl, CURLOPT_LOCALPORTRANGE, config->localportrange);
2022 /* curl 7.15.5 */
2023 my_setopt_str(curl, CURLOPT_FTP_ALTERNATIVE_TO_USER,
2026 /* curl 7.16.0 */
2029 my_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0L);
2031 /* curl 7.16.2 */
2033 my_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, 0L);
2034 my_setopt(curl, CURLOPT_HTTP_TRANSFER_DECODING, 0L);
2037 /* curl 7.17.1 */
2039 my_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
2041 my_setopt(curl, CURLOPT_TCP_KEEPIDLE, config->alivetime);
2042 my_setopt(curl, CURLOPT_TCP_KEEPINTVL, config->alivetime);
2046 my_setopt(curl, CURLOPT_TCP_KEEPALIVE, 0L);
2048 /* curl 7.20.0 */
2050 my_setopt(curl, CURLOPT_TFTP_BLKSIZE, config->tftp_blksize);
2053 my_setopt_str(curl, CURLOPT_MAIL_FROM, config->mail_from);
2056 my_setopt_slist(curl, CURLOPT_MAIL_RCPT, config->mail_rcpt);
2058 /* curl 7.69.x */
2059 my_setopt(curl, CURLOPT_MAIL_RCPT_ALLOWFAILS,
2062 /* curl 7.20.x */
2064 my_setopt(curl, CURLOPT_FTP_USE_PRET, 1L);
2067 my_setopt(curl, CURLOPT_NEW_FILE_PERMS, config->create_file_mode);
2070 my_setopt_str(curl, CURLOPT_PROTOCOLS_STR, config->proto_str);
2072 my_setopt_str(curl, CURLOPT_REDIR_PROTOCOLS_STR,
2087 my_setopt(curl, CURLOPT_HEADERFUNCTION, tool_header_cb);
2088 my_setopt(curl, CURLOPT_HEADERDATA, per);
2092 my_setopt_slist(curl, CURLOPT_RESOLVE, config->resolve);
2096 my_setopt_slist(curl, CURLOPT_CONNECT_TO, config->connect_to);
2101 my_setopt_str(curl, CURLOPT_TLSAUTH_USERNAME,
2104 my_setopt_str(curl, CURLOPT_TLSAUTH_PASSWORD,
2107 my_setopt_str(curl, CURLOPT_TLSAUTH_TYPE,
2110 my_setopt_str(curl, CURLOPT_PROXY_TLSAUTH_USERNAME,
2113 my_setopt_str(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD,
2116 my_setopt_str(curl, CURLOPT_PROXY_TLSAUTH_TYPE,
2122 my_setopt_str(curl, CURLOPT_GSSAPI_DELEGATION,
2126 my_setopt_str(curl, CURLOPT_MAIL_AUTH, config->mail_auth);
2130 my_setopt_str(curl, CURLOPT_SASL_AUTHZID, config->sasl_authzid);
2134 my_setopt(curl, CURLOPT_SASL_IR, 1L);
2137 my_setopt(curl, CURLOPT_SSL_ENABLE_ALPN, 0L);
2143 my_setopt_str(curl, CURLOPT_ABSTRACT_UNIX_SOCKET,
2147 my_setopt_str(curl, CURLOPT_UNIX_SOCKET_PATH,
2154 my_setopt_str(curl, CURLOPT_DEFAULT_PROTOCOL, config->proto_default);
2158 my_setopt_str(curl, CURLOPT_EXPECT_100_TIMEOUT_MS,
2163 my_setopt(curl, CURLOPT_TFTP_NO_OPTIONS, 1L);
2167 my_setopt(curl, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS,
2172 my_setopt(curl, CURLOPT_HAPROXYPROTOCOL, 1L);
2176 my_setopt_str(curl, CURLOPT_HAPROXY_CLIENT_IP,
2180 my_setopt(curl, CURLOPT_DISALLOW_USERNAME_IN_URL, 1L);
2183 my_setopt_str(curl, CURLOPT_ALTSVC, config->altsvc);
2186 my_setopt_str(curl, CURLOPT_HSTS, config->hsts);
2287 (void)curl_easy_setopt(per->curl, CURLOPT_PIPEWAIT,
2289 (void)curl_easy_setopt(per->curl, CURLOPT_PRIVATE, per);
2290 (void)curl_easy_setopt(per->curl, CURLOPT_XFERINFOFUNCTION, xferinfo_cb);
2291 (void)curl_easy_setopt(per->curl, CURLOPT_XFERINFODATA, per);
2292 (void)curl_easy_setopt(per->curl, CURLOPT_NOPROGRESS, 0L);
2294 mcode = curl_multi_add_handle(multi, per->curl);
2307 (void)curl_easy_setopt(per->curl, CURLOPT_ERRORBUFFER, errorbuf);
2483 result = curl_easy_perform_ev(per->curl);
2486 result = curl_easy_perform(per->curl);
2549 /* On WIN32 we can't set the path to curl-ca-bundle.crt
2578 * default filename curl-ca-bundle.crt in the user's PATH.
2628 TEXT("curl-ca-bundle.crt"));