Artifactspublic-v0

curl

master
ply4 git calls26 ms289 KiB3 cachedprotocol v2
205 lines7.2 KiBRaw
1/***************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
7 *
8 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9 *
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at https://curl.se/docs/copyright.html.
13 *
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 * SPDX-License-Identifier: curl
22 *
23 ***************************************************************************/
24#include "tool_setup.h"
26#include "tool_libinfo.h"
28/* global variable definitions, for libcurl runtime info */
30static const char * const no_protos = NULL;
32curl_version_info_data *curlinfo = NULL;
33const char * const *built_in_protos = &no_protos;
35size_t proto_count = 0;
37const char *proto_file = NULL;
38const char *proto_ftp = NULL;
39const char *proto_ftps = NULL;
40const char *proto_http = NULL;
41const char *proto_https = NULL;
42const char *proto_rtsp = NULL;
43const char *proto_scp = NULL;
44const char *proto_sftp = NULL;
45const char *proto_tftp = NULL;
46#ifndef CURL_DISABLE_IPFS
47const char *proto_ipfs = "ipfs";
48const char *proto_ipns = "ipns";
49#endif
51static struct proto_name_tokenp {
52 const char *proto_name;
53 const char **proto_tokenp;
54} const possibly_built_in[] = {
55 { "file", &proto_file },
56 { "ftp", &proto_ftp },
57 { "ftps", &proto_ftps },
58 { "http", &proto_http },
59 { "https", &proto_https },
60 { "rtsp", &proto_rtsp },
61 { "scp", &proto_scp },
62 { "sftp", &proto_sftp },
63 { "tftp", &proto_tftp },
64 { NULL, NULL }
65};
67bool feature_altsvc = FALSE;
68bool feature_brotli = FALSE;
69bool feature_hsts = FALSE;
70bool feature_http2 = FALSE;
71bool feature_http3 = FALSE;
72bool feature_httpsig = FALSE;
73bool feature_httpsproxy = FALSE;
74bool feature_libz = FALSE;
75bool feature_ntlm = FALSE;
76bool feature_ntlm_wb = FALSE;
77bool feature_spnego = FALSE;
78bool feature_ssl = FALSE;
79bool feature_zstd = FALSE;
80bool feature_ech = FALSE;
81bool feature_ssls_export = FALSE;
83static struct feature_name_presentp {
84 const char *feature_name;
85 bool *feature_presentp;
86 int feature_bitmask;
87} const maybe_feature[] = {
88 /* Keep alphabetically sorted. */
89 { "alt-svc", &feature_altsvc, CURL_VERSION_ALTSVC },
90 { "AsynchDNS", NULL, CURL_VERSION_ASYNCHDNS },
91 { "brotli", &feature_brotli, CURL_VERSION_BROTLI },
92 { "CharConv", NULL, CURL_VERSION_CONV },
93 { "Debug", NULL, CURL_VERSION_DEBUG },
94 { "ECH", &feature_ech, 0 },
95 { "gsasl", NULL, CURL_VERSION_GSASL },
96 { "GSS-API", NULL, CURL_VERSION_GSSAPI },
97 { "HSTS", &feature_hsts, CURL_VERSION_HSTS },
98 { "HTTP2", &feature_http2, CURL_VERSION_HTTP2 },
99 { "HTTP3", &feature_http3, CURL_VERSION_HTTP3 },
100 { "HTTPS-proxy", &feature_httpsproxy, CURL_VERSION_HTTPS_PROXY },
101 { "HTTPSIG", &feature_httpsig, 0 },
102 { "IDN", NULL, CURL_VERSION_IDN },
103 { "IPv6", NULL, CURL_VERSION_IPV6 },
104 { "Kerberos", NULL, CURL_VERSION_KERBEROS5 },
105 { "Largefile", NULL, CURL_VERSION_LARGEFILE },
106 { "libz", &feature_libz, CURL_VERSION_LIBZ },
107 { "MultiSSL", NULL, CURL_VERSION_MULTI_SSL },
108 { "NTLM", &feature_ntlm, CURL_VERSION_NTLM },
109 { "NTLM_WB", &feature_ntlm_wb, CURL_VERSION_NTLM_WB },
110 { "PSL", NULL, CURL_VERSION_PSL },
111 { "SPNEGO", &feature_spnego, CURL_VERSION_SPNEGO },
112 { "SSL", &feature_ssl, CURL_VERSION_SSL },
113 { "SSPI", NULL, CURL_VERSION_SSPI },
114 { "SSLS-EXPORT", &feature_ssls_export, 0 },
115 { "threadsafe", NULL, CURL_VERSION_THREADSAFE },
116 { "Unicode", NULL, CURL_VERSION_UNICODE },
117 { "UnixSockets", NULL, CURL_VERSION_UNIX_SOCKETS },
118 { "zstd", &feature_zstd, CURL_VERSION_ZSTD },
119 { NULL, NULL, 0 }
120};
122static const char *fnames[CURL_ARRAYSIZE(maybe_feature)];
123const char * const *feature_names = fnames;
124size_t feature_count;
126/*
127 * libcurl_info_init: retrieves runtime information about libcurl,
128 * setting a global pointer 'curlinfo' to libcurl's runtime info
129 * struct, count protocols and flag those we are interested in.
130 * Global pointer feature_names is set to the feature names array. If
131 * the latter is not returned by curl_version_info(), it is built from
132 * the returned features bit mask.
133 */
134CURLcode get_libcurl_info(void)
136 CURLcode result = CURLE_OK;
137 const char * const *builtin;
139 /* Pointer to libcurl's runtime version information */
140 curlinfo = curl_version_info(CURLVERSION_NOW);
141 if(!curlinfo)
142 return CURLE_FAILED_INIT;
144 if(curlinfo->protocols) {
145 const struct proto_name_tokenp *p;
147 built_in_protos = curlinfo->protocols;
149 for(builtin = built_in_protos; !result && *builtin; builtin++) {
150 /* Identify protocols we are interested in. */
151 for(p = possibly_built_in; p->proto_name; p++)
152 if(curl_strequal(p->proto_name, *builtin)) {
153 *p->proto_tokenp = *builtin;
154 break;
155 }
156 }
157 proto_count = builtin - built_in_protos;
158 }
160 if(curlinfo->age >= CURLVERSION_ELEVENTH && curlinfo->feature_names)
161 feature_names = curlinfo->feature_names;
162 else {
163 const struct feature_name_presentp *p;
164 const char **cpp = fnames;
166 for(p = maybe_feature; p->feature_name; p++)
167 if(curlinfo->features & p->feature_bitmask)
168 *cpp++ = p->feature_name;
169 *cpp = NULL;
170 }
172 /* Identify features we are interested in. */
173 for(builtin = feature_names; *builtin; builtin++) {
174 const struct feature_name_presentp *p;
176 for(p = maybe_feature; p->feature_name; p++)
177 if(curl_strequal(p->feature_name, *builtin)) {
178 if(p->feature_presentp)
179 *p->feature_presentp = TRUE;
180 break;
181 }
182 ++feature_count;
183 }
185 return CURLE_OK;
188/* Tokenize a protocol name.
189 * Return the address of the protocol name listed by the library, or NULL if
190 * not found.
191 * Although this may seem useless, this always returns the same address for
192 * a given protocol and thus allows comparing pointers rather than strings.
193 * In addition, the returned pointer is not deallocated until the program ends.
194 */
195const char *proto_token(const char *proto)
197 const char * const *builtin;
199 if(!proto)
200 return NULL;
201 for(builtin = built_in_protos; *builtin; builtin++)
202 if(curl_strequal(*builtin, proto))
203 break;
204 return *builtin;
Diagnostics4 git calls · 26 ms
CallStatusSizeTime026 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=1
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 · hit1 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=23
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=1
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=86
Open pack map
fetch2002.5 KiB · hit23 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=2513
git.response.cache=HIT
git.response.duration_ms=23
git.fetch.wants=dfb23912f345f01d092c0290cae8e71b1940fdd0
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=2513
git.pkt.payload.max=2492
git.sideband.band1.bytes=2491
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
a5e1f9db8b5824ce
Request
748958de…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format