Lines Matching refs:config

192                            struct OperationConfig *config)
203 CURL *curl = config->easy;
220 heads.config = config;
229 if(!config->url_list || !config->url_list->url) {
245 if(!config->cacert &&
246 !config->capath &&
247 !config->insecure_ok) {
251 config->cacert = strdup(env);
252 if(!config->cacert) {
262 config->capath = strdup(env);
263 if(!config->capath) {
274 config->cacert = strdup(env);
275 if(!config->cacert) {
289 result = FindWin32CACert(config, "curl-ca-bundle.crt");
296 if(config->postfields) {
297 if(config->use_httpget) {
299 httpgetfields = strdup(config->postfields);
300 Curl_safefree(config->postfields);
306 if(SetHTTPrequest(config,
307 (config->no_body?HTTPREQ_HEAD:HTTPREQ_GET),
308 &config->httpreq)) {
314 if(SetHTTPrequest(config, HTTPREQ_SIMPLEPOST, &config->httpreq)) {
322 if(config->headerfile) {
324 if(!curlx_strequal(config->headerfile, "-")) {
325 FILE *newfile = fopen(config->headerfile, "wb");
327 warnf(config->global, "Failed to open %s\n", config->headerfile);
332 heads.filename = config->headerfile;
350 for(urlnode = config->url_list; urlnode; urlnode = urlnode->next) {
369 mlfile_last = config->metalinkfile_list;
403 if(!config->globoff && infiles) {
453 if(!config->globoff) {
493 outs.config = config;
538 (metalink || !config->use_metalink)) {
550 if(!*outfile && !config->content_disposition) {
563 warnf(config->global, "bad output glob!\n");
571 if(config->create_dirs || metalink) {
582 && config->content_disposition) {
587 if(config->resume_from_current) {
594 config->resume_from = fileinfo.st_size;
597 config->resume_from = 0;
600 if(config->resume_from) {
604 FILE *file = fopen(outfile, config->resume_from?"ab":"wb",
608 FILE *file = fopen(outfile, config->resume_from?"ab":"wb");
617 outs.init = config->resume_from;
694 if(config->authtype & (1UL << bitcheck++)) {
707 if(config->proxyanyauth || (authbits>1)) {
708 warnf(config->global,
720 warnf(config->global,
725 if(uploadfile && config->resume_from_current)
726 config->resume_from = -1; /* -1 will then force get-it-yourself */
734 /* progress meter is per download, so restore config
789 if((!outfile || !strcmp(outfile, "-")) && !config->use_ascii) {
795 if(config->tcp_nodelay)
798 if(config->tcp_fastopen)
803 if(metalink || !config->use_metalink)
815 input.config = config;
832 if(config->recvpersecond)
835 my_setopt(curl, CURLOPT_BUFFERSIZE, (long)config->recvpersecond);
842 if(config->no_body) {
849 else if(!config->use_metalink)
850 my_setopt(curl, CURLOPT_HEADER, config->include_headers?1L:0L);
852 if(config->oauth_bearer)
853 my_setopt_str(curl, CURLOPT_XOAUTH2_BEARER, config->oauth_bearer);
859 my_setopt_str(curl, CURLOPT_PROXY, config->proxy);
860 my_setopt_str(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd);
863 my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel?1L:0L);
866 if(config->proxy)
867 my_setopt_enum(curl, CURLOPT_PROXYTYPE, (long)config->proxyver);
870 if(config->socksproxy) {
871 my_setopt_str(curl, CURLOPT_PROXY, config->socksproxy);
872 my_setopt_enum(curl, CURLOPT_PROXYTYPE, (long)config->socksver);
876 if(config->proxyanyauth)
879 else if(config->proxynegotiate)
882 else if(config->proxyntlm)
885 else if(config->proxydigest)
888 else if(config->proxybasic)
893 my_setopt_str(curl, CURLOPT_NOPROXY, config->noproxy);
897 my_setopt(curl, CURLOPT_FAILONERROR, config->failonerror?1L:0L);
899 my_setopt(curl, CURLOPT_DIRLISTONLY, config->dirlistonly?1L:0L);
900 my_setopt(curl, CURLOPT_APPEND, config->ftp_append?1L:0L);
902 if(config->netrc_opt)
904 else if(config->netrc || config->netrc_file)
909 if(config->netrc_file)
910 my_setopt_str(curl, CURLOPT_NETRC_FILE, config->netrc_file);
912 my_setopt(curl, CURLOPT_TRANSFERTEXT, config->use_ascii?1L:0L);
913 if(config->login_options)
914 my_setopt_str(curl, CURLOPT_LOGIN_OPTIONS, config->login_options);
915 my_setopt_str(curl, CURLOPT_USERPWD, config->userpwd);
916 my_setopt_str(curl, CURLOPT_RANGE, config->range);
918 my_setopt(curl, CURLOPT_TIMEOUT_MS, (long)(config->timeout * 1000));
925 config->followlocation?1L:0L);
927 config->unrestricted_auth?1L:0L);
929 switch(config->httpreq) {
932 config->postfields);
934 config->postfieldsize);
937 my_setopt_httppost(curl, CURLOPT_HTTPPOST, config->httppost);
943 my_setopt_str(curl, CURLOPT_REFERER, config->referer);
944 my_setopt(curl, CURLOPT_AUTOREFERER, config->autoreferer?1L:0L);
945 my_setopt_str(curl, CURLOPT_USERAGENT, config->useragent);
946 my_setopt_slist(curl, CURLOPT_HTTPHEADER, config->headers);
949 if(config->proxyheaders) {
950 my_setopt_slist(curl, CURLOPT_PROXYHEADER, config->proxyheaders);
955 my_setopt(curl, CURLOPT_MAXREDIRS, config->maxredirs);
957 if(config->httpversion)
958 my_setopt_enum(curl, CURLOPT_HTTP_VERSION, config->httpversion);
964 if(config->authtype)
965 my_setopt_bitmask(curl, CURLOPT_HTTPAUTH, (long)config->authtype);
969 if(config->post301)
971 if(config->post302)
973 if(config->post303)
978 if(config->encoding)
982 if(config->tr_encoding)
987 my_setopt_str(curl, CURLOPT_FTPPORT, config->ftpport);
989 config->low_speed_limit);
990 my_setopt(curl, CURLOPT_LOW_SPEED_TIME, config->low_speed_time);
992 config->sendpersecond);
994 config->recvpersecond);
996 if(config->use_resume)
997 my_setopt(curl, CURLOPT_RESUME_FROM_LARGE, config->resume_from);
1001 my_setopt_str(curl, CURLOPT_KEYPASSWD, config->key_passwd);
1007 my_setopt_str(curl, CURLOPT_SSH_PRIVATE_KEYFILE, config->key);
1009 my_setopt_str(curl, CURLOPT_SSH_PUBLIC_KEYFILE, config->pubkey);
1014 config->hostpubmd5);
1017 if(config->cacert)
1018 my_setopt_str(curl, CURLOPT_CAINFO, config->cacert);
1019 if(config->capath) {
1020 result = res_setopt_str(curl, CURLOPT_CAPATH, config->capath);
1022 warnf(config->global, "ignoring %s, not supported by libcurl\n",
1029 if(config->crlfile)
1030 my_setopt_str(curl, CURLOPT_CRLFILE, config->crlfile);
1032 if(config->pinnedpubkey)
1033 my_setopt_str(curl, CURLOPT_PINNEDPUBLICKEY, config->pinnedpubkey);
1036 my_setopt_str(curl, CURLOPT_SSLCERT, config->cert);
1037 my_setopt_str(curl, CURLOPT_SSLCERTTYPE, config->cert_type);
1038 my_setopt_str(curl, CURLOPT_SSLKEY, config->key);
1039 my_setopt_str(curl, CURLOPT_SSLKEYTYPE, config->key_type);
1041 if(config->insecure_ok) {
1051 if(config->verifystatus)
1054 if(config->falsestart)
1057 my_setopt_enum(curl, CURLOPT_SSLVERSION, config->ssl_version);
1059 if(config->path_as_is)
1063 if(!config->insecure_ok) {
1085 if(config->no_body || config->remote_time) {
1090 my_setopt(curl, CURLOPT_CRLF, config->crlf?1L:0L);
1091 my_setopt_slist(curl, CURLOPT_QUOTE, config->quote);
1092 my_setopt_slist(curl, CURLOPT_POSTQUOTE, config->postquote);
1093 my_setopt_slist(curl, CURLOPT_PREQUOTE, config->prequote);
1096 if(config->cookie)
1097 my_setopt_str(curl, CURLOPT_COOKIE, config->cookie);
1099 if(config->cookiefile)
1100 my_setopt_str(curl, CURLOPT_COOKIEFILE, config->cookiefile);
1103 if(config->cookiejar)
1104 my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar);
1107 my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession?1L:0L);
1109 if(config->cookie || config->cookiefile || config->cookiejar) {
1110 warnf(config->global, "cookie option(s) used even though cookie "
1116 my_setopt_enum(curl, CURLOPT_TIMECONDITION, (long)config->timecond);
1117 my_setopt(curl, CURLOPT_TIMEVALUE, (long)config->condtime);
1118 my_setopt_str(curl, CURLOPT_CUSTOMREQUEST, config->customrequest);
1119 customrequest_helper(config, config->httpreq, config->customrequest);
1123 my_setopt_str(curl, CURLOPT_INTERFACE, config->iface);
1124 my_setopt_str(curl, CURLOPT_KRBLEVEL, config->krblevel);
1126 progressbarinit(&progressbar, config);
1136 if(config->dns_servers)
1137 my_setopt_str(curl, CURLOPT_DNS_SERVERS, config->dns_servers);
1140 if(config->dns_interface)
1141 my_setopt_str(curl, CURLOPT_DNS_INTERFACE, config->dns_interface);
1142 if(config->dns_ipv4_addr)
1143 my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP4, config->dns_ipv4_addr);
1144 if(config->dns_ipv6_addr)
1145 my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP6, config->dns_ipv6_addr);
1148 my_setopt_slist(curl, CURLOPT_TELNETOPTIONS, config->telnet_options);
1151 my_setopt_str(curl, CURLOPT_RANDOM_FILE, config->random_file);
1152 my_setopt_str(curl, CURLOPT_EGDSOCKET, config->egd_file);
1154 (long)(config->connecttimeout * 1000));
1156 if(config->cipher_list)
1157 my_setopt_str(curl, CURLOPT_SSL_CIPHER_LIST, config->cipher_list);
1160 if(config->disable_epsv)
1165 if(config->disable_eprt)
1171 my_setopt(curl, CURLOPT_DEBUGDATA, config);
1176 if(config->engine) {
1177 result = res_setopt_str(curl, CURLOPT_SSLENGINE, config->engine);
1186 (long)(config->ftp_create_dirs?
1191 if(config->max_filesize)
1193 config->max_filesize);
1195 if(4 == config->ip_version)
1197 else if(6 == config->ip_version)
1203 if(config->ftp_ssl_reqd)
1207 else if(config->ftp_ssl)
1211 else if(config->ftp_ssl_control)
1215 if(config->ftp_ssl_ccc)
1217 (long)config->ftp_ssl_ccc_mode);
1220 if(config->socks5_gssapi_nec)
1222 config->socks5_gssapi_nec);
1225 if(config->proxy_service_name)
1227 config->proxy_service_name);
1230 if(config->service_name)
1232 config->service_name);
1235 my_setopt_str(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account);
1237 my_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl?1L:0L);
1240 my_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, config->ftp_skip_ip?1L:0L);
1243 my_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long)config->ftp_filemethod);
1246 if(config->localport) {
1247 my_setopt(curl, CURLOPT_LOCALPORT, (long)config->localport);
1249 (long)config->localportrange);
1254 config->ftp_alternative_to_user);
1257 if(config->disable_sessionid)
1262 if(config->raw) {
1268 if(!config->nokeepalive) {
1270 if(config->alivetime != 0) {
1271 my_setopt(curl, CURLOPT_TCP_KEEPIDLE, config->alivetime);
1272 my_setopt(curl, CURLOPT_TCP_KEEPINTVL, config->alivetime);
1279 if(config->tftp_blksize)
1280 my_setopt(curl, CURLOPT_TFTP_BLKSIZE, config->tftp_blksize);
1282 if(config->mail_from)
1283 my_setopt_str(curl, CURLOPT_MAIL_FROM, config->mail_from);
1285 if(config->mail_rcpt)
1286 my_setopt_slist(curl, CURLOPT_MAIL_RCPT, config->mail_rcpt);
1289 if(config->ftp_pret)
1292 if(config->proto_present)
1293 my_setopt_flags(curl, CURLOPT_PROTOCOLS, config->proto);
1294 if(config->proto_redir_present)
1295 my_setopt_flags(curl, CURLOPT_REDIR_PROTOCOLS, config->proto_redir);
1297 if(config->content_disposition
1309 if(config->resolve)
1311 my_setopt_slist(curl, CURLOPT_RESOLVE, config->resolve);
1313 if(config->connect_to)
1315 my_setopt_slist(curl, CURLOPT_CONNECT_TO, config->connect_to);
1319 if(config->tls_username)
1321 config->tls_username);
1322 if(config->tls_password)
1324 config->tls_password);
1325 if(config->tls_authtype)
1327 config->tls_authtype);
1331 if(config->gssapi_delegation)
1333 config->gssapi_delegation);
1337 long mask = (config->ssl_allow_beast ? CURLSSLOPT_ALLOW_BEAST : 0) |
1338 (config->ssl_no_revoke ? CURLSSLOPT_NO_REVOKE : 0);
1343 if(config->mail_auth)
1344 my_setopt_str(curl, CURLOPT_MAIL_AUTH, config->mail_auth);
1347 if(config->sasl_ir)
1350 if(config->nonpn) {
1354 if(config->noalpn) {
1359 if(config->unix_socket_path)
1361 config->unix_socket_path);
1364 if(config->proto_default)
1365 my_setopt_str(curl, CURLOPT_DEFAULT_PROTOCOL, config->proto_default);
1368 if(config->expect100timeout > 0)
1370 (long)(config->expect100timeout*1000));
1373 if(config->tftp_no_options)
1377 retry_sleep_default = (config->retry_delay) ?
1378 config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */
1380 retry_numretries = config->req_retry;
1394 if(!metalink && config->use_metalink) {
1403 fprintf(config->global->errors,
1407 fprintf(config->global->errors,
1413 if(config->test_event_based)
1438 (!config->retry_maxtime ||
1440 config->retry_maxtime*1000L)) ) {
1456 (config->failonerror &&
1505 warnf(config->global, "Transient problem: %s "
1512 if(!config->retry_delay) {
1598 if(config->writeout)
1599 ourWriteOut(curl, &outs, config->writeout);
1601 if(config->writeenv)
1645 if(!result && config->xattr && outs.fopened && outs.stream) {
1648 warnf(config->global, "Error setting extended attributes: %s\n",
1682 if(!result && config->remote_time && outs.s_isreg && outs.filename) {
1696 if(!metalink && config->use_metalink && result == CURLE_OK) {
1697 int rv = parse_metalink(config, &outs, this_url);
1699 fprintf(config->global->errors, "Metalink: parsing (%s) OK\n",
1702 fprintf(config->global->errors, "Metalink: parsing (%s) FAILED\n",
1809 /* Reset the global config variables */
1817 clean_getout(config);
1829 clean_metalink(config);
1834 CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[])
1847 parseconfig(NULL, config); /* ignore possible failure */
1850 if((argc < 2) && (!config->first->url_list)) {
1851 helpf(config->errors, NULL);
1858 ParameterError res = parse_args(config, argc, argv);
1873 tool_list_engines(config->easy);
1881 if(config->libcurl) {
1890 struct OperationConfig *operation = config->first;
1900 config->current = config->first;
1903 while(!result && config->current) {
1904 result = operate_do(config, config->current);
1906 config->current = config->current->next;
1910 if(config->libcurl) {
1915 dumpeasysrc(config);
1920 helpf(config->errors, "out of memory\n");