Artifactspublic-v0

curl

master
ply4 git calls30 ms290 KiB3 cachedprotocol v2
201 lines8.0 KiBRaw
1#ifndef HEADER_CURL_MULTIHANDLE_H
2#define HEADER_CURL_MULTIHANDLE_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 ***************************************************************************/
26#include "api.h"
27#include "llist.h"
28#include "hash.h"
29#include "conncache.h"
30#include "cshutdn.h"
31#include "multi_ev.h"
32#include "multi_ntfy.h"
33#include "psl.h"
34#include "socketpair.h"
35#include "splay.h"
36#include "uint-bset.h"
37#include "uint-spbset.h"
38#include "uint-table.h"
39#include "vdns/dnscache.h"
41struct connectdata;
42struct Curl_easy;
44/* NOTE: if you add a state here, add the name to the statenames[] array
45 * in curl_trc.c as well!
46 */
47typedef enum {
48 MSTATE_INIT, /* 0 - start in this state */
49 MSTATE_PENDING, /* no connections, waiting for one */
50 MSTATE_SETUP, /* start a new transfer */
51 MSTATE_CONNECT, /* resolve/connect has been sent off */
52 MSTATE_CONNECTING, /* awaiting the TCP connect to finalize */
53 MSTATE_PROTOCONNECT, /* initiate protocol connect procedure */
54 MSTATE_PROTOCONNECTING, /* completing the protocol-specific connect phase */
55 MSTATE_DO, /* start send off the request (part 1) */
56 MSTATE_DOING, /* sending off the request (part 1) */
57 MSTATE_DOING_MORE, /* send off the request (part 2) */
58 MSTATE_DID, /* done sending off request */
59 MSTATE_PERFORMING, /* transfer data */
60 MSTATE_RATELIMITING, /* wait because limit-rate exceeded */
61 MSTATE_DONE, /* post data transfer operation */
62 MSTATE_COMPLETED, /* operation complete */
63 MSTATE_MSGSENT, /* the operation complete message is sent */
64 MSTATE_LAST /* not a true state, never use this */
65} CURLMstate;
67#define CURLPIPE_ANY (CURLPIPE_MULTIPLEX)
69#if !defined(CURL_DISABLE_SOCKETPAIR) && !defined(USE_WINSOCK)
70#define ENABLE_WAKEUP
71#endif
72#if !defined(CURL_DISABLE_SOCKETPAIR) && \
73 defined(USE_RESOLV_THREADED) && \
74 !defined(USE_WINSOCK)
75#define ENABLE_INTERNAL_WAKEUP
76#endif
78/* value for MAXIMUM CONCURRENT STREAMS upper limit */
79#define INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1)
81struct Curl_fixed_buf {
82 size_t len; /* the allocated data length */
83 char data[1]; /* the actual buffer */
84};
86/* This is the struct known as CURLM on the outside */
87struct Curl_multi {
88 /* First a simple identifier to more easily detect if a user mixes up
89 this multi handle with an easy handle.
90 Set this to CURLMULTI_MAGIC_NUMBER. */
91 uint32_t magic;
92 uint32_t xfers_alive; /* amount of added transfers that have
93 not yet reached COMPLETE state */
94 uint32_t xfers_really_alive; /* amount of added transfers that have
95 passed INIT state but are not COMPLETE yet */
96 uint32_t max_concurrent_streams;
97 curl_off_t xfers_total_ever; /* total of added transfers, ever. */
99 struct uint32_tbl xfers; /* transfers added to this multi */
100 /* A transfer's mid may be present in at most one of
101 * process/pending/msgsent. The dirty set may overlap with process. */
102 struct uint32_bset process; /* transfer being processed */
103 struct uint32_bset dirty; /* transfer to be run NOW, e.g. ASAP. */
104 struct uint32_bset pending; /* transfers in waiting (conn limit etc.) */
105 struct uint32_bset msgsent; /* transfers with unread application messages */
107 struct Curl_mapi_stack callstack; /* multi api calls ongoing */
109 /* expiration times for all attached easy handles */
110 struct Curl_timeouts timeouts;
112 struct Curl_easy *admin; /* internal easy handle for admin operations.
113 gets assigned `mid` 0 on multi init */
115 /* callback function and user data pointer for the *socket() API */
116 curl_socket_callback socket_cb;
117 void *socket_userp;
119 /* callback function and user data pointer for server push */
120 curl_push_callback push_cb;
121 void *push_userp;
123 struct Curl_dnscache dnscache; /* DNS cache */
124 struct Curl_ssl_scache *ssl_scache; /* TLS session pool */
125#ifdef USE_RESOLV_THREADED
126 struct curl_thrdq *resolv_thrdq;
127#endif
129#ifdef USE_LIBPSL
130 /* PSL cache. */
131 struct PslCache psl;
132#endif
134 struct Curl_fixed_buf *xfer_buf; /* transfer downloads, lazy */
135 struct Curl_fixed_buf *xfer_ulbuf; /* transfer uploads, lazy */
136 struct Curl_fixed_buf *xfer_sockbuf; /* transfer socket I/O, lazy */
138 /* multi event related things */
139 struct curl_multi_ev ev;
140 /* multi notification related things */
141 struct curl_multi_ntfy ntfy;
143 /* `proto_hash` is a general key-value store for protocol implementations
144 * with the lifetime of the multi handle. The number of elements kept here
145 * should be in the order of supported protocols (and sub-protocols like
146 * TLS), *not* in the order of connections or current transfers!
147 * Elements need to be added with their own destructor to be invoked when
148 * the multi handle is cleaned up (see Curl_hash_add2()).*/
149 struct Curl_hash proto_hash;
151 struct cshutdn cshutdn; /* connection shutdown handling */
152 struct cpool cpool; /* connection pool (bundles) */
154 timediff_t last_expire_offset_us; /* times offset of last expiry */
156 /* timer callback and user data pointer for the *socket() API */
157 curl_multi_timer_callback timer_cb;
158 void *timer_userp;
160#ifdef USE_WINSOCK
161 WSAEVENT wsa_event; /* Winsock event used for waits */
162#endif
163#ifdef ENABLE_WAKEUP
164 curl_socket_t wakeup_pair[2]; /* eventfd()/pipe()/socketpair() used for
165 wakeup 0 is used for read, 1 is used
166 for write. Used by curl_multi_wakeup() */
167#endif
168#ifdef ENABLE_INTERNAL_WAKEUP
169 curl_socket_t wakeup_internal[2]; /* eventfd()/pipe()/socketpair() used for
170 wakeup 0 is used for read, 1 is used
171 for write. Used for internal wakeups,
172 e.g. threaded resolver. */
173#endif
174 uint32_t max_host_connections; /* if >0, a fixed limit of the maximum number
175 of connections per host */
176 uint32_t max_total_connections; /* if >0, a fixed limit of the maximum number
177 of connections in total */
178 uint32_t maxconnects; /* if >0, a fixed limit of the maximum number of
179 entries we are allowed to grow the connection
180 cache to */
181 uint32_t last_pending_mid; /* mid of last pending transfer rescheduled */
182 uint32_t last_resolv_id; /* id of the last DNS resolve operation */
183 BIT(ipv6_works);
184 BIT(multiplexing); /* multiplexing wanted */
185 BIT(recheckstate); /* see Curl_multi_connchanged */
186#ifdef USE_OPENSSL
187 BIT(ssl_seeded);
188#endif
189 BIT(dead); /* a callback returned error, everything needs to crash and
190 burn */
191 BIT(last_timeout_set); /* last timer callback value was nonnegative */
192 BIT(xfer_buf_borrowed); /* xfer_buf is currently being borrowed */
193 BIT(xfer_ulbuf_borrowed); /* xfer_ulbuf is currently being borrowed */
194 BIT(xfer_sockbuf_borrowed); /* xfer_sockbuf is currently being borrowed */
195 BIT(quick_exit); /* do not join threads on cleanup */
196#ifdef DEBUGBUILD
197 BIT(warned); /* true after user warned of DEBUGBUILD */
198#endif
199};
201#endif /* HEADER_CURL_MULTIHANDLE_H */
Diagnostics4 git calls · 30 ms
CallStatusSizeTime030 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 · hit5 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=5
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
fetch2003.1 KiB · hit22 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=3166
git.response.cache=HIT
git.response.duration_ms=22
git.fetch.wants=6a0bf5118cc689da7b22f333efc528f8903806cd
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=3166
git.pkt.payload.max=3145
git.sideband.band1.bytes=3144
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
a5e1c92f3af0c6f8
Request
78f47c81…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format