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"
25#include "vssh/vssh.h"
27static CURLcode test_unit2604(const char *arg)
28{
29 UNITTEST_BEGIN_SIMPLE
31#ifdef USE_SSH
33 struct set {
34 const char *cp;
35 const char *expect; /* the returned content */
36 const char *next; /* what cp points to after the call */
37 const char *home;
38 CURLcode result;
39 };
41#ifdef CURL_HAVE_DIAG
42#pragma GCC diagnostic push
43#pragma GCC diagnostic ignored "-Woverlength-strings"
44#endif
46/* 60 a's */
47#define SA60 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
48/* 540 a's */
49#define SA540 SA60 SA60 SA60 SA60 SA60 SA60 SA60 SA60 SA60
50 int i;
51 const size_t too_long = 90720;
52 struct set list[] = {
53 { "-too-long-", "", "", "", CURLE_TOO_LARGE },
54 { SA540 " c", SA540, "c", "/", CURLE_OK },
55 { "\" " SA540 "\" c", " " SA540, "c", "/", CURLE_OK },
56 { "a a", "a", "a", "/home/", CURLE_OK },
57 { "b a", "b", "a", "/", CURLE_OK },
58 { "a", "a", "", "/home/", CURLE_OK },
59 { "b", "b", "", "/", CURLE_OK },
60 { "\"foo bar\"\tb", "foo bar", "b", "/", CURLE_OK },
61 { "/~/hej", "/home/user/hej", "", "/home/user", CURLE_OK },
62 { "\"foo bar", "", "", "/", CURLE_QUOTE_ERROR },
63 { "\"foo\\\"bar\" a", "foo\"bar", "a", "/", CURLE_OK },
64 { "\"foo\\\'bar\" b", "foo\'bar", "b", "/", CURLE_OK },
65 { "\"foo\\\\bar\" c", "foo\\bar", "c", "/", CURLE_OK },
66 { "\"foo\\pbar\" c", "foo\\bar", "", "/", CURLE_QUOTE_ERROR },
67 { "\"\" c", "", "", "", CURLE_QUOTE_ERROR },
68 { "foo\"", "foo\"", "", "/", CURLE_OK },
69 { "foo \"", "foo", "\"", "/", CURLE_OK },
70 { " \t\t \t ", "", "", "/", CURLE_QUOTE_ERROR },
71 { " ", "", "", "/", CURLE_QUOTE_ERROR },
72 { "", "", "", "/", CURLE_QUOTE_ERROR },
73 { " \r \n ", "\r", "\n ", "/", CURLE_OK },
74 { NULL, NULL, NULL, NULL, CURLE_OK }
75 };
77#ifdef CURL_HAVE_DIAG
78#pragma GCC diagnostic pop
79#endif
81 char *cp0 = curlx_calloc(1, too_long + 1);
82 fail_unless(cp0, "could not alloc too long value");
83 memset(cp0, 'a', too_long);
85 for(i = 0; list[i].home; i++) {
86 char *path;
87 const char *cp = i == 0 ? cp0 : list[i].cp;
88 CURLcode result = Curl_get_pathname(&cp, &path, list[i].home);
89 curl_mprintf("%d - Curl_get_pathname(\"%s\", ... \"%s\") == %d\n", i,
90 list[i].cp, list[i].home, (int)list[i].result);
91 if(result != list[i].result) {
92 curl_mprintf("... returned %d\n", (int)result);
93 unitfail++;
94 }
95 if(!result) {
96 if(cp && strcmp(cp, list[i].next)) {
97 curl_mprintf("... cp points to '%s', not '%s' as expected\n",
98 cp, list[i].next);
99 unitfail++;
100 }
101 if(path && strcmp(path, list[i].expect)) {
102 curl_mprintf("... gave '%s', not '%s' as expected\n",
103 path, list[i].expect);
104 unitfail++;
105 }
106 curl_free(path);
107 }
108 }
110 curlx_free(cp0);
112#endif
114 UNITTEST_END_SIMPLE
115}
Diagnostics4 git calls · 283 ms
CallStatusSizeTime0283 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 · hit26 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=26 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.5 KiB255 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=255 git.response.bytes=1505 git.response.cache=MISS git.response.duration_ms=255 git.fetch.wants=770aec15be85cad110955db2f0a5f70ac503f1f8 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=1505 git.pkt.payload.max=1484 git.sideband.band1.bytes=1483 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
- a5e1fddb6af9a9c0
- Request
- bcb88da1…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format