Artifactspublic-v0

curl

master
ply4 git calls38 ms289 KiB3 cachedprotocol v2
189 lines6.3 KiBRaw
1#ifndef HEADER_SERVER_FIRST_H
2#define HEADER_SERVER_FIRST_H
3/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11 *
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at https://curl.se/docs/copyright.html.
15 *
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 * SPDX-License-Identifier: curl
24 *
25 ***************************************************************************/
27/* Test servers are standalone programs that do not use libcurl
28 * library. For convenience and to ease portability of these servers,
29 * some source code files from the libcurl subdirectory are also used
30 * to build the servers. In order to achieve proper linkage of these
31 * files on Windows targets it is necessary to build the test servers
32 * with CURL_STATICLIB defined, independently of how libcurl is built.
33 * For other platforms, this macro is a no-op and safe to set.
34 */
35#define CURL_STATICLIB
37#define WITHOUT_LIBCURL
38#define CURL_NO_OLDIES
40#include "curl_setup.h"
42typedef int (*entry_func_t)(int, const char **);
44struct entry_s {
45 const char *name;
46 entry_func_t ptr;
47};
49extern const struct entry_s s_entries[];
51#include <signal.h>
52#ifdef HAVE_NETINET_IN_H
53#include <netinet/in.h>
54#endif
55#ifdef HAVE_NETINET_IN6_H
56#include <netinet/in6.h>
57#endif
58#ifdef HAVE_ARPA_INET_H
59#include <arpa/inet.h>
60#endif
61#ifdef HAVE_NETDB_H
62#include <netdb.h>
63#endif
65#include "curlx/base64.h" /* for curlx_base64* */
66#include "curlx/win32-fopen.h" /* for curlx_f*() */
67#include "curlx/inet_ntop.h" /* for curlx_inet_ntop() */
68#include "curlx/inet_pton.h" /* for curlx_inet_pton() */
69#include "curlx/nonblock.h" /* for curlx_nonblock() */
70#include "curlx/strcopy.h" /* for curlx_strcopy() */
71#include "curlx/strerr.h" /* for curlx_strerror() */
72#include "curlx/strparse.h" /* for curlx_str_* parsing functions */
73#include "curlx/timediff.h" /* for timediff_t type and related functions */
74#include "curlx/timeval.h" /* for curlx_now type and related functions */
75#include "curlx/wait.h" /* for curlx_wait_ms() */
76#include "curlx/winapi.h" /* for curlx_winapi_strerror() */
78#ifdef _WIN32
79#include <curlx/snprintf.h>
80#define snprintf curlx_win32_snprintf
81#endif
83#ifdef _WIN32
84# define CURL_STRNICMP(p1, p2, n) _strnicmp(p1, p2, n)
85#elif defined(HAVE_STRCASECMP)
86# ifdef HAVE_STRINGS_H
87# include <strings.h>
88# endif
89# define CURL_STRNICMP(p1, p2, n) strncasecmp(p1, p2, n)
90#elif defined(HAVE_STRCMPI)
91# define CURL_STRNICMP(p1, p2, n) strncmpi(p1, p2, n)
92#elif defined(HAVE_STRICMP)
93# define CURL_STRNICMP(p1, p2, n) strnicmp(p1, p2, n)
94#else
95# error "missing case insensitive comparison function"
96#endif
98enum {
99 DOCNUMBER_NOTHING = -7,
100 DOCNUMBER_QUIT = -6,
101 DOCNUMBER_BADCONNECT = -5,
102 DOCNUMBER_INTERNAL = -4,
103 DOCNUMBER_CONNECT = -3,
104 DOCNUMBER_WERULEZ = -2,
105 DOCNUMBER_404 = -1
106};
108#ifdef USE_UNIX_SOCKETS
109#ifdef HAVE_SYS_UN_H
110#include <sys/un.h> /* for sockaddr_un */
111#endif
112#endif /* USE_UNIX_SOCKETS */
114typedef union {
115 struct sockaddr sa;
116 struct sockaddr_in sa4;
117#ifdef USE_IPV6
118 struct sockaddr_in6 sa6;
119#endif
120#ifdef USE_UNIX_SOCKETS
121 struct sockaddr_un sau;
122#endif
123} srvr_sockaddr_union_t;
125/* getpart */
126#define GPE_NO_BUFFER_SPACE (-2)
127#define GPE_OUT_OF_MEMORY (-1)
128#define GPE_OK 0
129#define GPE_END_OF_FILE 1
131extern int getpart(char **outbuf, size_t *outlen,
132 const char *main, const char *sub, FILE *stream);
134/* utility functions */
135extern void logmsg(const char *msg, ...) CURL_PRINTF(1, 2);
136extern void loghex(const unsigned char *buffer, ssize_t len);
137extern int win32_init(void);
138extern FILE *test2fopen(long testno, const char *logdir2);
139extern curl_off_t our_getpid(void);
140extern int write_pidfile(const char *filename);
141extern int write_portfile(const char *filename, int port);
142extern void set_advisor_read_lock(const char *filename);
143extern void clear_advisor_read_lock(const char *filename);
144extern void storerequest(const char *reqbuf, size_t totalsize,
145 const char *filename);
146static volatile int got_exit_signal = 0;
147static volatile int exit_signal = 0;
148#ifdef _WIN32
149static HANDLE exit_event = NULL;
150#endif
151static volatile const char *exit_msg = NULL;
152extern void install_signal_handlers(bool keep_sigalrm);
153extern void restore_signal_handlers(bool keep_sigalrm);
154#ifdef USE_UNIX_SOCKETS
155extern int bind_unix_socket(curl_socket_t sock, const char *unix_socket,
156 struct sockaddr_un *sau);
157#endif
158extern curl_socket_t sockdaemon(curl_socket_t sock,
159 uint16_t *listenport,
160 const char *unix_socket,
161 bool bind_only);
162extern int open_udp_sock(curl_socket_t *psock, uint16_t *pport);
163extern int open_stream_sock(curl_socket_t *psock, uint16_t *pport);
164extern curl_socket_t accept_connection(curl_socket_t listen_sock);
165extern bool curlx_str_case_equal(const struct Curl_str *s1,
166 const struct Curl_str *s2);
168/* returns true if the current socket is an IP one */
169extern bool socket_domain_is_ip(void);
171/* global variables */
172static const char *srcpath = "."; /* pointing to the test directory */
173static const char *pidname = NULL;
174static const char *portname = NULL; /* none by default */
175static const char *serverlogfile = NULL;
176static int serverlogslocked;
177static const char *configfile = NULL;
178static const char *logdir = "log";
179static char loglockfile[256];
180static const char *server_unix_socket = NULL;
181static uint16_t server_port = 0;
182static const char *socket_type = "IPv4";
183static int socket_domain = AF_INET;
184/* file in which additional instructions may be found */
185extern const char *cmdfile;
187#define SERVERLOGS_LOCKDIR "lock" /* within logdir */
189#endif /* HEADER_SERVER_FIRST_H */
Diagnostics4 git calls · 38 ms
CallStatusSizeTime038 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 · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=32
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=3
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
fetch2002.5 KiB · hit32 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=2512
git.response.cache=HIT
git.response.duration_ms=32
git.fetch.wants=bec2210a58ebc423577e2b4c7cc17c2776f31d18
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=2512
git.pkt.payload.max=2491
git.sideband.band1.bytes=2490
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
a5e2b203afcbe6b0
Request
0a287206…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format