Artifactspublic-v0

curl

master
ply4 git calls155 ms289 KiB2 cachedprotocol v2
177 lines5.8 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 "unitcheck.h"
26#ifndef CURL_DISABLE_FTP
28struct test_1668 {
29 const char *in;
30 const char *out;
31 bool rc;
32};
34static bool test1668(const struct test_1668 *spec, size_t i)
36 bool rc;
37 bool ok = TRUE;
38 int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
40 rc = ftp_213_date(spec->in,
41 &year, &month, &day, &hour, &minute, &second);
43 if(rc != spec->rc) {
44 curl_mfprintf(stderr, "test %zu: expected result %d, got %d for %s\n",
45 i, spec->rc, rc, spec->in);
46 ok = FALSE;
47 }
48 else if(rc) {
49 char buffer[80];
50 curl_msnprintf(buffer, sizeof(buffer),
51 "%04d-%02d-%02d %02d:%02d:%02d",
52 year, month, day, hour, minute, second);
53 if(strcmp(buffer, spec->out)) {
54 curl_mfprintf(stderr,
55 "test %zu: (from input %s) got '%s' expected '%s'\n", i,
56 spec->in, buffer, spec->out);
57 ok = FALSE;
58 }
59 }
61 return ok;
64static CURLcode test_unit1668(const char *arg)
66 UNITTEST_BEGIN_SIMPLE
68 static const struct test_1668 test_specs[] = {
69 /* fractions are ignored, even when invalid */
70 { "19980320114234.123", "1998-03-20 11:42:34", TRUE },
71 { "19980320114234.000", "1998-03-20 11:42:34", TRUE },
72 { "19980320114234.aaa", "1998-03-20 11:42:34", TRUE },
73 { "19980320114234.999", "1998-03-20 11:42:34", TRUE },
74 { "19980320114234", "1998-03-20 11:42:34", TRUE },
75 { "09980320114234", "0998-03-20 11:42:34", TRUE },
76 { "10980320114234", "1098-03-20 11:42:34", TRUE },
77 { "19080320114234", "1908-03-20 11:42:34", TRUE },
78 { "19900320114234", "1990-03-20 11:42:34", TRUE },
79 /* invalid month is accepted */
80 { "19980020114234", "1998-00-20 11:42:34", TRUE },
81 /* invalid day is accepted */
82 { "19980300114234", "1998-03-00 11:42:34", TRUE },
83 { "19980320014234", "1998-03-20 01:42:34", TRUE },
84 { "19980320110234", "1998-03-20 11:02:34", TRUE },
85 { "19980320114204", "1998-03-20 11:42:04", TRUE },
86 { "19980320114230", "1998-03-20 11:42:30", TRUE },
87 /* not all invalid times are accepted */
88 { "19980320256565", "", FALSE },
89 { "19980320236565", "", FALSE },
90 { "19980320235865", "", FALSE },
91 /* invalid February is okay */
92 { "19980231114234", "1998-02-31 11:42:34", TRUE },
93 { ":9980231114234", "", FALSE },
94 { "a9980231114234", "", FALSE },
95 { "1:980231114234", "", FALSE },
96 { "1a980231114234", "", FALSE },
97 { "19:80231114234", "", FALSE },
98 { "19b80231114234", "", FALSE },
99 { "199:0231114234", "", FALSE },
100 { "199c0231114234", "", FALSE },
101 { "1998:231114234", "", FALSE },
102 { "1998d231114234", "", FALSE },
103 { "19980:31114234", "", FALSE },
104 { "19980e31114234", "", FALSE },
105 { "199802:1114234", "", FALSE },
106 { "199802f1114234", "", FALSE },
107 { "1998023:114234", "", FALSE },
108 { "1998023/114234", "", FALSE },
109 { "19980231:14234", "", FALSE },
110 { "19980231x14234", "", FALSE },
111 { "199802311:4234", "", FALSE },
112 { "199802311z4234", "", FALSE },
113 { "1998023111:234", "", FALSE },
114 { "1998023111&234", "", FALSE },
115 { "19980231114:34", "", FALSE },
116 { "19980231114#34", "", FALSE },
117 { "199802311142:4", "", FALSE },
118 { "199802311142!4", "", FALSE },
119 { "1998023111423:", "", FALSE },
120 { "1998023111423@", "", FALSE },
122 { "19980320114234--", "1998-03-20 11:42:34", TRUE },
123 { " 19980320114234", "", FALSE },
124 { "1998032011423", "", FALSE },
125 { "199803201142", "", FALSE },
126 { "19980320114", "", FALSE },
127 { "199803201", "", FALSE },
128 { "19980320", "", FALSE },
129 { "1998032", "", FALSE },
130 { "199803", "", FALSE },
131 { "19980", "", FALSE },
132 { "1998", "", FALSE },
133 { "199", "", FALSE },
134 { "19", "", FALSE },
135 { "1", "", FALSE },
136 { "", "", FALSE },
137 { "20260320114234.123", "2026-03-20 11:42:34", TRUE },
138 { "30260320114234.123", "3026-03-20 11:42:34", TRUE },
139 { "40260320114234.123", "4026-03-20 11:42:34", TRUE },
140 { "19980320114234\xff", "1998-03-20 11:42:34", TRUE },
141 { "1998\x7e""320114234\xff", "", FALSE },
142 { "1998\x7f""320114234\xff", "", FALSE },
143 { "1998\x80""320114234\xff", "", FALSE },
144 { "1998\x81""320114234\xff", "", FALSE },
145 { "1998\x82""320114234\xff", "", FALSE },
146 { "\xcc", "", FALSE },
147 { "\x55", "", FALSE },
148 };
150 size_t i;
151 bool all_ok = TRUE;
153 if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
154 curl_mfprintf(stderr, "curl_global_init() failed\n");
155 return TEST_ERR_MAJOR_BAD;
156 }
158 for(i = 0; i < CURL_ARRAYSIZE(test_specs); ++i) {
159 if(!test1668(&test_specs[i], i))
160 all_ok = FALSE;
161 }
162 fail_unless(all_ok, "some tests of ftp_213_date() failed");
163 curl_global_cleanup();
165 UNITTEST_END_SIMPLE
168#else /* without FTP */
170static CURLcode test_unit1668(const char *arg)
172 UNITTEST_BEGIN_SIMPLE
173 puts("not tested since FTP is disabled");
174 UNITTEST_END_SIMPLE
177#endif
Diagnostics4 git calls · 155 ms
CallStatusSizeTime0155 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
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 · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
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 · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=150
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
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
fetch2001.7 KiB150 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=1709
git.response.cache=MISS
git.response.duration_ms=150
git.fetch.wants=2c467b3c892aa0eb935b9ba22d9ced2f69197c51
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=1709
git.pkt.payload.max=1688
git.sideband.band1.bytes=1687
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
a5e2e66e69492947
Request
4f4535cc…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format