Lines Matching +full:- +full:- +full:enable +full:- +full:sftp
21 * SPDX-License-Identifier: curl
91 if(blob->len > CURL_MAX_INPUT_LENGTH) in Curl_setblobopt()
95 ((blob->flags & CURL_BLOB_COPY) ? blob->len : 0)); in Curl_setblobopt()
99 if(blob->flags & CURL_BLOB_COPY) { in Curl_setblobopt()
101 nblob->data = (char *)nblob + sizeof(struct curl_blob); in Curl_setblobopt()
102 memcpy(nblob->data, blob->data, blob->len); in Curl_setblobopt()
178 * We are asked to cherry-pick protocols, so play it safe and disallow all in protocol2num()
179 * protocols to start with, and re-add the wanted ones back in. in protocol2num()
196 tlen = str ? (size_t) (str - token) : strlen(token); in protocol2num()
203 *val |= h->protocol; in protocol2num()
223 data->state.authproxy.iestyle = iestyle; in httpauth()
225 data->state.authhost.iestyle = iestyle; in httpauth()
237 auth &= ~CURLAUTH_NEGOTIATE; /* no Negotiate (SPNEGO) auth without GSS-API in httpauth()
252 data->set.proxyauth = auth; in httpauth()
254 data->set.httpauth = auth; in httpauth()
265 if(arg < -1) in setopt_long()
270 data->set.dns_cache_timeout = (int)arg; in setopt_long()
274 if(arg < -1) in setopt_long()
279 data->set.general_ssl.ca_cache_timeout = (int)arg; in setopt_long()
291 data->set.maxconnects = (unsigned int)uarg; in setopt_long()
298 data->set.reuse_forbid = enabled; in setopt_long()
305 data->set.reuse_fresh = enabled; in setopt_long()
312 data->set.verbose = enabled; in setopt_long()
318 data->set.include_header = enabled; in setopt_long()
324 data->set.hide_progress = enabled; in setopt_long()
325 if(data->set.hide_progress) in setopt_long()
326 data->progress.flags |= PGRS_HIDE; in setopt_long()
328 data->progress.flags &= ~PGRS_HIDE; in setopt_long()
334 data->set.opt_no_body = enabled; in setopt_long()
336 if(data->set.opt_no_body) in setopt_long()
338 data->set.method = HTTPREQ_HEAD; in setopt_long()
339 else if(data->set.method == HTTPREQ_HEAD) in setopt_long()
340 data->set.method = HTTPREQ_GET; in setopt_long()
345 * Do not output the >=400 error code HTML-page, but instead only in setopt_long()
348 data->set.http_fail_on_error = enabled; in setopt_long()
351 data->set.http_keep_sending_on_error = enabled; in setopt_long()
361 data->set.method = HTTPREQ_PUT; in setopt_long()
362 data->set.opt_no_body = FALSE; /* this is implied */ in setopt_long()
367 data->set.method = HTTPREQ_GET; in setopt_long()
374 data->set.get_filetime = enabled; in setopt_long()
382 data->set.server_response_timeout = (unsigned int)arg * 1000; in setopt_long()
392 data->set.server_response_timeout = (unsigned int)arg; in setopt_long()
402 data->set.tftp_no_options = enabled; in setopt_long()
412 data->set.tftp_blksize = arg; in setopt_long()
422 data->set.use_netrc = (unsigned char)arg; in setopt_long()
432 data->set.prefer_ascii = enabled; in setopt_long()
441 data->set.timecondition = (unsigned char)(curl_TimeCond)arg; in setopt_long()
448 data->set.timevalue = (time_t)arg; in setopt_long()
461 struct ssl_primary_config *primary = &data->set.ssl.primary; in setopt_long()
464 primary = &data->set.proxy_ssl.primary; in setopt_long()
477 primary->version = (unsigned char)version; in setopt_long()
478 primary->version_max = (unsigned int)version_max; in setopt_long()
489 if(arg < -1) in setopt_long()
492 if(data->set.postfieldsize < arg && in setopt_long()
493 data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) { in setopt_long()
495 Curl_safefree(data->set.str[STRING_COPYPOSTFIELDS]); in setopt_long()
496 data->set.postfields = NULL; in setopt_long()
499 data->set.postfieldsize = arg; in setopt_long()
506 * prevent the forthcoming read-cookies-from-file actions to accept in setopt_long()
510 data->set.cookiesession = enabled; in setopt_long()
517 data->set.http_auto_referer = enabled; in setopt_long()
521 data->set.http_transfer_encoding = enabled; in setopt_long()
526 * Follow Location: header hints on an HTTP-server. in setopt_long()
528 data->set.http_follow_location = enabled; in setopt_long()
536 data->set.allow_auth_to_other_hosts = enabled; in setopt_long()
542 * headers. This should mostly be used to detect never-ending loops. in setopt_long()
544 if(arg < -1) in setopt_long()
546 data->set.maxredirs = arg; in setopt_long()
552 * CURL_REDIR_GET_ALL - POST is changed to GET after 301 and 302 in setopt_long()
553 * CURL_REDIR_POST_301 - POST is kept as POST after 301 in setopt_long()
554 * CURL_REDIR_POST_302 - POST is kept as POST after 302 in setopt_long()
555 * CURL_REDIR_POST_303 - POST is kept as POST after 303 in setopt_long()
556 * CURL_REDIR_POST_ALL - POST is kept as POST after 301, 302 and 303 in setopt_long()
557 * other - POST is kept as POST after 301 and 302 in setopt_long()
563 data->set.keep_post = arg & CURL_REDIR_POST_ALL; in setopt_long()
571 data->set.method = HTTPREQ_POST; in setopt_long()
572 data->set.opt_no_body = FALSE; /* this is implied */ in setopt_long()
575 data->set.method = HTTPREQ_GET; in setopt_long()
581 data->set.sep_headers = !!(arg & CURLHEADER_SEPARATE); in setopt_long()
591 data->set.method = HTTPREQ_GET; in setopt_long()
592 data->set.opt_no_body = FALSE; /* this is implied */ in setopt_long()
633 data->set.httpwant = (unsigned char)arg; in setopt_long()
639 * Expect: 100-continue header before sending the data anyway. in setopt_long()
643 data->set.expect_100_timeout = arg; in setopt_long()
647 data->set.http09_allowed = enabled; in setopt_long()
653 data->set.mime_formescape = !!(arg & CURLMIMEOPT_FORMESCAPE); in setopt_long()
661 data->set.tunnel_thru_httpproxy = enabled; in setopt_long()
670 data->set.proxyport = (unsigned short)arg; in setopt_long()
682 data->set.proxytype = (unsigned char)(curl_proxytype)arg; in setopt_long()
692 data->set.proxy_transfer_mode = (bool)uarg; in setopt_long()
695 if(data->set.socks5auth & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI)) in setopt_long()
697 data->set.socks5auth = (unsigned char)uarg; in setopt_long()
703 data->set.haproxyprotocol = enabled; in setopt_long()
707 * Enable peer SSL verifying for proxy. in setopt_long()
709 data->set.proxy_ssl.primary.verifypeer = enabled; in setopt_long()
716 * Enable verification of the hostname in the peer certificate for proxy in setopt_long()
718 data->set.proxy_ssl.primary.verifyhost = enabled; in setopt_long()
730 data->set.socks5_gssapi_nec = enabled; in setopt_long()
737 * file info details. Used for FTP, POP3 and SFTP. in setopt_long()
739 data->set.list_only = enabled; in setopt_long()
745 * SFTP. in setopt_long()
747 data->set.remote_append = enabled; in setopt_long()
757 data->set.ftp_filemethod = (unsigned char)arg; in setopt_long()
760 data->set.ftp_use_eprt = enabled; in setopt_long()
764 data->set.ftp_use_epsv = enabled; in setopt_long()
768 data->set.ftp_use_pret = enabled; in setopt_long()
774 data->set.ftp_ccc = (unsigned char)arg; in setopt_long()
779 * Enable or disable FTP_SKIP_PASV_IP, which will disable/enable the in setopt_long()
782 data->set.ftp_skip_ip = enabled; in setopt_long()
787 * Set a specific auth for FTP-SSL transfers. in setopt_long()
791 data->set.ftpsslauth = (unsigned char)(curl_ftpauth)arg; in setopt_long()
799 data->set.accepttimeout = (unsigned int)uarg; in setopt_long()
802 data->set.wildcard_enabled = enabled; in setopt_long()
808 * An FTP/SFTP option that modifies an upload to create missing in setopt_long()
814 data->set.ftp_create_missing_dirs = (unsigned char)arg; in setopt_long()
820 * to-be-uploaded file. in setopt_long()
822 if(arg < -1) in setopt_long()
824 data->set.filesize = arg; in setopt_long()
833 data->set.low_speed_limit = arg; in setopt_long()
842 data->set.low_speed_time = arg; in setopt_long()
850 data->set.use_port = (unsigned short)arg; in setopt_long()
858 data->set.timeout = (unsigned int)arg * 1000; in setopt_long()
866 data->set.timeout = (unsigned int)uarg; in setopt_long()
874 data->set.connecttimeout = (unsigned int)arg * 1000; in setopt_long()
882 data->set.connecttimeout = (unsigned int)uarg; in setopt_long()
889 if(arg < -1) in setopt_long()
891 data->set.set_resume_from = arg; in setopt_long()
896 * Kludgy option to enable CRLF conversions. Subject for removal. in setopt_long()
898 data->set.crlf = enabled; in setopt_long()
908 data->set.localport = curlx_sltous(arg); in setopt_long()
916 data->set.localportrange = curlx_sltous(arg); in setopt_long()
923 * GSS-API credential delegation bitmask in setopt_long()
925 data->set.gssapi_delegation = (unsigned char)uarg& in setopt_long()
931 * Enable peer SSL verifying. in setopt_long()
933 data->set.ssl.primary.verifypeer = enabled; in setopt_long()
941 * Enable peer SSL verifying for DoH. in setopt_long()
943 data->set.doh_verifypeer = enabled; in setopt_long()
947 * Enable verification of the hostname in the peer certificate for DoH in setopt_long()
949 data->set.doh_verifyhost = enabled; in setopt_long()
953 * Enable certificate status verifying for DoH. in setopt_long()
958 data->set.doh_verifystatus = enabled; in setopt_long()
963 * Enable verification of the hostname in the peer certificate in setopt_long()
969 data->set.ssl.primary.verifyhost = enabled; in setopt_long()
976 * Enable certificate status verifying. in setopt_long()
981 data->set.ssl.primary.verifystatus = enabled; in setopt_long()
988 * Enable TLS false start. in setopt_long()
993 data->set.ssl.falsestart = enabled; in setopt_long()
998 data->set.ssl.certinfo = enabled; in setopt_long()
1015 data->set.buffer_size = (unsigned int)arg; in setopt_long()
1028 data->set.upload_buffer_size = (unsigned int)arg; in setopt_long()
1036 data->set.no_signal = enabled; in setopt_long()
1044 data->set.max_filesize = arg; in setopt_long()
1054 data->set.use_ssl = (unsigned char)arg; in setopt_long()
1057 data->set.ssl.primary.ssl_options = (unsigned char)(arg & 0xff); in setopt_long()
1058 data->set.ssl.enable_beast = !!(arg & CURLSSLOPT_ALLOW_BEAST); in setopt_long()
1059 data->set.ssl.no_revoke = !!(arg & CURLSSLOPT_NO_REVOKE); in setopt_long()
1060 data->set.ssl.no_partialchain = !!(arg & CURLSSLOPT_NO_PARTIALCHAIN); in setopt_long()
1061 data->set.ssl.revoke_best_effort = !!(arg & CURLSSLOPT_REVOKE_BEST_EFFORT); in setopt_long()
1062 data->set.ssl.native_ca_store = !!(arg & CURLSSLOPT_NATIVE_CA); in setopt_long()
1063 data->set.ssl.auto_client_cert = !!(arg & CURLSSLOPT_AUTO_CLIENT_CERT); in setopt_long()
1064 data->set.ssl.earlydata = !!(arg & CURLSSLOPT_EARLYDATA); in setopt_long()
1071 data->set.proxy_ssl.primary.ssl_options = (unsigned char)(arg & 0xff); in setopt_long()
1072 data->set.proxy_ssl.enable_beast = !!(arg & CURLSSLOPT_ALLOW_BEAST); in setopt_long()
1073 data->set.proxy_ssl.no_revoke = !!(arg & CURLSSLOPT_NO_REVOKE); in setopt_long()
1074 data->set.proxy_ssl.no_partialchain = !!(arg & CURLSSLOPT_NO_PARTIALCHAIN); in setopt_long()
1075 data->set.proxy_ssl.revoke_best_effort = in setopt_long()
1077 data->set.proxy_ssl.native_ca_store = !!(arg & CURLSSLOPT_NATIVE_CA); in setopt_long()
1078 data->set.proxy_ssl.auto_client_cert = in setopt_long()
1087 data->set.ipver = (unsigned char) arg; in setopt_long()
1091 * Enable or disable TCP_NODELAY, which will disable/enable the Nagle in setopt_long()
1094 data->set.tcp_nodelay = enabled; in setopt_long()
1098 data->set.ignorecl = enabled; in setopt_long()
1104 * (1) - only do connection in setopt_long()
1105 * (2) - do first get request but get no content in setopt_long()
1109 data->set.connect_only = !!arg; in setopt_long()
1110 data->set.connect_only_ws = (arg == 2); in setopt_long()
1114 data->set.ssl.primary.cache_session = enabled; in setopt_long()
1116 data->set.proxy_ssl.primary.cache_session = in setopt_long()
1117 data->set.ssl.primary.cache_session; in setopt_long()
1124 data->set.ssh_auth_types = (int)arg; in setopt_long()
1127 data->set.ssh_compression = enabled; in setopt_long()
1136 data->set.http_te_skip = !enabled; /* reversed */ in setopt_long()
1146 data->set.http_ce_skip = !enabled; /* reversed */ in setopt_long()
1156 data->set.new_file_perms = (unsigned int)arg; in setopt_long()
1166 data->set.new_directory_perms = (unsigned int)arg; in setopt_long()
1174 * that the value fits into an unsigned 32-bit integer. in setopt_long()
1180 data->set.scope_id = (unsigned int)uarg; in setopt_long()
1188 data->set.allowed_protocols = (curl_prot_t)arg; in setopt_long()
1195 data->set.redir_protocols = (curl_prot_t)arg; in setopt_long()
1201 data->set.mail_rcpt_allowfails = enabled; in setopt_long()
1205 /* Enable/disable SASL initial response */ in setopt_long()
1206 data->set.sasl_ir = enabled; in setopt_long()
1264 data->set.rtspreq = rtspreq; in setopt_long()
1273 data->state.rtsp_next_client_CSeq = arg; in setopt_long()
1277 /* Same as the above, but for server-initiated requests */ in setopt_long()
1278 data->state.rtsp_next_server_CSeq = arg; in setopt_long()
1284 data->set.tcp_keepalive = enabled; in setopt_long()
1291 data->set.tcp_keepidle = (int)arg; in setopt_long()
1298 data->set.tcp_keepintvl = (int)arg; in setopt_long()
1305 data->set.tcp_keepcnt = (int)arg; in setopt_long()
1310 data->set.tcp_fastopen = enabled; in setopt_long()
1318 data->set.ssl_enable_alpn = enabled; in setopt_long()
1321 data->set.path_as_is = enabled; in setopt_long()
1324 data->set.pipewait = enabled; in setopt_long()
1329 data->set.priority.weight = (int)arg; in setopt_long()
1335 data->set.suppress_connect_headers = enabled; in setopt_long()
1340 data->set.happy_eyeballs_timeout = (unsigned int)uarg; in setopt_long()
1344 data->set.dns_shuffle_addresses = enabled; in setopt_long()
1348 data->set.disallow_username_in_url = enabled; in setopt_long()
1354 data->set.upkeep_interval_ms = arg; in setopt_long()
1359 data->set.maxage_conn = arg; in setopt_long()
1364 data->set.maxlifetime_conn = arg; in setopt_long()
1369 if(!data->hsts) { in setopt_long()
1370 data->hsts = Curl_hsts_init(); in setopt_long()
1371 if(!data->hsts) in setopt_long()
1376 Curl_hsts_cleanup(&data->hsts); in setopt_long()
1385 if(!data->asi) { in setopt_long()
1386 data->asi = Curl_altsvc_init(); in setopt_long()
1387 if(!data->asi) in setopt_long()
1390 return Curl_altsvc_ctrl(data->asi, arg); in setopt_long()
1394 data->set.ws_raw_mode = (bool)(arg & CURLWS_RAW_MODE); in setopt_long()
1398 data->set.quick_exit = enabled; in setopt_long()
1407 Curl_safefree(data->set.str[STRING_SSL_ENGINE]); in setopt_long()
1434 data->set.proxyheaders = slist; in setopt_slist()
1442 data->set.http200aliases = slist; in setopt_slist()
1450 data->set.postquote = slist; in setopt_slist()
1456 data->set.prequote = slist; in setopt_slist()
1462 data->set.quote = slist; in setopt_slist()
1474 * Prefix the HOST with dash (-) to _remove_ the entry from the cache. in setopt_slist()
1479 data->set.resolve = slist; in setopt_slist()
1480 data->state.resolve = data->set.resolve; in setopt_slist()
1487 data->set.headers = slist; in setopt_slist()
1495 data->set.telnet_options = slist; in setopt_slist()
1501 data->set.mail_rcpt = slist; in setopt_slist()
1505 data->set.connect_to = slist; in setopt_slist()
1523 * Set to make us do HTTP POST. Legacy API-style. in setopt_pointers()
1525 data->set.httppost = va_arg(param, struct curl_httppost *); in setopt_pointers()
1526 data->set.method = HTTPREQ_POST_FORM; in setopt_pointers()
1527 data->set.opt_no_body = FALSE; /* this is implied */ in setopt_pointers()
1528 Curl_mime_cleanpart(data->state.formp); in setopt_pointers()
1529 Curl_safefree(data->state.formp); in setopt_pointers()
1530 data->state.mimepost = NULL; in setopt_pointers()
1541 result = Curl_mime_set_subparts(&data->set.mimepost, in setopt_pointers()
1545 data->set.method = HTTPREQ_POST_MIME; in setopt_pointers()
1546 data->set.opt_no_body = FALSE; /* this is implied */ in setopt_pointers()
1548 Curl_mime_cleanpart(data->state.formp); in setopt_pointers()
1549 Curl_safefree(data->state.formp); in setopt_pointers()
1550 data->state.mimepost = NULL; in setopt_pointers()
1561 data->set.err = va_arg(param, FILE *); in setopt_pointers()
1562 if(!data->set.err) in setopt_pointers()
1563 data->set.err = stderr; in setopt_pointers()
1570 if(data->share) { in setopt_pointers()
1573 if(data->dns.hostcachetype == HCACHE_SHARED) { in setopt_pointers()
1574 data->dns.hostcache = NULL; in setopt_pointers()
1575 data->dns.hostcachetype = HCACHE_NONE; in setopt_pointers()
1579 if(data->share->cookies == data->cookies) in setopt_pointers()
1580 data->cookies = NULL; in setopt_pointers()
1584 if(data->share->hsts == data->hsts) in setopt_pointers()
1585 data->hsts = NULL; in setopt_pointers()
1588 if(data->share->ssl_scache == data->state.ssl_scache) in setopt_pointers()
1589 data->state.ssl_scache = data->multi ? data->multi->ssl_scache : NULL; in setopt_pointers()
1592 if(data->psl == &data->share->psl) in setopt_pointers()
1593 data->psl = data->multi ? &data->multi->psl : NULL; in setopt_pointers()
1596 data->share->dirty--; in setopt_pointers()
1599 data->share = NULL; in setopt_pointers()
1604 data->share = set; in setopt_pointers()
1605 if(data->share) { in setopt_pointers()
1609 data->share->dirty++; in setopt_pointers()
1611 if(data->share->specifier & (1 << CURL_LOCK_DATA_DNS)) { in setopt_pointers()
1613 data->dns.hostcache = &data->share->hostcache; in setopt_pointers()
1614 data->dns.hostcachetype = HCACHE_SHARED; in setopt_pointers()
1617 if(data->share->cookies) { in setopt_pointers()
1619 Curl_cookie_cleanup(data->cookies); in setopt_pointers()
1620 /* enable cookies since we now use a share that uses cookies! */ in setopt_pointers()
1621 data->cookies = data->share->cookies; in setopt_pointers()
1625 if(data->share->hsts) { in setopt_pointers()
1627 Curl_hsts_cleanup(&data->hsts); in setopt_pointers()
1628 data->hsts = data->share->hsts; in setopt_pointers()
1632 if(data->share->ssl_scache) in setopt_pointers()
1633 data->state.ssl_scache = data->share->ssl_scache; in setopt_pointers()
1636 if(data->share->specifier & (1 << CURL_LOCK_DATA_PSL)) in setopt_pointers()
1637 data->psl = &data->share->psl; in setopt_pointers()
1672 return Curl_setstropt(&data->set.str[STRING_SSL_CIPHER_LIST], ptr); in setopt_cptr()
1679 return Curl_setstropt(&data->set.str[STRING_SSL_CIPHER_LIST_PROXY], in setopt_cptr()
1689 return Curl_setstropt(&data->set.str[STRING_SSL_CIPHER13_LIST], ptr); in setopt_cptr()
1698 return Curl_setstropt(&data->set.str[STRING_SSL_CIPHER13_LIST_PROXY], in setopt_cptr()
1709 return Curl_setstropt(&data->set.str[STRING_TARGET], ptr); in setopt_cptr()
1715 return Curl_setstropt(&data->set.str[STRING_NETRC_FILE], ptr); in setopt_cptr()
1725 if(!ptr || data->set.postfieldsize == -1) in setopt_cptr()
1726 result = Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], ptr); in setopt_cptr()
1728 if(data->set.postfieldsize < 0) in setopt_cptr()
1734 else if(data->set.postfieldsize > SIZE_T_MAX) in setopt_cptr()
1743 char *p = Curl_memdup0(ptr, (size_t)data->set.postfieldsize); in setopt_cptr()
1747 free(data->set.str[STRING_COPYPOSTFIELDS]); in setopt_cptr()
1748 data->set.str[STRING_COPYPOSTFIELDS] = p; in setopt_cptr()
1753 data->set.postfields = data->set.str[STRING_COPYPOSTFIELDS]; in setopt_cptr()
1754 data->set.method = HTTPREQ_POST; in setopt_cptr()
1761 data->set.postfields = ptr; in setopt_cptr()
1763 Curl_safefree(data->set.str[STRING_COPYPOSTFIELDS]); in setopt_cptr()
1764 data->set.method = HTTPREQ_POST; in setopt_cptr()
1771 * String to use at the value of Accept-Encoding header. in setopt_cptr()
1773 * If the encoding is set to "" we use an Accept-Encoding header that in setopt_cptr()
1775 * If the encoding is set to NULL we do not send an Accept-Encoding header in setopt_cptr()
1776 * and ignore an received Content-Encoding header. in setopt_cptr()
1782 return Curl_setstropt(&data->set.str[STRING_ENCODING], all); in setopt_cptr()
1784 return Curl_setstropt(&data->set.str[STRING_ENCODING], ptr); in setopt_cptr()
1792 result = Curl_setstropt(&data->set.str[STRING_AWS_SIGV4], ptr); in setopt_cptr()
1796 if(data->set.str[STRING_AWS_SIGV4]) in setopt_cptr()
1797 data->set.httpauth = CURLAUTH_AWS_SIGV4; in setopt_cptr()
1804 if(data->state.referer_alloc) { in setopt_cptr()
1805 Curl_safefree(data->state.referer); in setopt_cptr()
1806 data->state.referer_alloc = FALSE; in setopt_cptr()
1808 result = Curl_setstropt(&data->set.str[STRING_SET_REFERER], ptr); in setopt_cptr()
1809 data->state.referer = data->set.str[STRING_SET_REFERER]; in setopt_cptr()
1814 * String to use in the HTTP User-Agent field in setopt_cptr()
1816 return Curl_setstropt(&data->set.str[STRING_USERAGENT], ptr); in setopt_cptr()
1823 return Curl_setstropt(&data->set.str[STRING_COOKIE], ptr); in setopt_cptr()
1836 cl = curl_slist_append(data->state.cookielist, ptr); in setopt_cptr()
1838 curl_slist_free_all(data->state.cookielist); in setopt_cptr()
1839 data->state.cookielist = NULL; in setopt_cptr()
1842 data->state.cookielist = cl; /* store the list for later use */ in setopt_cptr()
1846 curl_slist_free_all(data->state.cookielist); in setopt_cptr()
1847 data->state.cookielist = NULL; in setopt_cptr()
1849 if(!data->share || !data->share->cookies) { in setopt_cptr()
1852 Curl_cookie_clearall(data->cookies); in setopt_cptr()
1853 Curl_cookie_cleanup(data->cookies); in setopt_cptr()
1856 data->cookies = NULL; in setopt_cptr()
1864 result = Curl_setstropt(&data->set.str[STRING_COOKIEJAR], ptr); in setopt_cptr()
1871 Curl_cookie_init(data, NULL, data->cookies, data->set.cookiesession); in setopt_cptr()
1874 data->cookies = newcookies; in setopt_cptr()
1885 Curl_cookie_clearall(data->cookies); in setopt_cptr()
1891 Curl_cookie_clearsess(data->cookies); in setopt_cptr()
1904 if(!data->cookies) { in setopt_cptr()
1906 data->cookies = Curl_cookie_init(data, NULL, NULL, TRUE); in setopt_cptr()
1907 if(!data->cookies) in setopt_cptr()
1916 if(checkprefix("Set-Cookie:", ptr)) in setopt_cptr()
1918 Curl_cookie_add(data, data->cookies, TRUE, FALSE, ptr + 11, NULL, in setopt_cptr()
1922 Curl_cookie_add(data, data->cookies, FALSE, FALSE, ptr, NULL, in setopt_cptr()
1935 return Curl_setstropt(&data->set.str[STRING_CUSTOMREQUEST], ptr); in setopt_cptr()
1938 data->set.method = HTTPREQ_CUSTOM; in setopt_cptr()
1954 return Curl_setstropt(&data->set.str[STRING_PROXY], ptr); in setopt_cptr()
1964 return Curl_setstropt(&data->set.str[STRING_PRE_PROXY], ptr); in setopt_cptr()
1973 return Curl_setstropt(&data->set.str[STRING_PROXY_SERVICE_NAME], ptr); in setopt_cptr()
1977 * Set authentication service name for DIGEST-MD5, Kerberos 5 and SPNEGO in setopt_cptr()
1979 return Curl_setstropt(&data->set.str[STRING_SERVICE_NAME], ptr); in setopt_cptr()
1986 data->set.writeheader = (void *)ptr; in setopt_cptr()
1993 data->set.in_set = (void *)ptr; in setopt_cptr()
2000 data->set.out = (void *)ptr; in setopt_cptr()
2007 data->set.debugdata = (void *)ptr; in setopt_cptr()
2013 data->set.progress_client = (void *)ptr; in setopt_cptr()
2019 data->set.seek_client = (void *)ptr; in setopt_cptr()
2025 data->set.ioctl_client = (void *)ptr; in setopt_cptr()
2033 data->set.ssl.fsslctxp = (void *)ptr; in setopt_cptr()
2042 data->set.sockopt_client = (void *)ptr; in setopt_cptr()
2048 data->set.opensocket_client = (void *)ptr; in setopt_cptr()
2054 data->set.resolver_start_client = (void *)ptr; in setopt_cptr()
2060 data->set.closesocket_client = (void *)ptr; in setopt_cptr()
2064 data->set.trailer_data = (void *)ptr; in setopt_cptr()
2068 data->set.prereq_userp = (void *)ptr; in setopt_cptr()
2076 data->set.errorbuffer = ptr; in setopt_cptr()
2084 result = Curl_setstropt(&data->set.str[STRING_FTPPORT], ptr); in setopt_cptr()
2085 data->set.ftp_use_port = !!(data->set.str[STRING_FTPPORT]); in setopt_cptr()
2089 return Curl_setstropt(&data->set.str[STRING_FTP_ACCOUNT], ptr); in setopt_cptr()
2092 return Curl_setstropt(&data->set.str[STRING_FTP_ALTERNATIVE_TO_USER], ptr); in setopt_cptr()
2099 result = Curl_setstropt(&data->set.str[STRING_KRB_LEVEL], ptr); in setopt_cptr()
2100 data->set.krb = !!(data->set.str[STRING_KRB_LEVEL]); in setopt_cptr()
2108 if(data->state.url_alloc) { in setopt_cptr()
2109 Curl_safefree(data->state.url); in setopt_cptr()
2110 data->state.url_alloc = FALSE; in setopt_cptr()
2112 result = Curl_setstropt(&data->set.str[STRING_SET_URL], ptr); in setopt_cptr()
2113 data->state.url = data->set.str[STRING_SET_URL]; in setopt_cptr()
2120 return setstropt_userpwd(ptr, &data->set.str[STRING_USERNAME], in setopt_cptr()
2121 &data->set.str[STRING_PASSWORD]); in setopt_cptr()
2127 return Curl_setstropt(&data->set.str[STRING_USERNAME], ptr); in setopt_cptr()
2133 return Curl_setstropt(&data->set.str[STRING_PASSWORD], ptr); in setopt_cptr()
2139 return Curl_setstropt(&data->set.str[STRING_OPTIONS], ptr); in setopt_cptr()
2145 return Curl_setstropt(&data->set.str[STRING_BEARER], ptr); in setopt_cptr()
2158 result = Curl_urldecode(u, 0, &data->set.str[STRING_PROXYUSERNAME], NULL, in setopt_cptr()
2161 result = Curl_urldecode(p, 0, &data->set.str[STRING_PROXYPASSWORD], NULL, in setopt_cptr()
2171 return Curl_setstropt(&data->set.str[STRING_PROXYUSERNAME], ptr); in setopt_cptr()
2177 return Curl_setstropt(&data->set.str[STRING_PROXYPASSWORD], ptr); in setopt_cptr()
2183 return Curl_setstropt(&data->set.str[STRING_NOPROXY], ptr); in setopt_cptr()
2190 return Curl_setstropt(&data->set.str[STRING_SET_RANGE], ptr); in setopt_cptr()
2196 if(data->state.url_alloc) { in setopt_cptr()
2197 Curl_safefree(data->state.url); in setopt_cptr()
2198 data->state.url_alloc = FALSE; in setopt_cptr()
2201 data->state.url = NULL; in setopt_cptr()
2202 Curl_safefree(data->set.str[STRING_SET_URL]); in setopt_cptr()
2203 data->set.uh = (CURLU *)ptr; in setopt_cptr()
2209 return Curl_setstropt(&data->set.str[STRING_CERT], ptr); in setopt_cptr()
2216 return Curl_setstropt(&data->set.str[STRING_CERT_PROXY], ptr); in setopt_cptr()
2223 return Curl_setstropt(&data->set.str[STRING_CERT_TYPE], ptr); in setopt_cptr()
2230 return Curl_setstropt(&data->set.str[STRING_CERT_TYPE_PROXY], ptr); in setopt_cptr()
2236 return Curl_setstropt(&data->set.str[STRING_KEY], ptr); in setopt_cptr()
2243 return Curl_setstropt(&data->set.str[STRING_KEY_PROXY], ptr); in setopt_cptr()
2250 return Curl_setstropt(&data->set.str[STRING_KEY_TYPE], ptr); in setopt_cptr()
2257 return Curl_setstropt(&data->set.str[STRING_KEY_TYPE_PROXY], ptr); in setopt_cptr()
2264 return Curl_setstropt(&data->set.str[STRING_KEY_PASSWD], ptr); in setopt_cptr()
2271 return Curl_setstropt(&data->set.str[STRING_KEY_PASSWD_PROXY], ptr); in setopt_cptr()
2278 result = Curl_setstropt(&data->set.str[STRING_SSL_ENGINE], ptr); in setopt_cptr()
2290 result = Curl_setstropt(&data->set.str[STRING_HAPROXY_CLIENT_IP], ptr); in setopt_cptr()
2291 /* enable the HAProxy protocol */ in setopt_cptr()
2292 data->set.haproxyprotocol = TRUE; in setopt_cptr()
2298 * performing an operation and thus what from-IP your connection will use. in setopt_cptr()
2301 &data->set.str[STRING_DEVICE], in setopt_cptr()
2302 &data->set.str[STRING_INTERFACE], in setopt_cptr()
2303 &data->set.str[STRING_BINDHOST]); in setopt_cptr()
2312 return Curl_setstropt(&data->set.str[STRING_SSL_PINNEDPUBLICKEY], ptr); in setopt_cptr()
2324 return Curl_setstropt(&data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY], in setopt_cptr()
2333 return Curl_setstropt(&data->set.str[STRING_SSL_CAFILE], ptr); in setopt_cptr()
2341 return Curl_setstropt(&data->set.str[STRING_SSL_CAFILE_PROXY], ptr); in setopt_cptr()
2352 return Curl_setstropt(&data->set.str[STRING_SSL_CAPATH], ptr); in setopt_cptr()
2364 return Curl_setstropt(&data->set.str[STRING_SSL_CAPATH_PROXY], ptr); in setopt_cptr()
2373 return Curl_setstropt(&data->set.str[STRING_SSL_CRLFILE], ptr); in setopt_cptr()
2381 return Curl_setstropt(&data->set.str[STRING_SSL_CRLFILE_PROXY], ptr); in setopt_cptr()
2388 return Curl_setstropt(&data->set.str[STRING_SSL_ISSUERCERT], ptr); in setopt_cptr()
2396 return Curl_setstropt(&data->set.str[STRING_SSL_ISSUERCERT_PROXY], ptr); in setopt_cptr()
2404 data->set.private_data = (void *)ptr; in setopt_cptr()
2411 * Specify colon-delimited list of curve algorithm names. in setopt_cptr()
2413 return Curl_setstropt(&data->set.str[STRING_SSL_EC_CURVES], ptr); in setopt_cptr()
2420 return Curl_setstropt(&data->set.str[STRING_SSH_PUBLIC_KEY], ptr); in setopt_cptr()
2426 return Curl_setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY], ptr); in setopt_cptr()
2433 return Curl_setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5], ptr); in setopt_cptr()
2439 return Curl_setstropt(&data->set.str[STRING_SSH_KNOWNHOSTS], ptr); in setopt_cptr()
2445 data->set.ssh_keyfunc_userp = (void *)ptr; in setopt_cptr()
2453 return Curl_setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_SHA256], in setopt_cptr()
2460 data->set.ssh_hostkeyfunc_userp = (void *)ptr; in setopt_cptr()
2466 return protocol2num(ptr, &data->set.allowed_protocols); in setopt_cptr()
2468 data->set.allowed_protocols = (curl_prot_t) CURLPROTO_ALL; in setopt_cptr()
2473 return protocol2num(ptr, &data->set.redir_protocols); in setopt_cptr()
2475 data->set.redir_protocols = (curl_prot_t) CURLPROTO_REDIR; in setopt_cptr()
2480 return Curl_setstropt(&data->set.str[STRING_DEFAULT_PROTOCOL], ptr); in setopt_cptr()
2485 return Curl_setstropt(&data->set.str[STRING_MAIL_FROM], ptr); in setopt_cptr()
2489 return Curl_setstropt(&data->set.str[STRING_MAIL_AUTH], ptr); in setopt_cptr()
2494 return Curl_setstropt(&data->set.str[STRING_SASL_AUTHZID], ptr); in setopt_cptr()
2502 return Curl_setstropt(&data->set.str[STRING_RTSP_SESSION_ID], ptr); in setopt_cptr()
2509 return Curl_setstropt(&data->set.str[STRING_RTSP_STREAM_URI], ptr); in setopt_cptr()
2516 return Curl_setstropt(&data->set.str[STRING_RTSP_TRANSPORT], ptr); in setopt_cptr()
2519 data->set.rtp_out = (void *)ptr; in setopt_cptr()
2524 data->set.wildcardptr = (void *)ptr; in setopt_cptr()
2527 data->set.fnmatch_data = (void *)ptr; in setopt_cptr()
2532 return Curl_setstropt(&data->set.str[STRING_TLSAUTH_USERNAME], ptr); in setopt_cptr()
2536 return Curl_setstropt(&data->set.str[STRING_TLSAUTH_USERNAME_PROXY], ptr); in setopt_cptr()
2540 return Curl_setstropt(&data->set.str[STRING_TLSAUTH_PASSWORD], ptr); in setopt_cptr()
2544 return Curl_setstropt(&data->set.str[STRING_TLSAUTH_PASSWORD_PROXY], ptr); in setopt_cptr()
2559 result = Curl_setstropt(&data->set.str[STRING_DNS_SERVERS], ptr); in setopt_cptr()
2562 return Curl_set_dns_servers(data, data->set.str[STRING_DNS_SERVERS]); in setopt_cptr()
2565 result = Curl_setstropt(&data->set.str[STRING_DNS_INTERFACE], ptr); in setopt_cptr()
2568 return Curl_set_dns_interface(data, data->set.str[STRING_DNS_INTERFACE]); in setopt_cptr()
2571 result = Curl_setstropt(&data->set.str[STRING_DNS_LOCAL_IP4], ptr); in setopt_cptr()
2574 return Curl_set_dns_local_ip4(data, data->set.str[STRING_DNS_LOCAL_IP4]); in setopt_cptr()
2577 result = Curl_setstropt(&data->set.str[STRING_DNS_LOCAL_IP6], ptr); in setopt_cptr()
2580 return Curl_set_dns_local_ip6(data, data->set.str[STRING_DNS_LOCAL_IP6]); in setopt_cptr()
2585 data->set.abstract_unix_socket = FALSE; in setopt_cptr()
2586 return Curl_setstropt(&data->set.str[STRING_UNIX_SOCKET_PATH], ptr); in setopt_cptr()
2589 data->set.abstract_unix_socket = TRUE; in setopt_cptr()
2590 return Curl_setstropt(&data->set.str[STRING_UNIX_SOCKET_PATH], ptr); in setopt_cptr()
2596 result = Curl_setstropt(&data->set.str[STRING_DOH], ptr); in setopt_cptr()
2597 data->set.doh = !!(data->set.str[STRING_DOH]); in setopt_cptr()
2602 data->set.hsts_read_userp = (void *)ptr; in setopt_cptr()
2605 data->set.hsts_write_userp = (void *)ptr; in setopt_cptr()
2609 if(!data->hsts) { in setopt_cptr()
2610 data->hsts = Curl_hsts_init(); in setopt_cptr()
2611 if(!data->hsts) in setopt_cptr()
2615 result = Curl_setstropt(&data->set.str[STRING_HSTS], ptr); in setopt_cptr()
2621 h = curl_slist_append(data->state.hstslist, ptr); in setopt_cptr()
2623 curl_slist_free_all(data->state.hstslist); in setopt_cptr()
2624 data->state.hstslist = NULL; in setopt_cptr()
2627 data->state.hstslist = h; /* store the list for later use */ in setopt_cptr()
2631 curl_slist_free_all(data->state.hstslist); in setopt_cptr()
2632 data->state.hstslist = NULL; in setopt_cptr()
2633 if(!data->share || !data->share->hsts) in setopt_cptr()
2635 Curl_hsts_cleanup(&data->hsts); in setopt_cptr()
2642 if(!data->asi) { in setopt_cptr()
2643 data->asi = Curl_altsvc_init(); in setopt_cptr()
2644 if(!data->asi) in setopt_cptr()
2647 result = Curl_setstropt(&data->set.str[STRING_ALTSVC], ptr); in setopt_cptr()
2651 (void)Curl_altsvc_load(data->asi, ptr); in setopt_cptr()
2659 data->set.tls_ech = CURLECH_DISABLE; in setopt_cptr()
2664 data->set.tls_ech = CURLECH_DISABLE; in setopt_cptr()
2669 data->set.tls_ech = CURLECH_DISABLE | in setopt_cptr()
2670 (data->set.tls_ech & CURLECH_CLA_CFG); in setopt_cptr()
2672 data->set.tls_ech = CURLECH_GREASE | in setopt_cptr()
2673 (data->set.tls_ech & CURLECH_CLA_CFG); in setopt_cptr()
2675 data->set.tls_ech = CURLECH_ENABLE | in setopt_cptr()
2676 (data->set.tls_ech & CURLECH_CLA_CFG); in setopt_cptr()
2678 data->set.tls_ech = CURLECH_HARD | in setopt_cptr()
2679 (data->set.tls_ech & CURLECH_CLA_CFG); in setopt_cptr()
2681 result = Curl_setstropt(&data->set.str[STRING_ECH_CONFIG], ptr + 4); in setopt_cptr()
2684 data->set.tls_ech |= CURLECH_CLA_CFG; in setopt_cptr()
2687 result = Curl_setstropt(&data->set.str[STRING_ECH_PUBLIC], ptr + 3); in setopt_cptr()
2708 data->set.fprogress = va_arg(param, curl_progress_callback); in setopt_func()
2709 if(data->set.fprogress) in setopt_func()
2710 data->progress.callback = TRUE; /* no longer internal */ in setopt_func()
2712 data->progress.callback = FALSE; /* NULL enforces internal */ in setopt_func()
2719 data->set.fxferinfo = va_arg(param, curl_xferinfo_callback); in setopt_func()
2720 if(data->set.fxferinfo) in setopt_func()
2721 data->progress.callback = TRUE; /* no longer internal */ in setopt_func()
2723 data->progress.callback = FALSE; /* NULL enforces internal */ in setopt_func()
2730 data->set.fdebug = va_arg(param, curl_debug_callback); in setopt_func()
2739 data->set.fwrite_header = va_arg(param, curl_write_callback); in setopt_func()
2745 data->set.fwrite_func = va_arg(param, curl_write_callback); in setopt_func()
2746 if(!data->set.fwrite_func) in setopt_func()
2748 data->set.fwrite_func = (curl_write_callback)fwrite; in setopt_func()
2754 data->set.fread_func_set = va_arg(param, curl_read_callback); in setopt_func()
2755 if(!data->set.fread_func_set) { in setopt_func()
2756 data->set.is_fread_set = 0; in setopt_func()
2758 data->set.fread_func_set = (curl_read_callback)fread; in setopt_func()
2761 data->set.is_fread_set = 1; in setopt_func()
2767 data->set.seek_func = va_arg(param, curl_seek_callback); in setopt_func()
2773 data->set.ioctl_func = va_arg(param, curl_ioctl_callback); in setopt_func()
2781 data->set.ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback); in setopt_func()
2791 data->set.fsockopt = va_arg(param, curl_sockopt_callback); in setopt_func()
2799 data->set.fopensocket = va_arg(param, curl_opensocket_callback); in setopt_func()
2807 data->set.fclosesocket = va_arg(param, curl_closesocket_callback); in setopt_func()
2815 data->set.resolver_start = va_arg(param, curl_resolver_start_callback); in setopt_func()
2823 data->set.ssh_hostkeyfunc = va_arg(param, curl_sshhostkeycallback); in setopt_func()
2830 data->set.ssh_keyfunc = va_arg(param, curl_sshkeycallback); in setopt_func()
2838 data->set.fwrite_rtp = va_arg(param, curl_write_callback); in setopt_func()
2843 data->set.chunk_bgn = va_arg(param, curl_chunk_bgn_callback); in setopt_func()
2846 data->set.chunk_end = va_arg(param, curl_chunk_end_callback); in setopt_func()
2849 data->set.fnmatch = va_arg(param, curl_fnmatch_callback); in setopt_func()
2854 data->set.trailer_callback = va_arg(param, curl_trailer_callback); in setopt_func()
2859 data->set.hsts_read = va_arg(param, curl_hstsread_callback); in setopt_func()
2862 data->set.hsts_write = va_arg(param, curl_hstswrite_callback); in setopt_func()
2866 data->set.fprereq = va_arg(param, curl_prereq_callback); in setopt_func()
2883 data->set.timevalue = (time_t)offt; in setopt_offt()
2892 if(offt < -1) in setopt_offt()
2895 if(data->set.postfieldsize < offt && in setopt_offt()
2896 data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) { in setopt_offt()
2898 Curl_safefree(data->set.str[STRING_COPYPOSTFIELDS]); in setopt_offt()
2899 data->set.postfields = NULL; in setopt_offt()
2901 data->set.postfieldsize = offt; in setopt_offt()
2906 * to-be-uploaded file. in setopt_offt()
2908 if(offt < -1) in setopt_offt()
2910 data->set.filesize = offt; in setopt_offt()
2919 data->set.max_send_speed = offt; in setopt_offt()
2928 data->set.max_recv_speed = offt; in setopt_offt()
2934 if(offt < -1) in setopt_offt()
2936 data->set.set_resume_from = offt; in setopt_offt()
2944 data->set.max_filesize = offt; in setopt_offt()
2961 return Curl_setblobopt(&data->set.blobs[BLOB_CERT], blob); in setopt_blob()
2967 return Curl_setblobopt(&data->set.blobs[BLOB_CERT_PROXY], blob); in setopt_blob()
2972 return Curl_setblobopt(&data->set.blobs[BLOB_KEY_PROXY], blob); in setopt_blob()
2980 return Curl_setblobopt(&data->set.blobs[BLOB_CAINFO_PROXY], blob); in setopt_blob()
2987 return Curl_setblobopt(&data->set.blobs[BLOB_SSL_ISSUERCERT_PROXY], in setopt_blob()
2994 return Curl_setblobopt(&data->set.blobs[BLOB_KEY], blob); in setopt_blob()
3002 return Curl_setblobopt(&data->set.blobs[BLOB_CAINFO], blob); in setopt_blob()
3009 return Curl_setblobopt(&data->set.blobs[BLOB_SSL_ISSUERCERT], blob); in setopt_blob()