master
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"
26static CURLcode test_unit4781(const char *arg)
27{
28#ifndef CURL_DISABLE_PARSEDATE
29 unsigned int i;
30 int errors = 0;
31 struct day {
32 const char *name;
33 int val;
34 };
36 /* three-letter version or full version, nothing else */
37 static const struct day days[] = {
38 { "wedmesday", -1 },
39 { "monray", -1 },
40 { "mon", 0 },
41 { "tue", 1 },
42 { "wed", 2 },
43 { "thu", 3 },
44 { "fri", 4 },
45 { "sat", 5 },
46 { "sun", 6 },
47 { "monday", 0 },
48 { "tuesday", 1 },
49 { "wednesday", 2 },
50 { "thursday", 3 },
51 { "friday", 4 },
52 { "saturday", 5 },
53 { "sunday", 6 },
54 { "monDAY", 0 },
55 { "tueSDAY", 1 },
56 { "wedneSDAY", 2 },
57 { "thursdAY", 3 },
58 { "frIDAY", 4 },
59 { "satURDAY", 5 },
60 { "suNDAY", 6 },
61 { "monda", -1 },
62 { "tuesda", -1 },
63 { "wednesda", -1 },
64 { "thursda", -1 },
65 { "frida", -1 },
66 { "saturda", -1 },
67 { "sunda", -1 },
68 { "MON", 0 },
69 { "TUE", 1 },
70 { "WED", 2 },
71 { "THU", 3 },
72 { "FRI", 4 },
73 { "SAT", 5 },
74 { "SUN", 6 },
75 { "mo", -1 },
76 { "tu", -1 },
77 { "we", -1 },
78 { "th", -1 },
79 { "fr", -1 },
80 { "sa", -1 },
81 { "su", -1 },
82 { "mom", -1 },
83 { "tuf", -1 },
84 { "wef", -1 },
85 { "thv", -1 },
86 { "frj", -1 },
87 { "sau", -1 },
88 { "sum", -1 },
89 { "abc", -1 },
90 { " monday", -1 },
91 { " tuesday", -1 },
92 { " wednesday", -1 },
93 { " thursday", -1 },
94 { " friday", -1 },
95 { " saturday", -1 },
96 { " sunday", -1 },
97 { "monday ", -1 },
98 { "tuesday ", -1 },
99 { "wednesday ", -1 },
100 { "thursday ", -1 },
101 { "friday ", -1 },
102 { "saturday ", -1 },
103 { "sunday ", -1 },
104 };
106 /* three-letter month versions only */
107 static const struct day months[] = {
108 { "monday", -1 },
109 { "tuesday", -1 },
110 { "wednesday", -1 },
111 { "thursday", -1 },
112 { "friday", -1 },
113 { "saturday", -1 },
114 { "jan", 0 },
115 { "feb", 1 },
116 { "mar", 2 },
117 { "apr", 3 },
118 { "may", 4 },
119 { "jun", 5 },
120 { "jul", 6 },
121 { "aug", 7 },
122 { "sep", 8 },
123 { "oct", 9 },
124 { "nov", 10 },
125 { "dec", 11 },
126 { "january", -1 },
127 { "february", -1 },
128 { "march", -1 },
129 { "april", -1 },
130 { "june", -1 },
131 { "july", -1 },
132 { "august", -1 },
133 { "september", -1 },
134 { "october", -1 },
135 { "november", -1 },
136 { "december", -1 },
137 { "janu", -1 },
138 { "febr", -1 },
139 { "marc", -1 },
140 { "apri", -1 },
141 { "june", -1 },
142 { "july", -1 },
143 { "augu", -1 },
144 { "sept", -1 },
145 { "octo", -1 },
146 { "nove", -1 },
147 { "dece", -1 },
148 { "JAN", 0 },
149 { "FEB", 1 },
150 { "MAR", 2 },
151 { "APR", 3 },
152 { "MAY", 4 },
153 { "JUN", 5 },
154 { "JUL", 6 },
155 { "AUG", 7 },
156 { "SEP", 8 },
157 { "OCT", 9 },
158 { "NOV", 10 },
159 { "DEC", 11 },
160 };
162 static const struct day timezones[] = {
163 { "A", -3600 },
164 { "B", -7200 },
165 { "a", -1 },
166 { "b", -1 },
167 { "C", -10800 },
168 { "D", -14400 },
169 { "E", -18000 },
170 { "F", -21600 },
171 { "G", -25200 },
172 { "H", -28800 },
173 { "I", -32400 },
174 { "J", -1 },
175 { "K", -36000 },
176 { "L", -39600 },
177 { "M", -43200 },
178 { "N", 3600 },
179 { "O", 7200 },
180 { "P", 10800 },
181 { "Q", 14400 },
182 { "R", 18000 },
183 { "S", 21600 },
184 { "T", 25200 },
185 { "U", 28800 },
186 { "V", 32400 },
187 { "X", 39600 },
188 { "Y", 43200 },
189 { "Z", 0 },
190 { "z", -1 },
191 { "@", -1 },
193 { "NT", 39600 },
194 { "UT", 0 },
195 { "nt", -1 },
196 { "ut", -1 },
197 { "PT", -1 },
198 { "CT", -1 },
200 { "ADT", 10800 },
201 { "AST", 14400 },
202 { "BST", -3600 },
203 { "CAT", 36000 },
204 { "CCT", -28800 },
205 { "CDT", 18000 },
206 { "CET", -3600 },
207 { "CST", 21600 },
208 { "EDT", 14400 },
209 { "EET", -7200 },
210 { "EST", 18000 },
211 { "FST", -7200 },
212 { "FWT", -3600 },
213 { "GMT", 0 },
214 { "GST", -36000 },
215 { "HDT", 32400 },
216 { "HST", 36000 },
217 { "JST", -32400 },
218 { "MDT", 21600 },
219 { "MET", -3600 },
220 { "MST", 25200 },
221 { "NZT", -43200 },
222 { "PDT", 25200 },
223 { "PST", 28800 },
224 { "UTC", 0 },
225 { "WAT", 3600 },
226 { "WET", 0 },
227 { "YDT", 28800 },
228 { "YST", 32400 },
229 { "yST", -1 },
230 { "ZST", -1 },
232 { "AHST", 36000 },
233 { "BHST", -1 },
234 { "ahst", -1 },
235 { "CEST", -7200 },
236 { "cest", -1 },
237 { "EADT", -39600 },
238 { "EAST", -36000 },
239 { "IDLE", -43200 },
240 { "IDLW", 43200 },
241 { "MEST", -7200 },
242 { "MESZ", -7200 },
243 { "MEWT", -3600 },
244 { "NZDT", -46800 },
245 { "NZST", -43200 },
246 { "WADT", -28800 },
247 { "WAST", -25200 } /* spellchecker:disable-line */
248 };
250 (void)arg;
252 for(i = 0; i < CURL_ARRAYSIZE(days); i++) {
253 int d = checkday(days[i].name, strlen(days[i].name));
254 if(d != days[i].val) {
255 curl_mfprintf(stderr, "Day: %s returned %d, expected %d\n",
256 days[i].name, d, days[i].val);
257 errors++;
258 }
259 }
260 for(i = 0; i < CURL_ARRAYSIZE(months); i++) {
261 int d = checkmonth(months[i].name, strlen(months[i].name));
262 if(d != months[i].val) {
263 curl_mfprintf(stderr, "Month: %s returned %d, expected %d\n",
264 months[i].name, d, months[i].val);
265 errors++;
266 }
267 }
268 for(i = 0; i < CURL_ARRAYSIZE(timezones); i++) {
269 int d = checktz(timezones[i].name, strlen(timezones[i].name));
270 if(d != timezones[i].val) {
271 curl_mfprintf(stderr, "TZ: %s returned %d, expected %d\n",
272 timezones[i].name, d, timezones[i].val);
273 errors++;
274 }
275 }
276 if(errors)
277 return CURLE_BAD_FUNCTION_ARGUMENT;
278#else /* CURL_DISABLE_PARSEDATE */
279 /* nothing to do */
280 (void)arg;
281#endif
282 return CURLE_OK;
283}
Diagnostics4 git calls · 387 ms
CallStatusSizeTime0387 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=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 · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=383 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=86Open pack map
fetch2001.9 KiB383 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=1909 git.response.cache=MISS git.response.duration_ms=383 git.fetch.wants=962352bb3e6317c80ed85136b37c826c558c6734 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=1909 git.pkt.payload.max=1888 git.sideband.band1.bytes=1887 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
- a5e2eb646c914bc2
- Request
- 557277b1…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format