Artifactspublic-v0

curl

master
ply4 git calls26 ms289 KiB3 cachedprotocol v2
189 lines5.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.
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 "first.h"
26#if defined(USE_SSL) && defined(USE_SSLS_EXPORT)
28#define T1678_IMPORT_COUNT 64
29#define T1678_FIRST_TICKET_SIZE 4096
30#define T1678_FIRST_QUICTP_SIZE 127
31#define T1678_FIRST_ALPN_SIZE 10
33static uint8_t *t1678_make_packet(size_t *packet_len)
35 const size_t t1678_total =
36 1 + /* format version */
37 1 + 2 + T1678_FIRST_TICKET_SIZE + /* first ticket */
38 1 + 2 + T1678_FIRST_QUICTP_SIZE + /* first QUIC traffic params */
39 1 + 2 + T1678_FIRST_ALPN_SIZE + /* first ALPN params */
40 1 + 2 + 1 + /* second ticket */
41 1 + 2 + 1 + /* second ALPN */
42 1 + 2 + 1; /* second QUIC traffic params */
44 uint8_t *packet = curlx_malloc(t1678_total);
45 uint8_t *p;
47 if(!packet)
48 return NULL;
50 p = packet;
52 /* CURL_SPACK_VERSION */
53 *p++ = 0x01;
55 /* First CURL_SPACK_TICKET */
56 *p++ = 0x04;
57 *p++ = (uint8_t)(T1678_FIRST_TICKET_SIZE >> 8);
58 *p++ = (uint8_t)(T1678_FIRST_TICKET_SIZE & 0x0ff);
59 memset(p, 'A', T1678_FIRST_TICKET_SIZE);
60 p += T1678_FIRST_TICKET_SIZE;
62 /* First CURL_SPACK_QUICTP */
63 *p++ = 0x07;
64 *p++ = (uint8_t)(T1678_FIRST_QUICTP_SIZE >> 8);
65 *p++ = (uint8_t)(T1678_FIRST_QUICTP_SIZE & 0x0ff);
66 memset(p, 'Q', T1678_FIRST_QUICTP_SIZE);
67 p += T1678_FIRST_QUICTP_SIZE;
69 /* First CURL_SPACK_ALPN */
70 *p++ = 0x05;
71 *p++ = (uint8_t)(T1678_FIRST_ALPN_SIZE >> 8);
72 *p++ = (uint8_t)(T1678_FIRST_ALPN_SIZE & 0x0ff);
73 memset(p, 'a', T1678_FIRST_ALPN_SIZE);
74 p += T1678_FIRST_ALPN_SIZE;
76 /* Second CURL_SPACK_TICKET: one byte. */
77 *p++ = 0x04;
78 *p++ = 0x00;
79 *p++ = 0x01;
80 *p++ = 'B';
82 /* Second CURL_SPACK_ALPN: one byte. */
83 *p++ = 0x05;
84 *p++ = 0x00;
85 *p++ = 0x01;
86 *p++ = 'b';
88 /* Second CURL_SPACK_QUICTP: one byte. */
89 *p++ = 0x07;
90 *p++ = 0x00;
91 *p++ = 0x01;
92 *p++ = 'R';
94 *packet_len = t1678_total;
95 return packet;
98static CURLcode test_lib1678(const char *URL)
100 uint8_t *packet;
101 size_t packet_len;
102 CURLSH *share = NULL;
103 CURL *easy = NULL;
104 CURLSHcode shrc;
105 CURLcode result = CURLE_FAILED_INIT;
106 int i;
108 (void)URL;
109 packet = t1678_make_packet(&packet_len);
110 if(!packet)
111 goto test_cleanup;
113 result = curl_global_init(CURL_GLOBAL_ALL);
114 if(result != CURLE_OK)
115 goto test_cleanup;
117 share = curl_share_init();
118 easy = curl_easy_init();
120 if(!share || !easy)
121 goto test_cleanup;
123 shrc = curl_share_setopt(share,
124 CURLSHOPT_SHARE,
125 CURL_LOCK_DATA_SSL_SESSION);
126 if(shrc != CURLSHE_OK)
127 goto test_cleanup;
129 result = curl_easy_setopt(easy, CURLOPT_SHARE, share);
130 if(result)
131 goto test_cleanup;
133 if(curl_easy_ssls_import(NULL, "example.test:443", NULL, 0, packet,
134 packet_len) != CURLE_BAD_FUNCTION_ARGUMENT) {
135 result = CURLE_BAD_FUNCTION_ARGUMENT;
136 goto test_cleanup;
137 }
138 if(curl_easy_ssls_import(easy, "example.test:443", NULL, 0, NULL,
139 packet_len) != CURLE_BAD_FUNCTION_ARGUMENT) {
140 result = CURLE_BAD_FUNCTION_ARGUMENT;
141 goto test_cleanup;
142 }
143 if(curl_easy_ssls_import(easy, "example.test:443", NULL, 0, packet, 0) !=
144 CURLE_BAD_FUNCTION_ARGUMENT) {
145 result = CURLE_BAD_FUNCTION_ARGUMENT;
146 goto test_cleanup;
147 }
148 if(curl_easy_ssls_export(NULL, NULL, NULL) !=
149 CURLE_BAD_FUNCTION_ARGUMENT) {
150 result = CURLE_BAD_FUNCTION_ARGUMENT;
151 goto test_cleanup;
152 }
153 if(curl_easy_ssls_export(easy, NULL, NULL) !=
154 CURLE_BAD_FUNCTION_ARGUMENT) {
155 result = CURLE_BAD_FUNCTION_ARGUMENT;
156 goto test_cleanup;
157 }
159 for(i = 0; i < T1678_IMPORT_COUNT; ++i) {
160 result = curl_easy_ssls_import(easy,
161 "example.test:443",
162 NULL,
163 0,
164 packet,
165 packet_len);
166 if(result) {
167 curl_mfprintf(stderr,
168 "import %d failed: %d (%s)\n",
169 i, (int)result,
170 curl_easy_strerror(result));
171 break;
172 }
173 }
175test_cleanup:
176 curlx_free(packet);
177 curl_easy_cleanup(easy);
178 curl_share_cleanup(share);
179 curl_global_cleanup();
181 return result;
183#else
184static CURLcode test_lib1678(const char *URL)
186 (void)URL;
187 return CURLE_OK;
189#endif /* USE_SSL && USE_SSLS_EXPORT */
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=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=22
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 KiB · hit22 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=1710
git.response.cache=HIT
git.response.duration_ms=22
git.fetch.wants=d754f32118d66cee07a726239699d26d6d8c4a6c
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=1710
git.pkt.payload.max=1689
git.sideband.band1.bytes=1688
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
a5e337beb98824ce
Request
ce14cf1d…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format