Artifactspublic-v0

curl

master
ply4 git calls50 ms289 KiB3 cachedprotocol v2
327 lines9.3 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.
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.
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
21# SPDX-License-Identifier: curl
23###########################################################################
25package directories;
27use strict;
28use warnings;
30BEGIN {
31 use base qw(Exporter);
33 our @EXPORT = qw(
34 ftp_contentlist
35 wildcard_filesize
36 wildcard_getfile
37 );
40my %file_chmod1 = (
41 'name' => 'chmod1',
42 'content' => "This file should have permissions 444\n",
43 'perm' => 'r--r--r--',
44 'time' => 'Jan 11 10:00',
45 'dostime' => '01-11-10 10:00AM',
46);
48my %file_chmod2 = (
49 'name' => 'chmod2',
50 'content' => "This file should have permissions 666\n",
51 'perm' => 'rw-rw-rw-',
52 'time' => 'Feb 1 8:00',
53 'dostime' => '02-01-10 08:00AM',
54);
56my %file_chmod3 = (
57 'name' => 'chmod3',
58 'content' => "This file should have permissions 777\n",
59 'perm' => 'rwxrwxrwx',
60 'time' => 'Feb 1 8:00',
61 'dostime' => '02-01-10 08:00AM',
62);
64my %file_chmod4 = (
65 'type' => 'd',
66 'name' => 'chmod4',
67 'content' => "This file should have permissions 001\n",
68 'perm' => '--S--S--t',
69 'time' => 'May 4 4:31',
70 'dostime' => '05-04-10 04:31AM'
71);
73my %file_chmod5 = (
74 'type' => 'd',
75 'name' => 'chmod5',
76 'content' => "This file should have permissions 110\n",
77 'perm' => '--s--s--T',
78 'time' => 'May 4 4:31',
79 'dostime' => '05-04-10 04:31AM'
80);
82my %link_link = (
83 'type' => 'l',
84 'name' => 'link -> file.txt',
85 'size' => '8',
86 'perm' => 'rwxrwxrwx',
87 'time' => 'Jan 6 4:42'
88);
90my %link_link_absolute = (
91 'type' => 'l',
92 'name' => 'link_absolute -> /data/ftp/file.txt',
93 'size' => '15',
94 'perm' => 'rwxrwxrwx',
95 'time' => 'Jan 6 4:45'
96);
98my %dir_dot = (
99 'type' => "d",
100 'name' => ".",
101 'hlink' => "4",
102 'time' => "Apr 27 5:12",
103 'size' => "20480",
104 'dostime' => "04-27-10 05:12AM",
105 'perm' => "rwxrwxrwx"
106);
108my %dir_ddot = (
109 'type' => "d",
110 'name' => "..",
111 'hlink' => "4",
112 'size' => "20480",
113 'time' => "Apr 23 3:12",
114 'dostime' => "04-23-10 03:12AM",
115 'perm' => "rwxrwxrwx"
116);
118my %dir_weirddir_txt = (
119 'type' => "d",
120 'name' => "weirddir.txt",
121 'hlink' => "2",
122 'size' => "4096",
123 'time' => "Apr 23 3:12",
124 'dostime' => "04-23-10 03:12AM",
125 'perm' => "rwxr-xrwx"
126);
128my %dir_UNIX = (
129 'type' => "d",
130 'name' => "UNIX",
131 'hlink' => "11",
132 'size' => "4096",
133 'time' => "Nov 01 2008",
134 'dostime' => "11-01-08 11:11AM",
135 'perm' => "rwx--x--x"
136);
138my %dir_DOS = (
139 'type' => "d",
140 'name' => "DOS",
141 'hlink' => "11",
142 'size' => "4096",
143 'time' => "Nov 01 2008",
144 'dostime' => "11-01-08 11:11AM",
145 'perm' => "rwx--x--x"
146);
148my %dir_dot_NeXT = (
149 'type' => "d",
150 'name' => ".NeXT",
151 'hlink' => "4",
152 'size' => "4096",
153 'time' => "Jan 23 2:05",
154 'dostime' => "01-23-05 02:05AM",
155 'perm' => "rwxrwxrwx"
156);
158my %file_empty_file_dat = (
159 'name' => "empty_file.dat",
160 'content' => "",
161 'perm' => "rw-r--r--",
162 'time' => "Apr 27 11:01",
163 'dostime' => "04-27-10 11:01AM"
164);
166my %file_file_txt = (
167 'name' => "file.txt",
168 'content' => "This is content of file \"file.txt\"\n",
169 'time' => "Apr 27 11:01",
170 'dostime' => "04-27-10 11:01AM",
171 'perm' => "rw-r--r--"
172);
174my %file_someothertext_txt = (
175 'name' => "someothertext.txt",
176 'content' => "Some junk ;-) This file does not really exist.\n",
177 'time' => "Apr 27 11:01",
178 'dostime' => "04-27-10 11:01AM",
179 'perm' => "rw-r--r--"
180);
182my %file_percent_txt = (
183 'name' => "some%2etxt",
184 'content' => "percent in file name.\n",
185 'time' => "Apr 17 11:01",
186 'dostime' => "04-17-10 11:01AM",
187 'perm' => "rw-r--r--"
188);
190my %file_slash = (
191 'name' => "really/special",
192 'content' => "slash in the name \n",
193 'time' => "Jan 17 11:01",
194 'dostime' => "01-17-10 11:01AM",
195 'perm' => "rw-rw-rw-"
196);
198my %lists = (
199 '/fully_simulated/percent/' => {
200 'files' => [ \%file_someothertext_txt, \%file_percent_txt,
201 \%file_slash],
202 'eol' => "\r\n",
203 'type' => "unix"
204 },
205 '/fully_simulated/' => {
206 'files' => [ \%dir_dot, \%dir_ddot, \%dir_DOS, \%dir_UNIX ],
207 'eol' => "\r\n",
208 'type' => "unix"
209 },
210 '/fully_simulated/UNIX/' => {
211 'files' => [ \%dir_dot, \%dir_ddot,
212 \%file_chmod1, \%file_chmod2, \%file_chmod3, \%file_chmod4, \%file_chmod5,
213 \%file_empty_file_dat, \%file_file_txt,
214 \%link_link, \%link_link_absolute, \%dir_dot_NeXT,
215 \%file_someothertext_txt, \%dir_weirddir_txt ],
216 'eol' => "\r\n",
217 'type' => 'unix'
218 },
219 '/fully_simulated/DOS/' => {
220 'files' => [ \%dir_dot, \%dir_ddot,
221 \%file_chmod1, \%file_chmod2, \%file_chmod3, \%file_chmod4, \%file_chmod5,
222 \%file_empty_file_dat, \%file_file_txt,
223 \%dir_dot_NeXT, \%file_someothertext_txt, \%dir_weirddir_txt ],
224 'eol' => "\r\n",
225 'type' => 'dos'
226 }
227);
229sub ftp_createcontent {
230 my ($list) = $_[0];
232 my $type = $$list{'type'};
233 my $eol = $$list{'eol'};
234 my $list_ref = $$list{'files'};
236 my @contentlist;
237 if($type eq "unix") {
238 for(@$list_ref) {
239 my %file = %$_;
240 my $line = "";
241 my $ftype = $file{'type'} ? $file{'type'} : "-";
242 my $fperm = $file{'perm'} ? $file{'perm'} : "rwxr-xr-x";
243 my $fuser = $file{'user'} ? sprintf("%15s", $file{'user'}) : "ftp-default";
244 my $fgroup = $file{'group'} ? sprintf("%15s", $file{'group'}) : "ftp-default";
245 my $fsize = "";
246 if(exists($file{'type'}) && $file{'type'} eq "d") {
247 $fsize = $file{'size'} ? sprintf("%7s", $file{'size'}) : sprintf("%7d", 4096);
248 }
249 else {
250 $fsize = sprintf("%7d", exists($file{'content'}) ? length $file{'content'} : 0);
251 }
252 my $fhlink = $file{'hlink'} ? sprintf("%4d", $file{'hlink'}) : " 1";
253 my $ftime = $file{'time'} ? sprintf("%10s", $file{'time'}) : "Jan 9 1933";
254 push(@contentlist, "$ftype$fperm $fhlink $fuser $fgroup $fsize $ftime $file{'name'}$eol");
255 }
257 return @contentlist;
258 }
259 elsif($type =~ /^dos$/) {
260 for(@$list_ref) {
261 my %file = %$_;
262 my $line = "";
263 my $time = $file{'dostime'} ? $file{'dostime'} : "06-25-97 09:12AM";
264 my $size_or_dir;
265 if(exists($file{'type'}) && $file{'type'} =~ /^d$/) {
266 $size_or_dir = " <DIR> ";
267 }
268 else {
269 $size_or_dir = sprintf("%20d", length $file{'content'});
270 }
271 push(@contentlist, "$time $size_or_dir $file{'name'}$eol");
272 }
273 return @contentlist;
274 }
277sub wildcard_filesize {
278 my ($list_type, $file) = @_;
279 my $list = $lists{$list_type};
280 if($list) {
281 my $files = $list->{'files'};
282 for(@$files) {
283 my %f = %$_;
284 if($f{'name'} eq $file) {
285 if($f{'content'}) {
286 return length $f{'content'};
287 }
288 elsif($f{'type'} ne "d"){
289 return 0;
290 }
291 else {
292 return -1;
293 }
294 }
295 }
296 }
297 return -1;
300sub wildcard_getfile {
301 my ($list_type, $file) = @_;
302 my $list = $lists{$list_type};
303 if($list) {
304 my $files = $list->{'files'};
305 for(@$files) {
306 my %f = %$_;
307 if($f{'name'} eq $file) {
308 if($f{'content'}) {
309 return (length $f{'content'}, $f{'content'});
310 }
311 elsif(!exists($f{'type'}) or $f{'type'} ne "d"){
312 return (0, "");
313 }
314 else {
315 return (-1, 0);
316 }
317 }
318 }
319 }
320 return (-1, 0);
323sub ftp_contentlist {
324 my $listname = $_[0];
325 my $list = $lists{$listname};
326 return ftp_createcontent($list);
Diagnostics4 git calls · 50 ms
CallStatusSizeTime050 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 · hit28 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=4
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=28
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.4 KiB · hit20 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=20
git.response.bytes=2457
git.response.cache=HIT
git.response.duration_ms=20
git.fetch.wants=7df2291c331479548b2965210fcad36dcf35f525
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=2457
git.pkt.payload.max=2436
git.sideband.band1.bytes=2435
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
a5e1d42d1a6b3f27
Request
9f4c4889…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format