master
1#ifndef HEADER_CURL_TOOL_CFGABLE_H
2#define HEADER_CURL_TOOL_CFGABLE_H
3/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11 *
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at https://curl.se/docs/copyright.html.
15 *
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 * SPDX-License-Identifier: curl
24 *
25 ***************************************************************************/
26#include "tool_setup.h"
28#include "tool_sdecls.h"
29#include "tool_urlglob.h"
30#include "var.h"
32#define MAX_CONFIG_LINE_LENGTH (10 * 1024 * 1024)
34#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
36extern struct GlobalConfig *global;
38struct State {
39 struct getout *urlnode;
40 struct URLGlob inglob;
41 struct URLGlob urlglob;
42 char *uploadfile;
43 curl_off_t upnum; /* number of files to upload */
44 curl_off_t upidx; /* index for upload glob */
45 curl_off_t urlnum; /* how many iterations this URL has with ranges etc */
46 curl_off_t urlidx; /* index for globbed URLs */
47};
49#define FAIL_NONE 0
50#define FAIL_WITH_BODY 1
51#define FAIL_WO_BODY 2
53struct OperationConfig {
54 struct dynbuf postdata;
55 char *useragent;
56 struct curl_slist *cookies; /* cookies to serialize into a single line */
57 char *cookiejar; /* write to this file */
58 struct curl_slist *cookiefiles; /* file(s) to load cookies from */
59 char *altsvc; /* alt-svc cache filename */
60 char *hsts; /* HSTS cache filename */
61 char *proto_str;
62 char *proto_redir_str;
63 char *proto_default;
64 curl_off_t resume_from;
65 char *postfields;
66 char *referer;
67 char *query;
68 curl_off_t max_filesize;
69 char *output_dir;
70 char *headerfile;
71 char *ftpport;
72 char *iface;
73 char *range;
74 char *dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */
75 char *dns_interface; /* interface name */
76 char *dns_ipv4_addr; /* dot notation */
77 char *dns_ipv6_addr; /* dot notation */
78 char *userpwd;
79 char *login_options;
80 char *proxyuserpwd;
81 char *proxy;
82 char *noproxy;
83 char *knownhosts;
84 char *mail_from;
85 struct curl_slist *mail_rcpt;
86 char *mail_auth;
87 char *sasl_authzid; /* Authorization identity (identity to use) */
88 char *netrc_file;
89 struct getout *url_list; /* point to the first node */
90 struct getout *url_last; /* point to the last/current node */
91 struct getout *url_get; /* point to the node to fill in URL */
92 struct getout *url_out; /* point to the node to fill in outfile */
93 struct getout *url_ul; /* point to the node to fill in upload */
94 size_t num_urls; /* number of URLs added to the list */
95#ifndef CURL_DISABLE_IPFS
96 char *ipfs_gateway;
97#endif
98 char *doh_url;
99 char *cipher_list;
100 char *proxy_cipher_list;
101 char *cipher13_list;
102 char *proxy_cipher13_list;
103 char *cert;
104 char *proxy_cert;
105 char *cert_type;
106 char *proxy_cert_type;
107 char *cacert;
108 char *proxy_cacert;
109 char *capath;
110 char *proxy_capath;
111 char *crlfile;
112 char *proxy_crlfile;
113 char *pinnedpubkey;
114 char *proxy_pinnedpubkey;
115 char *key;
116 char *proxy_key;
117 char *key_type;
118 char *proxy_key_type;
119 char *key_passwd;
120 char *proxy_key_passwd;
121 char *pubkey;
122 char *hostpubmd5;
123 char *hostpubsha256;
124 char *engine;
125 char *etag_save_file;
126 char *etag_compare_file;
127 char *customrequest;
128 char *ssl_ec_curves;
129 char *ssl_signature_algorithms;
130 char *krblevel;
131 char *request_target;
132 char *writeout; /* %-styled format string to output */
133 char *httpgetfields;
134 struct curl_slist *quote;
135 struct curl_slist *postquote;
136 struct curl_slist *prequote;
137 struct curl_slist *headers;
138 struct curl_slist *proxyheaders;
139 struct tool_mime *mimeroot;
140 struct tool_mime *mimecurrent;
141 curl_mime *mimepost;
142 struct curl_slist *telnet_options;
143 struct curl_slist *resolve;
144 struct curl_slist *connect_to;
145 char *preproxy;
146 char *proxy_service_name; /* set authentication service name for HTTP and
147 SOCKS5 proxies */
148 char *service_name; /* set authentication service name for DIGEST-MD5,
149 Kerberos 5 and SPNEGO */
150 char *ftp_account; /* for ACCT */
151 char *ftp_alternative_to_user; /* send command if USER/PASS fails */
152 char *oauth_bearer; /* OAuth 2.0 bearer token */
153 char *unix_socket_path; /* path to Unix domain socket */
154 char *haproxy_clientip; /* client IP for HAProxy protocol */
155 char *aws_sigv4;
156 char *httpsig_algorithm;
157 char *httpsig_headers;
158 char *httpsig_key;
159 char *httpsig_keyid;
160 char *ech; /* Config set by --ech keywords */
161 char *ech_config; /* Config set by "--ech esl:" option */
162 char *ech_public; /* Config set by "--ech pn:" option */
163 struct OperationConfig *prev;
164 struct OperationConfig *next; /* Always last in the struct */
165 curl_off_t condtime;
166 /* for bandwidth limiting features: */
167 curl_off_t sendpersecond; /* send to peer */
168 curl_off_t recvpersecond; /* receive from peer */
170 long proxy_ssl_version;
171 long ip_version;
172 long create_file_mode; /* CURLOPT_NEW_FILE_PERMS */
173 long low_speed_limit;
174 long low_speed_time;
175 long ip_tos; /* IP Type of Service */
176 long vlan_priority; /* VLAN priority */
177 long localport;
178 long localportrange;
179 unsigned long authtype; /* auth bitmask */
180 long timeout_ms;
181 long connecttimeout_ms;
182 long maxredirs;
183 long httpversion;
184 unsigned long socks5_auth;/* auth bitmask for socks5 proxies */
185 long req_retry; /* number of retries */
186 uint32_t retry_delay_ms; /* delay between retries (in milliseconds), 0 means
187 increase exponentially */
188 long retry_maxtime_ms; /* maximum time to keep retrying */
190 unsigned long mime_options; /* Mime option flags. */
191 long tftp_blksize; /* TFTP BLKSIZE option */
192 long alivetime; /* keepalive-time */
193 long alivecnt; /* keepalive-cnt */
194 long gssapi_delegation;
195 long expect100timeout_ms;
196 long happy_eyeballs_timeout_ms; /* happy eyeballs timeout in milliseconds.
197 0 is valid. default: CURL_HET_DEFAULT. */
198 unsigned long timecond;
199 long followlocation; /* follow http redirects mode */
200 HttpReq httpreq;
201 long proxyver; /* set to CURLPROXY_HTTP* define */
202 long ftp_ssl_ccc_mode;
203 long ftp_filemethod;
204 enum {
205 CLOBBER_DEFAULT, /* Provides compatibility with previous versions of curl,
206 by using the default behavior for -o, -O, and -J.
207 If those options would have overwritten files, like
208 -o and -O would, then overwrite them. In the case of
209 -J, this does not overwrite any files. */
210 CLOBBER_NEVER, /* If the file exists, always fail */
211 CLOBBER_ALWAYS /* If the file exists, always overwrite it */
212 } file_clobber_mode;
213 unsigned char upload_flags; /* Bitmask for --upload-flags */
214 unsigned short porttouse;
215 unsigned char ssl_version; /* 0 - 4, 0 being default */
216 unsigned char ssl_version_max; /* 0 - 4, 0 being default */
217 unsigned char fail; /* NONE, with body, without body */
218 BIT(remote_name_all); /* --remote-name-all */
219 BIT(remote_time);
220 BIT(cookiesession); /* new session? */
221 BIT(encoding); /* Accept-Encoding please */
222 BIT(tr_encoding); /* Transfer-Encoding please */
223 BIT(use_resume);
224 BIT(resume_from_current);
225 BIT(disable_epsv);
226 BIT(disable_eprt);
227 BIT(ftp_pret);
228 BIT(proto_present);
229 BIT(proto_redir_present);
230 BIT(mail_rcpt_allowfails); /* --mail-rcpt-allowfails */
231 BIT(sasl_ir); /* Enable/disable SASL initial response */
232 BIT(proxytunnel);
233 BIT(ftp_append); /* APPE on ftp */
234 BIT(use_ascii); /* select ASCII or text transfer */
235 BIT(autoreferer); /* automatically set referer */
236 BIT(show_headers); /* show headers to data output */
237 BIT(no_body); /* do not get the body */
238 BIT(dirlistonly); /* only get the FTP directory list */
239 BIT(unrestricted_auth); /* Continue to send authentication (user+password)
240 when following redirects, even when hostname
241 changed */
242 BIT(netrc_opt);
243 BIT(netrc);
244 BIT(crlf);
245 BIT(http09_allowed);
246 BIT(nobuffer);
247 BIT(readbusy); /* set when reading input returns EAGAIN */
248 BIT(globoff);
249 BIT(use_httpget);
250 BIT(insecure_ok); /* set TRUE to allow insecure SSL connects */
251 BIT(doh_insecure_ok); /* set TRUE to allow insecure SSL connects
252 for DoH */
253 BIT(proxy_insecure_ok); /* set TRUE to allow insecure SSL connects
254 for proxy */
255 BIT(terminal_binary_ok);
256 BIT(verifystatus);
257 BIT(doh_verifystatus);
258 BIT(create_dirs);
259 BIT(ftp_create_dirs);
260 BIT(ftp_skip_ip);
261 BIT(proxynegotiate);
262 BIT(proxyntlm);
263 BIT(proxydigest);
264 BIT(proxybasic);
265 BIT(proxyanyauth);
266 BIT(jsoned); /* added json content-type */
267 BIT(ftp_ssl);
268 BIT(ftp_ssl_reqd);
269 BIT(ftp_ssl_control);
270 BIT(ftp_ssl_ccc);
271 BIT(socks5_gssapi_nec); /* The NEC reference server does not protect the
272 encryption type exchange */
273 BIT(tcp_nodelay);
274 BIT(tcp_fastopen);
275 BIT(retry_all_errors); /* retry on any error */
276 BIT(retry_connrefused); /* set connection refused as a transient error */
277 BIT(tftp_no_options); /* do not send TFTP options requests */
278 BIT(ignorecl); /* --ignore-content-length */
279 BIT(disable_sessionid);
281 BIT(raw);
282 BIT(post301);
283 BIT(post302);
284 BIT(post303);
285 BIT(nokeepalive); /* for keepalive needs */
286 BIT(content_disposition); /* use Content-disposition filename */
288 BIT(xattr); /* store metadata in extended attributes */
289 BIT(ssl_allow_beast); /* allow this SSL vulnerability */
290 BIT(ssl_allow_earlydata); /* allow use of TLSv1.3 early data */
291 BIT(proxy_ssl_allow_beast); /* allow this SSL vulnerability for proxy */
292 BIT(ssl_no_revoke); /* disable SSL certificate revocation checks */
293 BIT(ssl_revoke_best_effort); /* ignore SSL revocation offline/missing
294 revocation list errors */
296 BIT(native_ca_store); /* use the native OS CA store */
297 BIT(proxy_native_ca_store); /* use the native OS CA store for proxy */
298 BIT(ssl_auto_client_cert); /* automatically locate and use a client
299 certificate for authentication (Schannel) */
300 BIT(proxy_ssl_auto_client_cert); /* proxy version of ssl_auto_client_cert */
301 BIT(noalpn); /* enable/disable TLS ALPN extension */
302 BIT(abstract_unix_socket); /* path to an abstract Unix domain socket */
303 BIT(path_as_is);
304 BIT(suppress_connect_headers); /* suppress proxy CONNECT response headers
305 from user callbacks */
306 BIT(synthetic_error); /* if TRUE, this is tool-internal error */
307 BIT(ssh_compression); /* enable/disable SSH compression */
308 BIT(haproxy_protocol); /* whether to send HAProxy protocol v1 */
309 BIT(disallow_username_in_url); /* disallow usernames in URLs */
310 BIT(mptcp); /* enable MPTCP support */
311 BIT(rm_partial); /* on error, remove partially written output
312 files */
313 BIT(skip_existing);
314};
316#ifdef _WIN32
317struct termout {
318 wchar_t *buf;
319 DWORD len;
320};
321#endif
323struct GlobalConfig {
324 struct State state; /* for create_transfer() */
325 char *trace_dump; /* file to dump the network trace to */
326 FILE *trace_stream;
327 char *libcurl; /* Output libcurl code to this filename */
328 char *ssl_sessions; /* file to load/save SSL session tickets */
329 struct tool_var *variables;
330 struct OperationConfig *first;
331 struct OperationConfig *current;
332 struct OperationConfig *last;
333#ifdef _WIN32
334 struct termout term;
335#endif
336 timediff_t ms_per_transfer; /* start next transfer after (at least) this
337 many milliseconds */
338 trace tracetype;
339 int progressmode; /* CURL_PROGRESS_BAR / CURL_PROGRESS_STATS */
340 unsigned short parallel_host; /* MAX_PARALLEL_HOST is the maximum */
341 unsigned short parallel_max; /* MAX_PARALLEL is the maximum */
342 unsigned char verbosity; /* How verbose we should be */
343#ifdef DEBUGBUILD
344 BIT(test_duphandle);
345 BIT(test_event_based);
346#endif
347 BIT(parallel);
348 BIT(parallel_connect);
349 BIT(fail_early); /* exit on first transfer error */
350 BIT(styled_output); /* enable fancy output style detection */
351 BIT(trace_fopened);
352 BIT(tracetime); /* include timestamp? */
353 BIT(traceids); /* include xfer-/conn-id? */
354 BIT(showerror); /* show errors when silent */
355 BIT(silent); /* do not show messages, --silent given */
356 BIT(noprogress); /* do not show progress bar */
357 BIT(isatty); /* Updated internally if output is a tty */
358 BIT(trace_set); /* --trace-config has been used */
359};
361struct OperationConfig *config_alloc(void);
362void config_free(struct OperationConfig *config);
363CURLcode globalconf_init(void);
364void globalconf_free(void);
366#endif /* HEADER_CURL_TOOL_CFGABLE_H */
Diagnostics4 git calls · 224 ms
CallStatusSizeTime0224 ms
discover200152 B2 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200149 B · hit2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=149 git.response.cache=HIT git.response.duration_ms=2 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=149 git.pkt.payload.max=78 git.ls_refs.count=2 git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=10 git.pkt.data=8 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=293470 git.pkt.payload.max=65516 git.sideband.band1.bytes=293354 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=87 git.pack.bytes=293354 git.pack.ofs_delta=0 git.pack.ref_delta=1 git.pack.chain.max=1 git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0 git.pack.full=86Open pack map
fetch2005.1 KiB219 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=219 git.response.bytes=5222 git.response.cache=MISS git.response.duration_ms=219 git.fetch.wants=7a587f6675c8d351a8361bc7b9dd2f6e8bacd405 git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=5222 git.pkt.payload.max=5201 git.sideband.band1.bytes=5200 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
- Ref
- refs/heads/master
- Commit
- 31c911efe5652725e930f4d2e60c9060e5f6646d
- cf-ray
- a5e2bda65f59cfc3
- Request
- 20884241…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format