master
1#ifndef HEADER_CURL_PEER_H
2#define HEADER_CURL_PEER_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 ***************************************************************************/
27struct Curl_scheme;
29/* if peer hostname starts with this, the peer is a unix domain socket
30 * path, e.g. the remainder after 'localhost'. */
31#define CURL_PEER_UDS_PREFIX "localhost/"
33struct Curl_peer {
34 const struct Curl_scheme *scheme; /* url scheme */
35 char *hostname; /* normalized hostname (IDN decoded when supported) */
36 char *zoneid; /* NULL or IPv6 zone identifier */
37 uint32_t refcount; /* created with 1, freed when dropping to 0 */
38 uint32_t scopeid; /* != 0, IPv6 scope to use */
39 uint16_t port;
40 BIT(unix_socket); /* hostname is a UDS path without the prefix */
41 BIT(abstract_uds); /* only TRUE when `unix_socket` also TRUE */
42 BIT(ipv6); /* hostname is an IPv6 address stripped of '[]' */
43 char user_hostname[1]; /* hostname supplied by user/url */
44};
46/* Create a new peer:
47 * - `peer->user_hostname` is the passed `hostname`
48 * - `peer->hostname` is the normalized `hostname` via
49 * + IDN conversion if it has non-ASCII characters
50 * + stripping of surrounding '[]' for URL formatted IPv6 addresses
51 * + the path alone in case of a unix domain socket, e.g. hostname
52 * starts with CURL_PEER_UDS_PREFIX and is longer
53 * Scans for IPv6 addresses even without surrounding '[]'.
54 * - `zoneid` IPv6 zone identifier or NULL
55 * - `scopeid` IPv6 scopeid of zoneid, when known.
56 */
57CURLcode Curl_peer_create(struct Curl_easy *data,
58 const struct Curl_scheme *scheme,
59 const char *hostname,
60 uint16_t port,
61 struct Curl_peer **ppeer);
63#ifdef USE_UNIX_SOCKETS
64CURLcode Curl_peer_uds_create(const struct Curl_scheme *scheme,
65 const char *path,
66 bool abstract_unix_socket,
67 struct Curl_peer **ppeer);
68#endif
70/* Unlink any peer in `*pdest`, assign src, increase src
71 * refcount when not NULL. */
72void Curl_peer_link(struct Curl_peer **pdest, struct Curl_peer *src);
74/* Drop a reference, peer may be passed as NULL */
75void Curl_peer_unlink(struct Curl_peer **ppeer);
77/* TRUE if both peers are NULL or have completely same properties. */
78bool Curl_peer_equal(struct Curl_peer *p1, struct Curl_peer *p2);
80/* TRUE if both peers are NULL or have same properties except the scheme. */
81bool Curl_peer_same_destination(struct Curl_peer *p1, struct Curl_peer *p2);
83CURLcode Curl_peer_from_url(CURLU *uh, struct Curl_easy *data,
84 uint16_t port_override,
85 uint32_t scopeid_override,
86 struct Curl_peer **ppeer);
88CURLcode Curl_peer_from_connect_to(struct Curl_easy *data,
89 const struct Curl_peer *dest,
90 const char *connect_to,
91 struct Curl_peer **ppeer);
93#ifndef CURL_DISABLE_PROXY
95CURLcode Curl_scheme_to_proxytype(struct Curl_easy *data,
96 const char *scheme,
97 uint8_t *proxytype,
98 const char *url);
100CURLcode Curl_peer_from_proxy_url(CURLU *uh,
101 struct Curl_easy *data,
102 const char *url,
103 uint8_t proxytype,
104 struct Curl_peer **ppeer,
105 uint8_t *pproxytype);
106#endif /* !CURL_DISABLE_PROXY */
108#endif /* HEADER_CURL_PEER_H */
Diagnostics4 git calls · 81 ms
CallStatusSizeTime081 ms
discover200152 B4 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=4 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 · hit19 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=15 git.response.bytes=149 git.response.cache=HIT git.response.duration_ms=15 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=3 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=86Open pack map
fetch2001.6 KiB · hit59 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=59 git.response.bytes=1655 git.response.cache=HIT git.response.duration_ms=59 git.fetch.wants=a0a3054cd844b9401b0079d2e8de5ac19d94cbb0 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=1655 git.pkt.payload.max=1634 git.sideband.band1.bytes=1633 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
- a5e146cb4d81a140
- Request
- 8b8d3997…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format