Artifactspublic-v0

curl

master
ply4 git calls221 ms292 KiB2 cachedprotocol v2
589 lines24 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###########################################################################
25import copy
26import inspect
27import logging
28import os
29import shutil
30import socket
31import subprocess
32import textwrap
33import time
34from datetime import datetime, timedelta, timezone
35from json import JSONEncoder
36from typing import ClassVar, Dict, List, Optional, Union
38from .curl import CurlClient, ExecResult
39from .env import Env, EnvError
40from .ports import alloc_ports_and_do
42log = logging.getLogger(__name__)
45class Httpd:
47 MODULES: ClassVar[List[str]] = [
48 'log_config', 'logio', 'unixd', 'version', 'watchdog',
49 'authn_core', 'authn_file',
50 'authz_user', 'authz_core', 'authz_host',
51 'auth_basic', 'auth_digest',
52 'alias', 'env', 'filter', 'headers', 'mime', 'setenvif', 'negotiation',
53 'socache_shmcb',
54 'rewrite', 'http2', 'ssl', 'proxy', 'proxy_http', 'proxy_connect',
55 'brotli',
56 'mpm_event',
57 ]
58 COMMON_MODULES_DIRS: ClassVar[List[str]] = [
59 '/usr/lib/apache2/modules', # debian
60 '/usr/libexec/apache2/', # macos
61 ]
63 MOD_CURLTEST = None
65 PORT_SPECS: ClassVar[Dict[str, int]] = {
66 'http': socket.SOCK_STREAM,
67 'https': socket.SOCK_STREAM,
68 'https-tcp-only': socket.SOCK_STREAM,
69 'proxy': socket.SOCK_STREAM,
70 'proxys': socket.SOCK_STREAM,
71 }
73 def __init__(self, env: Env):
74 self.env = env
75 self._apache_dir = os.path.join(env.gen_dir, 'apache')
76 self._run_dir = os.path.join(self._apache_dir, 'run')
77 self._lock_dir = os.path.join(self._apache_dir, 'locks')
78 self._docs_dir = os.path.join(self._apache_dir, 'docs')
79 self._conf_dir = os.path.join(self._apache_dir, 'conf')
80 self._conf_file = os.path.join(self._conf_dir, 'test.conf')
81 self._logs_dir = os.path.join(self._apache_dir, 'logs')
82 self._error_log = os.path.join(self._logs_dir, 'error_log')
83 self._tmp_dir = os.path.join(self._apache_dir, 'tmp')
84 self._basic_passwords = os.path.join(self._conf_dir, 'basic.passwords')
85 self._digest_passwords = os.path.join(self._conf_dir, 'digest.passwords')
86 self._mods_dir = None
87 self._auth_digest = True
88 self._proxy_auth_basic = False
89 # name used to lookup credentials for env.domain1
90 self._domain1_cred_name = env.domain1
91 self._extra_configs = {}
92 self._loaded_extra_configs = None
93 self._loaded_proxy_auth = None
94 self._loaded_domain1_cred_name = None
95 assert env.apxs
96 p = subprocess.run(args=[env.apxs, '-q', 'libexecdir'],
97 capture_output=True, text=True, check=True)
98 self._mods_dir = p.stdout.strip()
99 if self._mods_dir is None:
100 raise EnvError('apache modules directory cannot be found')
101 if not os.path.exists(self._mods_dir):
102 raise EnvError(f'apache modules directory does not exist: {self._mods_dir}')
103 self._maybe_running = False
104 self.ports = {}
105 self._rmf(self._error_log)
106 self._init_curltest()
108 @property
109 def docs_dir(self):
110 return self._docs_dir
112 def clear_logs(self):
113 self._rmf(self._error_log)
115 def exists(self):
116 return os.path.exists(self.env.httpd)
118 def set_extra_config(self, domain: str, lines: Optional[Union[str, List[str]]]):
119 if lines is None:
120 self._extra_configs.pop(domain, None)
121 else:
122 self._extra_configs[domain] = lines
124 def reset_config(self):
125 self._extra_configs = {}
126 self.set_proxy_auth(False)
127 self._domain1_cred_name = self.env.domain1
129 def set_proxy_auth(self, active: bool):
130 self._proxy_auth_basic = active
132 def set_domain1_cred_name(self, name):
133 self._domain1_cred_name = name
135 def _run(self, args, intext=''):
136 env = os.environ.copy()
137 env['APACHE_RUN_DIR'] = self._run_dir
138 env['APACHE_RUN_USER'] = os.environ['USER']
139 env['APACHE_LOCK_DIR'] = self._lock_dir
140 env['APACHE_CONFDIR'] = self._apache_dir
141 p = subprocess.run(args, capture_output=True, cwd=self.env.gen_dir,
142 input=intext.encode() if intext else None,
143 env=env, check=True)
144 start = datetime.now(timezone.utc)
145 return ExecResult(args=args, exit_code=p.returncode,
146 stdout=p.stdout.decode().splitlines(),
147 stderr=p.stderr.decode().splitlines(),
148 duration=datetime.now(timezone.utc) - start)
150 def _cmd_httpd(self, cmd: str):
151 args = [self.env.httpd,
152 "-d", self._apache_dir,
153 "-f", self._conf_file,
154 "-k", cmd]
155 return self._run(args=args)
157 def initial_start(self):
159 def startup(ports: Dict[str, int]) -> bool:
160 self.ports.update(ports)
161 if self.start():
162 self.env.update_ports(ports)
163 return True
164 self.stop()
165 self.ports.clear()
166 return False
168 return alloc_ports_and_do(Httpd.PORT_SPECS, startup,
169 self.env.gen_root, max_tries=3)
171 def start(self):
172 # assure ports are allocated
173 for key in Httpd.PORT_SPECS:
174 assert self.ports[key] is not None
175 if self._maybe_running:
176 self.stop()
177 self._write_config()
178 with open(self._error_log, 'a') as fd:
179 fd.write('start of server\n')
180 with open(os.path.join(self._apache_dir, 'xxx'), 'a') as fd:
181 fd.write('start of server\n')
182 r = self._cmd_httpd('start')
183 if r.exit_code != 0 or len(r.stderr):
184 log.error(f'failed to start httpd: {r}')
185 self.stop()
186 return False
187 self._loaded_extra_configs = copy.deepcopy(self._extra_configs)
188 self._loaded_proxy_auth = self._proxy_auth_basic
189 return self.wait_live(timeout=timedelta(seconds=Env.SERVER_TIMEOUT))
191 def stop(self):
192 r = self._cmd_httpd('stop')
193 self._loaded_extra_configs = None
194 self._loaded_proxy_auth = None
195 if r.exit_code == 0:
196 return self.wait_dead(timeout=timedelta(seconds=Env.SERVER_TIMEOUT))
197 log.fatal(f'stopping httpd failed: {r}')
198 return r.exit_code == 0
200 def reload(self):
201 self._write_config()
202 r = self._cmd_httpd("graceful")
203 if r.exit_code != 0:
204 log.error(f'failed to reload httpd: {r}')
205 return False
206 self._loaded_extra_configs = None
207 self._loaded_proxy_auth = None
208 if r.exit_code != 0:
209 log.error(f'failed to reload httpd: {r}')
210 self._loaded_extra_configs = copy.deepcopy(self._extra_configs)
211 self._loaded_proxy_auth = self._proxy_auth_basic
212 return self.wait_live(timeout=timedelta(seconds=Env.SERVER_TIMEOUT))
214 def reload_if_config_changed(self):
215 if self._maybe_running and \
216 self._loaded_extra_configs == self._extra_configs and \
217 self._loaded_proxy_auth == self._proxy_auth_basic and \
218 self._loaded_domain1_cred_name == self._domain1_cred_name:
219 return True
220 return self.reload()
222 def wait_dead(self, timeout: timedelta):
223 curl = CurlClient(env=self.env, run_dir=self._tmp_dir)
224 try_until = datetime.now(timezone.utc) + timeout
225 while datetime.now(timezone.utc) < try_until:
226 r = curl.http_get(url=f'http://{self.env.domain1}:{self.ports["http"]}/')
227 if r.exit_code != 0:
228 self._maybe_running = False
229 return True
230 time.sleep(.1)
231 log.debug(f"Server still responding after {timeout}")
232 return False
234 def wait_live(self, timeout: timedelta):
235 curl = CurlClient(env=self.env, run_dir=self._tmp_dir,
236 timeout=timeout.total_seconds())
237 try_until = datetime.now(timezone.utc) + timeout
238 while datetime.now(timezone.utc) < try_until:
239 r = curl.http_get(url=f'http://{self.env.domain1}:{self.ports["http"]}/')
240 if r.exit_code == 0:
241 self._maybe_running = True
242 return True
243 time.sleep(.1)
244 log.error(f"Server still not responding after {timeout}")
245 return False
247 def _rmf(self, path):
248 if os.path.exists(path):
249 os.remove(path)
251 def _mkpath(self, path):
252 if not os.path.exists(path):
253 os.makedirs(path)
255 def _write_config(self):
256 domain1 = self.env.domain1
257 domain1brotli = self.env.domain1brotli
258 creds1 = self.env.get_credentials(self._domain1_cred_name)
259 assert creds1 # convince pytype this is not None
260 self._loaded_domain1_cred_name = self._domain1_cred_name
261 domain2 = self.env.domain2
262 creds2 = self.env.get_credentials(domain2)
263 assert creds2 # convince pytype this is not None
264 exp_domain = self.env.expired_domain
265 exp_creds = self.env.get_credentials(exp_domain)
266 assert exp_creds # convince pytype this is not None
267 proxy_domain = self.env.proxy_domain
268 proxy_creds = self.env.get_credentials(proxy_domain)
269 assert proxy_creds # convince pytype this is not None
270 self._mkpath(self._conf_dir)
271 self._mkpath(self._docs_dir)
272 self._mkpath(self._logs_dir)
273 self._mkpath(self._tmp_dir)
274 self._mkpath(os.path.join(self._docs_dir, 'two'))
275 with open(os.path.join(self._docs_dir, 'data.json'), 'w') as fd:
276 data = {
277 'server': f'{domain1}',
278 }
279 fd.write(JSONEncoder().encode(data))
280 with open(os.path.join(self._docs_dir, 'two/data.json'), 'w') as fd:
281 data = {
282 'server': f'{domain2}',
283 }
284 fd.write(JSONEncoder().encode(data))
285 if self._proxy_auth_basic:
286 with open(self._basic_passwords, 'w') as fd:
287 fd.write('proxy:$apr1$FQfeInbs$WQZbODJlVg60j0ogEIlTW/\n')
288 if self._auth_digest:
289 with open(self._digest_passwords, 'w') as fd:
290 fd.write('test:restricted area:57123e269fd73d71ae0656594e938e2f\n')
291 self._mkpath(os.path.join(self.docs_dir, 'restricted/digest'))
292 with open(os.path.join(self.docs_dir, 'restricted/digest/data.json'), 'w') as fd:
293 fd.write('{"area":"digest"}\n')
294 with open(self._conf_file, 'w') as fd:
295 for m in self.MODULES:
296 if os.path.exists(os.path.join(self._mods_dir, f'mod_{m}.so')):
297 fd.write(f'LoadModule {m}_module "{self._mods_dir}/mod_{m}.so"\n')
298 if Httpd.MOD_CURLTEST is not None:
299 fd.write(f'LoadModule curltest_module "{Httpd.MOD_CURLTEST}"\n')
300 conf = [ # base server config
301 f'ServerRoot "{self._apache_dir}"',
302 'DefaultRuntimeDir logs',
303 'PidFile httpd.pid',
304 f'ServerName {self.env.tld}',
305 f'ErrorLog {self._error_log}',
306 f'LogLevel {self._get_log_level()}',
307 'StartServers 4',
308 'ReadBufferSize 16000',
309 'KeepAliveTimeout 30', # CI may exceed the default of 5 sec
310 'H2MinWorkers 16',
311 'H2MaxWorkers 256',
312 f'TypesConfig "{self._conf_dir}/mime.types',
313 'SSLSessionCache "shmcb:ssl_gcache_data(32000)"',
314 'AddEncoding x-gzip .gz .tgz .gzip',
315 'AddHandler type-map .var',
316 ]
317 conf.extend([f'Listen {port}' for port in self.ports.values()])
319 if 'base' in self._extra_configs:
320 conf.extend(self._extra_configs['base'])
321 conf.extend([ # plain http host for domain1
322 f'<VirtualHost *:{self.ports["http"]}>',
323 f' ServerName {domain1}',
324 ' ServerAlias localhost',
325 f' DocumentRoot "{self._docs_dir}"',
326 ' Protocols h2c http/1.1',
327 ' H2Direct on',
328 ])
329 conf.extend(self._curltest_conf(domain1))
330 conf.extend([
331 '</VirtualHost>',
332 '',
333 ])
334 conf.extend([ # https host for domain1, h1 + h2
335 f'<VirtualHost *:{self.ports["https"]}>',
336 f' ServerName {domain1}',
337 ' ServerAlias localhost',
338 ' Protocols h2 http/1.1',
339 ' SSLEngine on',
340 f' SSLCertificateFile {creds1.cert_file}',
341 f' SSLCertificateKeyFile {creds1.pkey_file}',
342 f' DocumentRoot "{self._docs_dir}"',
343 ])
344 conf.extend(self._curltest_conf(domain1))
345 if domain1 in self._extra_configs:
346 conf.extend(self._extra_configs[domain1])
347 conf.extend([
348 '</VirtualHost>',
349 '',
350 ])
351 conf.extend([ # https host for domain1, h1 + h2, tcp only
352 f'<VirtualHost *:{self.ports["https-tcp-only"]}>',
353 f' ServerName {domain1}',
354 ' ServerAlias localhost',
355 ' Protocols h2 http/1.1',
356 ' SSLEngine on',
357 f' SSLCertificateFile {creds1.cert_file}',
358 f' SSLCertificateKeyFile {creds1.pkey_file}',
359 f' DocumentRoot "{self._docs_dir}"',
360 ])
361 conf.extend(self._curltest_conf(domain1))
362 if domain1 in self._extra_configs:
363 conf.extend(self._extra_configs[domain1])
364 conf.extend([
365 '</VirtualHost>',
366 '',
367 ])
368 # Alternate to domain1 with BROTLI compression
369 conf.extend([ # https host for domain1, h1 + h2
370 f'<VirtualHost *:{self.ports["https"]}>',
371 f' ServerName {domain1brotli}',
372 ' Protocols h2 http/1.1',
373 ' SSLEngine on',
374 f' SSLCertificateFile {creds1.cert_file}',
375 f' SSLCertificateKeyFile {creds1.pkey_file}',
376 f' DocumentRoot "{self._docs_dir}"',
377 ' SetOutputFilter BROTLI_COMPRESS',
378 ])
379 conf.extend(self._curltest_conf(domain1))
380 if domain1 in self._extra_configs:
381 conf.extend(self._extra_configs[domain1])
382 conf.extend([
383 '</VirtualHost>',
384 '',
385 ])
386 conf.extend([ # plain http host for domain2
387 f'<VirtualHost *:{self.ports["http"]}>',
388 f' ServerName {domain2}',
389 ' ServerAlias localhost',
390 f' DocumentRoot "{self._docs_dir}"',
391 ' Protocols h2c http/1.1',
392 ])
393 conf.extend(self._curltest_conf(domain2))
394 conf.extend([
395 '</VirtualHost>',
396 '',
397 ])
398 self._mkpath(os.path.join(self._docs_dir, 'two'))
399 conf.extend([ # https host for domain2, no h2
400 f'<VirtualHost *:{self.ports["https"]}>',
401 f' ServerName {domain2}',
402 ' Protocols http/1.1',
403 ' SSLEngine on',
404 f' SSLCertificateFile {creds2.cert_file}',
405 f' SSLCertificateKeyFile {creds2.pkey_file}',
406 f' DocumentRoot "{self._docs_dir}/two"',
407 ])
408 conf.extend(self._curltest_conf(domain2))
409 if domain2 in self._extra_configs:
410 conf.extend(self._extra_configs[domain2])
411 conf.extend([
412 '</VirtualHost>',
413 '',
414 ])
415 conf.extend([ # https host for domain2, no h2, tcp only
416 f'<VirtualHost *:{self.ports["https-tcp-only"]}>',
417 f' ServerName {domain2}',
418 ' Protocols http/1.1',
419 ' SSLEngine on',
420 f' SSLCertificateFile {creds2.cert_file}',
421 f' SSLCertificateKeyFile {creds2.pkey_file}',
422 f' DocumentRoot "{self._docs_dir}/two"',
423 ])
424 conf.extend(self._curltest_conf(domain2))
425 if domain2 in self._extra_configs:
426 conf.extend(self._extra_configs[domain2])
427 conf.extend([
428 '</VirtualHost>',
429 '',
430 ])
431 self._mkpath(os.path.join(self._docs_dir, 'expired'))
432 conf.extend([ # https host for expired domain
433 f'<VirtualHost *:{self.ports["https"]}>',
434 f' ServerName {exp_domain}',
435 ' Protocols h2 http/1.1',
436 ' SSLEngine on',
437 f' SSLCertificateFile {exp_creds.cert_file}',
438 f' SSLCertificateKeyFile {exp_creds.pkey_file}',
439 f' DocumentRoot "{self._docs_dir}/expired"',
440 ])
441 conf.extend(self._curltest_conf(exp_domain))
442 if exp_domain in self._extra_configs:
443 conf.extend(self._extra_configs[exp_domain])
444 conf.extend([
445 '</VirtualHost>',
446 '',
447 ])
448 conf.extend([ # http forward proxy
449 f'<VirtualHost *:{self.ports["proxy"]}>',
450 f' ServerName {proxy_domain}',
451 ' Protocols h2c http/1.1',
452 ' ProxyRequests On',
453 ' H2ProxyRequests On',
454 ' ProxyVia On',
455 f' AllowCONNECT {self.ports["http"]} {self.ports["https"]}',
456 ])
457 conf.extend(self._get_proxy_conf())
458 conf.extend([
459 '</VirtualHost>',
460 '',
461 ])
462 conf.extend([ # https forward proxy
463 f'<VirtualHost *:{self.ports["proxys"]}>',
464 f' ServerName {proxy_domain}',
465 ' Protocols h2 http/1.1',
466 ' SSLEngine on',
467 f' SSLCertificateFile {proxy_creds.cert_file}',
468 f' SSLCertificateKeyFile {proxy_creds.pkey_file}',
469 ' ProxyRequests On',
470 ' H2ProxyRequests On',
471 ' ProxyVia On',
472 f' AllowCONNECT {self.ports["http"]} {self.ports["https"]}',
473 ])
474 conf.extend(self._get_proxy_conf())
475 conf.extend([
476 '</VirtualHost>',
477 '',
478 ])
480 fd.write("\n".join(conf))
481 with open(os.path.join(self._conf_dir, 'mime.types'), 'w') as fd:
482 fd.write(textwrap.dedent("""\
483 text/plain txt
484 text/html html
485 application/json json
486 application/x-gzip gzip
487 application/x-gzip gz
488 """))
490 def _get_proxy_conf(self):
491 if self._proxy_auth_basic:
492 return [
493 ' <Proxy "*">',
494 ' AuthType Basic',
495 ' AuthName "Restricted Proxy"',
496 ' AuthBasicProvider file',
497 f' AuthUserFile "{self._basic_passwords}"',
498 ' Require user proxy',
499 ' </Proxy>',
500 ]
501 return [
502 ' <Proxy "*">',
503 ' Require ip 127.0.0.1',
504 ' Require ip ::1',
505 ' </Proxy>',
506 ]
508 def _get_log_level(self):
509 if self.env.verbose > 3:
510 return 'trace2'
511 if self.env.verbose > 2:
512 return 'trace1'
513 if self.env.verbose > 1:
514 return 'debug'
515 return 'info'
517 def _curltest_conf(self, servername) -> List[str]:
518 lines = []
519 if Httpd.MOD_CURLTEST is not None:
520 lines.extend([
521 ' Redirect 302 /data.json.302 /data.json',
522 ' Redirect 301 /curltest/echo301 /curltest/echo',
523 ' Redirect 302 /curltest/echo302 /curltest/echo',
524 ' Redirect 303 /curltest/echo303 /curltest/echo',
525 ' Redirect 307 /curltest/echo307 /curltest/echo',
526 ' <Location /curltest/sslinfo>',
527 ' SSLOptions StdEnvVars',
528 ' SetHandler curltest-sslinfo',
529 ' </Location>',
530 ' <Location /curltest/echo>',
531 ' SetHandler curltest-echo',
532 ' </Location>',
533 ' <Location /curltest/limit>',
534 ' SetHandler curltest-limit',
535 ' </Location>',
536 ' <Location /curltest/put>',
537 ' SetHandler curltest-put',
538 ' </Location>',
539 ' <Location /curltest/tweak>',
540 ' SetHandler curltest-tweak',
541 ' </Location>',
542 ' Redirect 302 /tweak /curltest/tweak',
543 ' <Location /curltest/1_1>',
544 ' SetHandler curltest-1_1-required',
545 ' </Location>',
546 ' <Location /curltest/shutdown_unclean>',
547 ' SetHandler curltest-tweak',
548 ' SetEnv force-response-1.0 1',
549 ' </Location>',
550 ' SetEnvIf Request_URI "/shutdown_unclean" ssl-unclean=1',
551 ' RewriteEngine on',
552 ' RewriteRule "^/curltest/put-redir-301$" "/curltest/put" [R=301]',
553 ' RewriteRule "^/curltest/put-redir-302$" "/curltest/put" [R=302]',
554 ' RewriteRule "^/curltest/put-redir-307$" "/curltest/put" [R=307]',
555 ' RewriteRule "^/curltest/put-redir-308$" "/curltest/put" [R=308]',
556 ])
557 if self._auth_digest:
558 lines.extend([
559 f' <Directory {self.docs_dir}/restricted/digest>',
560 ' AuthType Digest',
561 ' AuthName "restricted area"',
562 f' AuthDigestDomain "https://{servername}"',
563 ' AuthBasicProvider file',
564 f' AuthUserFile "{self._digest_passwords}"',
565 ' Require valid-user',
566 ' </Directory>',
568 ])
569 return lines
571 def _init_curltest(self):
572 if Httpd.MOD_CURLTEST is not None:
573 return
574 local_dir = os.path.dirname(inspect.getfile(Httpd))
575 out_dir = os.path.join(self.env.gen_dir, 'mod_curltest')
576 in_source = os.path.join(local_dir, 'mod_curltest/mod_curltest.c')
577 out_source = os.path.join(out_dir, 'mod_curltest.c')
578 if not os.path.exists(out_dir):
579 os.mkdir(out_dir)
580 if not os.path.exists(out_source) or \
581 os.stat(in_source).st_mtime > os.stat(out_source).st_mtime:
582 shutil.copy(in_source, out_source)
583 p = subprocess.run([self.env.apxs, '-c', out_source],
584 capture_output=True, cwd=out_dir, check=False)
585 rv = p.returncode
586 if rv != 0:
587 log.error(f"compiling mod_curltest failed: {p.stderr}")
588 raise EnvError(f"compiling mod_curltest failed: {p.stderr}")
589 Httpd.MOD_CURLTEST = os.path.join(out_dir, '.libs/mod_curltest.so')
Diagnostics4 git calls · 221 ms
CallStatusSizeTime0221 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 · hit4 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=214
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=4
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
fetch2005.5 KiB214 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=5650
git.response.cache=MISS
git.response.duration_ms=214
git.fetch.wants=63dd01145f9e4a185ecd6783fd01f1eaaa647e64
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=5650
git.pkt.payload.max=5629
git.sideband.band1.bytes=5628
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
a5e2b00f8a03e6b0
Request
59405356…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format