Artifactspublic-v0

curl

master
ply4 git calls237 ms293 KiB2 cachedprotocol v2
691 lines22 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 "curl_setup.h"
26#include "urldata.h"
27#include "curl_addrinfo.h"
28#include "cfilters.h"
29#include "connect.h"
30#include "curl_trc.h"
31#include "multiif.h"
32#include "progress.h"
33#include "url.h"
34#include "vdns/cf-dns.h"
35#include "vdns/dnscache.h"
36#include "vdns/httpsrr.h"
37#include "curlx/strparse.h"
39/* Max time to wait for AAAA before connecting sub-filters, e.g.
40 * letting cf-ip-happy.c do its work. */
41#define CURL_HE_AAAA_AWAIT_MS 25
43struct cf_dns_ctx {
44 struct Curl_dns_entry *dns;
45 struct Curl_peer *peer;
46 CURLcode resolv_result;
47 timediff_t he_aaaa_await_ms;
48 uint32_t resolv_id;
49 uint8_t dns_queries;
50 uint8_t transport;
51 BIT(started);
52 BIT(announced);
53 BIT(for_proxy);
54};
56static struct cf_dns_ctx *cf_dns_ctx_create(struct Curl_easy *data,
57 struct Curl_peer *peer,
58 uint8_t dns_queries,
59 uint8_t transport,
60 bool for_proxy)
62 struct cf_dns_ctx *ctx;
64 ctx = curlx_calloc(1, sizeof(*ctx));
65 if(!ctx)
66 return NULL;
68 Curl_peer_link(&ctx->peer, peer);
69 ctx->dns_queries = dns_queries;
70 ctx->transport = transport;
71 ctx->for_proxy = for_proxy;
72 ctx->he_aaaa_await_ms = CURL_HE_AAAA_AWAIT_MS;
73#ifdef DEBUGBUILD
74 {
75 const char *p = getenv("CURL_DBG_HE_AAAA_AWAIT_MS");
76 if(p) {
77 curl_off_t l;
78 if(!curlx_str_number(&p, &l, UINT32_MAX)) {
79 ctx->he_aaaa_await_ms = (uint32_t)l;
80 }
81 }
82 }
83#endif
85 CURL_TRC_DNS(data, "[%s] created DNS filter for %s:%u, transport=%x",
86 Curl_resolv_query_str(ctx->dns_queries),
87 peer->hostname, peer->port, ctx->transport);
88 return ctx;
91static void cf_dns_ctx_destroy(struct Curl_easy *data,
92 struct cf_dns_ctx *ctx)
94 if(ctx) {
95 Curl_peer_unlink(&ctx->peer);
96 Curl_dns_entry_unlink(data, &ctx->dns);
97 curlx_free(ctx);
98 }
101#ifdef CURLVERBOSE
102static void cf_dns_report_addr(struct Curl_easy *data,
103 struct dynbuf *tmp,
104 const char *label,
105 int ai_family,
106 const struct Curl_addrinfo *ai)
108 char buf[MAX_IPADR_LEN];
109 const char *sep = "";
110 CURLcode result;
112 curlx_dyn_reset(tmp);
113 for(; ai; ai = ai->ai_next) {
114 if(ai->ai_family == ai_family) {
115 Curl_printable_address(ai, buf, sizeof(buf));
116 result = curlx_dyn_addf(tmp, "%s%s", sep, buf);
117 if(result) {
118 infof(data, "too many IP, cannot show");
119 return;
120 }
121 sep = ", ";
122 }
123 }
125 infof(data, "%s%s", label,
126 (curlx_dyn_len(tmp) ? curlx_dyn_ptr(tmp) : "(none)"));
129static void cf_dns_report(struct Curl_cfilter *cf,
130 struct Curl_easy *data,
131 struct Curl_dns_entry *dns)
133 struct cf_dns_ctx *ctx = cf->ctx;
134 struct dynbuf tmp;
136 if(!Curl_trc_is_verbose(data) ||
137 /* ignore no name or numerical IP addresses */
138 !dns->hostname[0] || Curl_host_is_ipnum(dns->hostname))
139 return;
141 if(ctx->peer->unix_socket) {
142#ifdef USE_UNIX_SOCKETS
143 CURL_TRC_CF(data, cf, "resolved unix://%s", ctx->peer->hostname);
144#else
145 DEBUGASSERT(0);
146#endif
147 }
148 else {
149 curlx_dyn_init(&tmp, 1024);
150 if(CURL_DNSQ_IS_ADDR(ctx->dns_queries)) {
151 infof(data, "Host %s:%u was resolved.", dns->hostname, dns->port);
152#ifdef CURLRES_IPV6
153 cf_dns_report_addr(data, &tmp, "IPv6: ", AF_INET6, dns->addr);
154#endif
155 cf_dns_report_addr(data, &tmp, "IPv4: ", AF_INET, dns->addr);
156 }
157#ifdef USE_HTTPSRR
158 else if(ctx->dns_queries & CURL_DNSQ_HTTPS) {
159 if(!dns->hinfo)
160 infof(data, "HTTPS-RR %s:%u: -", dns->hostname, dns->port);
161 else if(!Curl_httpsrr_applicable(data, dns->hinfo))
162 infof(data, "HTTPS-RR %s:%u: not applicable",
163 dns->hostname, dns->port);
164 else {
165 CURLcode result = Curl_httpsrr_print(&tmp, dns->hinfo);
166 if(!result)
167 infof(data, "HTTPS-RR %s:%u: %s",
168 dns->hostname, dns->port, curlx_dyn_ptr(&tmp));
169 else
170 infof(data, "Error printing HTTPS-RR information");
171 }
172 }
173#endif
174 curlx_dyn_free(&tmp);
175 }
177#else
178#define cf_dns_report(x, y, z) Curl_nop_stmt
179#endif
181/*************************************************************
182 * Resolve the address of the server or proxy
183 *************************************************************/
184static CURLcode cf_dns_start(struct Curl_cfilter *cf,
185 struct Curl_easy *data,
186 struct Curl_dns_entry **pdns)
188 struct cf_dns_ctx *ctx = cf->ctx;
189 timediff_t timeout_ms = Curl_timeleft_ms(data);
190 CURLcode result = CURLE_OK;
192 *pdns = NULL;
194 CURL_TRC_CF(data, cf, "[%s] cf_dns_start %s %s:%u",
195 Curl_resolv_query_str(ctx->dns_queries),
196 ctx->peer->unix_socket ? "unix-domain-socket" : "host",
197 ctx->peer->hostname, ctx->peer->port);
198 if(ctx->peer->unix_socket)
199 ctx->dns_queries = CURL_DNSQ_A; /* treat it like an A resolve */
201 if(CURL_DNSQ_IS_ADDR(ctx->dns_queries)) {
202 if(Curl_is_ipv4addr(ctx->peer->hostname))
203 ctx->dns_queries |= CURL_DNSQ_A;
204#ifdef USE_IPV6
205 else if(ctx->peer->ipv6)
206 ctx->dns_queries |= CURL_DNSQ_AAAA;
207#endif
209 result = Curl_resolv(data, ctx->peer, ctx->dns_queries, ctx->transport,
210 (bool)ctx->for_proxy, timeout_ms,
211 &ctx->resolv_id, pdns);
212 }
213#ifdef USE_HTTPSRR
214 else if(ctx->dns_queries == CURL_DNSQ_HTTPS) {
215 result = Curl_resolv_https(data, ctx->peer, (bool)ctx->for_proxy,
216 timeout_ms, &ctx->resolv_id, pdns);
217 }
218#endif
219 else {
220 failf(data, "unsupported DNS queries %x", ctx->dns_queries);
221 return CURLE_FAILED_INIT;
222 }
224 DEBUGASSERT(!result || !*pdns);
225 if(!result) { /* resolved right away, either sync or from dnscache */
226 DEBUGASSERT(*pdns);
227 return CURLE_OK;
228 }
229 else if(result == CURLE_AGAIN) { /* async resolv in progress */
230 return CURLE_OK;
231 }
232 else if(result == CURLE_OPERATION_TIMEDOUT) { /* took too long */
233 failf(data, "Failed to resolve '%s' with timeout after %"
234 FMT_TIMEDIFF_T " ms", ctx->peer->hostname,
235 Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE));
236 return CURLE_OPERATION_TIMEDOUT;
237 }
238 else {
239 DEBUGASSERT(result);
240 if(ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
241 failf(data, "Could not resolve: %s", ctx->peer->hostname);
242 return result;
243 }
246static bool cf_dns_ready_to_connect(struct Curl_cfilter *cf,
247 struct Curl_easy *data)
249 struct cf_dns_ctx *ctx = cf->ctx;
251 if(ctx->resolv_result)
252 return TRUE;
253 else if(ctx->dns)
254 return TRUE;
255#ifdef USE_CURL_ASYNC
256 else if(CURL_DNSQ_IS_ADDR(ctx->dns_queries)) {
257 const struct curltime *pnow;
258 timediff_t remain_ms;
259 /* For Happy Eyeballing, we can start on either A or AAAA resolves,
260 * but AAAA is preferred. We enforce a small delay for missing
261 * AAAA to arrive, then we let the connect continue.
262 * Note: if AAAA was never started (-4), it is considered to have
263 * an answer (e.g. a negative one). */
264 if(Curl_resolv_has_answers(data, ctx->resolv_id, CURL_DNSQ_AAAA))
265 return TRUE;
266 pnow = Curl_pgrs_now(data);
267 remain_ms = ctx->he_aaaa_await_ms -
268 Curl_resolv_elapsed_ms(data, ctx->resolv_id, pnow);
269 if(remain_ms <= 0)
270 return TRUE;
271 CURL_TRC_CF(data, cf, "[%s] still waiting %" FMT_TIMEDIFF_T
272 "ms for AAAA result",
273 Curl_resolv_query_str(ctx->dns_queries), remain_ms);
274 Curl_expire_set(data, EXPIRE_HAPPY_EYEBALLS, remain_ms, pnow);
275 return FALSE;
276 }
277 else {
278 return TRUE;
279 }
280#else
281 (void)data;
282 DEBUGASSERT(0); /* We should not come here */
283 return FALSE;
284#endif /* USE_CURL_ASYNC */
287static CURLcode cf_dns_connect(struct Curl_cfilter *cf,
288 struct Curl_easy *data,
289 bool *done)
291 struct cf_dns_ctx *ctx = cf->ctx;
292 bool ip_query = (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA));
294 if(cf->connected) {
295 *done = TRUE;
296 return CURLE_OK;
297 }
299 *done = FALSE;
300 if(!ctx->started) {
301 ctx->started = TRUE;
302 ctx->resolv_result = cf_dns_start(cf, data, &ctx->dns);
303 }
305 if(!ctx->dns && !ctx->resolv_result) {
306 ctx->resolv_result =
307 Curl_resolv_take_result(data, ctx->resolv_id, &ctx->dns);
308 }
310 if(ctx->resolv_result && ip_query) {
311 /* failing A|AAAA resolves is a hard failure. */
312 CURL_TRC_CF(data, cf, "[%s] error resolving: %d",
313 Curl_resolv_query_str(ctx->dns_queries),
314 (int)ctx->resolv_result);
315 return ctx->resolv_result;
316 }
318 if(ctx->dns && !ctx->announced) {
319 ctx->announced = TRUE;
320 if((cf->sockindex == FIRSTSOCKET) && ip_query) {
321 cf->conn->bits.dns_resolved = TRUE;
322 Curl_pgrsTime(data, TIMER_NAMELOOKUP);
323 }
324 cf_dns_report(cf, data, ctx->dns);
325 }
327 /* Delay connection sub-filters when we are still waiting for AAAA */
328 if(!cf_dns_ready_to_connect(cf, data)) {
329 return CURLE_OK;
330 }
332 if(cf->next && !cf->next->connected) {
333 bool sub_done;
334 CURLcode result = Curl_conn_cf_connect(cf->next, data, &sub_done);
335 if(result || !sub_done)
336 return result;
337 DEBUGASSERT(sub_done);
338 }
340 /* sub filter chain is connected, this means the filter has done
341 * its work and is connected as well, if it has results or not. */
342 CURL_TRC_CF(data, cf, "connected filter chain below");
343 *done = TRUE;
344 cf->connected = TRUE;
345 Curl_resolv_destroy(data, ctx->resolv_id);
346 return CURLE_OK;
349static void cf_dns_destroy(struct Curl_cfilter *cf, struct Curl_easy *data)
351 struct cf_dns_ctx *ctx = cf->ctx;
353 CURL_TRC_CF(data, cf, "destroy");
354 cf_dns_ctx_destroy(data, ctx);
357static CURLcode cf_dns_adjust_pollset(struct Curl_cfilter *cf,
358 struct Curl_easy *data,
359 struct easy_pollset *ps)
361#ifdef USE_CURL_ASYNC
362 if(!cf->connected) {
363 /* The pollset only works when we have started the resolving.
364 * Otherwise we might wait on the WAKEUP socketpair forever.
365 * Since DNS filters can be added in the middle of a connect
366 * attempt, they are not always started that way. */
367 struct cf_dns_ctx *ctx = cf->ctx;
368 if(!ctx->started) {
369 CURL_TRC_CF(data, cf, "adjust_pollset, starting %s:%u queries=%s",
370 ctx->peer->hostname, ctx->peer->port,
371 Curl_resolv_query_str(ctx->dns_queries));
372 ctx->started = TRUE;
373 ctx->resolv_result = cf_dns_start(cf, data, &ctx->dns);
374 if(ctx->resolv_result || ctx->dns) {
375 Curl_multi_mark_dirty(data);
376 }
377 }
378 return Curl_resolv_pollset(data, ps);
379 }
380#else
381 (void)cf;
382 (void)data;
383 (void)ps;
384#endif
385 return CURLE_OK;
388static CURLcode cf_dns_cntrl(struct Curl_cfilter *cf,
389 struct Curl_easy *data,
390 int event, int arg1, void *arg2)
392 struct cf_dns_ctx *ctx = cf->ctx;
393 CURLcode result = CURLE_OK;
395 (void)arg1;
396 (void)arg2;
397 switch(event) {
398 case CF_CTRL_DATA_DONE:
399 if(ctx->dns) {
400 /* Should only come here when the connect attempt failed and
401 * `data` is giving up on it. On a successful connect, we already
402 * unlinked the DNS entry. */
403 Curl_dns_entry_unlink(data, &ctx->dns);
404 }
405 break;
406 default:
407 break;
408 }
409 return result;
412struct Curl_cftype Curl_cft_dns = {
413 "DNS",
414 CF_TYPE_SETUP | CF_TYPE_DNS,
415 CURL_LOG_LVL_NONE,
416 cf_dns_destroy,
417 cf_dns_connect,
418 Curl_cf_def_shutdown,
419 cf_dns_adjust_pollset,
420 Curl_cf_def_data_pending,
421 Curl_cf_def_send,
422 Curl_cf_def_recv,
423 cf_dns_cntrl,
424 Curl_cf_def_conn_is_alive,
425 Curl_cf_def_conn_keep_alive,
426 Curl_cf_def_query,
427};
429static CURLcode cf_dns_create(struct Curl_cfilter **pcf,
430 struct Curl_easy *data,
431 struct Curl_peer *peer,
432 uint8_t dns_queries,
433 uint8_t transport,
434 bool for_proxy)
436 struct Curl_cfilter *cf = NULL;
437 struct cf_dns_ctx *ctx;
438 CURLcode result = CURLE_OK;
440 (void)data;
441 ctx = cf_dns_ctx_create(data, peer, dns_queries, transport, for_proxy);
442 if(!ctx) {
443 result = CURLE_OUT_OF_MEMORY;
444 goto out;
445 }
447 result = Curl_cf_create(&cf, &Curl_cft_dns, ctx);
449out:
450 *pcf = result ? NULL : cf;
451 if(result)
452 cf_dns_ctx_destroy(data, ctx);
453 return result;
456/* Adds a "resolv" filter at the top of the connection's filter chain.
457 * The filter will resolve the peer on the first connect attempt. */
458static CURLcode cf_dns_add(struct Curl_easy *data,
459 struct connectdata *conn,
460 int8_t sockindex,
461 struct Curl_peer *peer,
462 uint8_t dns_queries,
463 uint8_t transport)
465 struct Curl_cfilter *cf = NULL;
466 bool for_proxy = FALSE;
467 CURLcode result;
469 if(!peer)
470 return CURLE_FAILED_INIT;
471#ifndef CURL_DISABLE_PROXY
472 for_proxy = (peer == conn->socks_proxy.peer) ||
473 (peer == conn->http_proxy.peer);
474#endif
476 result = cf_dns_create(&cf, data, peer, dns_queries, transport, for_proxy);
477 if(result)
478 goto out;
479 Curl_conn_cf_add(data, conn, sockindex, cf);
480out:
481 return result;
484/* Insert a new "resolv" filter directly after `cf`. It will
485 * start a DNS resolve for the given peer on the
486 * first connect attempt.
487 * See socks.c on how this is used to make a non-blocking DNS
488 * resolve during connect.
489 */
490static CURLcode cf_dns_insert_after(struct Curl_cfilter *cf_at,
491 struct Curl_easy *data,
492 struct Curl_peer *peer,
493 uint8_t dns_queries,
494 uint8_t transport)
496 struct Curl_cfilter *cf;
497 CURLcode result;
499 result = cf_dns_create(&cf, data, peer, dns_queries, transport, FALSE);
500 if(result)
501 return result;
503 Curl_conn_cf_insert_after(cf_at, cf);
504 return CURLE_OK;
507static CURLcode cf_dns_add_resolve(struct Curl_easy *data,
508 struct connectdata *conn,
509 int8_t sockindex,
510 struct Curl_peer *peer,
511 uint8_t dns_queries,
512 uint8_t transport)
514 struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
515 struct Curl_cfilter *cf_dns = NULL;
516 bool is_addr = CURL_DNSQ_IS_ADDR(dns_queries);
518 if((dns_queries & CURL_DNSQ_HTTPS) &&
519 Curl_is_ipaddr(peer->hostname)) {
520 dns_queries = (uint8_t)(dns_queries & ~CURL_DNSQ_HTTPS);
521 }
523 for(; cf && dns_queries; cf = cf->next) {
524 if(cf->cft == &Curl_cft_dns) {
525 struct cf_dns_ctx *ctx = cf->ctx;
526 cf_dns = cf;
527 if(Curl_peer_same_destination(ctx->peer, peer)) {
528 /* subtract queries already being scheduled/ongoing */
529 dns_queries = (uint8_t)(~ctx->dns_queries & dns_queries);
530 if(!dns_queries) { /* already there */
531 return CURLE_OK;
532 }
533 else if(is_addr && !ctx->started &&
534 CURL_DNSQ_IS_ADDR(ctx->dns_queries)) {
535 ctx->dns_queries |= dns_queries;
536 CURL_TRC_DNS(data, "[%s] added queries=%s for %s:%u",
537 Curl_resolv_query_str(ctx->dns_queries),
538 Curl_resolv_query_str(dns_queries),
539 peer->hostname, peer->port);
540 return CURLE_OK;
541 }
542 }
543 }
544 }
546 if(dns_queries) {
547 /* No existing filter is handling these, add a new DNS filter
548 * (after the last one if there was one already. FCFS. */
549 if(cf_dns)
550 return cf_dns_insert_after(cf_dns, data, peer, dns_queries, transport);
551 else
552 return cf_dns_add(data, conn, sockindex, peer, dns_queries, transport);
553 }
554 return CURLE_OK;
557CURLcode Curl_conn_dns_add_addr_resolve(struct Curl_easy *data,
558 struct connectdata *conn,
559 int8_t sockindex,
560 struct Curl_peer *peer,
561 uint8_t dns_queries,
562 uint8_t transport)
564 /* should only have address query bits */
565 DEBUGASSERT(!(dns_queries & ~CURL_DNSQ_ADDR));
566 return cf_dns_add_resolve(data, conn, sockindex, peer,
567 (dns_queries & CURL_DNSQ_ADDR), transport);
570/* Return the result of the DNS address resolution for peer.
571 * Searches for a DNS filter from the top of the filter chain down. Returns
572 * - CURLE_AGAIN when not done yet
573 * - CURLE_OK when DNS was successfully resolved
574 * - CURLR_FAILED_INIT when no resolv filter was found
575 * - error returned by the DNS resolv
576 */
577CURLcode Curl_conn_dns_addr_result(struct connectdata *conn,
578 int8_t sockindex,
579 struct Curl_peer *peer)
581 struct Curl_cfilter *cf = conn->cfilter[sockindex];
582 for(; cf; cf = cf->next) {
583 if(cf->cft == &Curl_cft_dns) {
584 struct cf_dns_ctx *ctx = cf->ctx;
585 if(Curl_peer_same_destination(ctx->peer, peer) &&
586 (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
587 if(ctx->dns || ctx->resolv_result)
588 return ctx->resolv_result;
589 return CURLE_AGAIN;
590 }
591 }
592 }
593 return CURLE_FAILED_INIT; /* no one is resolving */
596/* Return the addrinfo at `index` for the given `family` from the
597 * first "resolve" filter at the connection. If the DNS resolving is
598 * not done yet or if no address for the family exists, returns NULL.
599 */
600const struct Curl_addrinfo *Curl_conn_dns_get_ai(struct Curl_easy *data,
601 struct Curl_peer *peer,
602 int8_t sockindex,
603 int ai_family,
604 unsigned int index)
606 struct connectdata *conn = data->conn;
607 struct Curl_cfilter *cf = conn->cfilter[sockindex];
609 for(; cf; cf = cf->next) {
610 if(cf->cft == &Curl_cft_dns) {
611 struct cf_dns_ctx *ctx = cf->ctx;
612 if(Curl_peer_same_destination(ctx->peer, peer) &&
613 (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
614 CURL_TRC_CF(data, cf, "get %uth result for %s:%u, family=%d, dns=%d",
615 index, peer->hostname, peer->port, ai_family, !!ctx->dns);
616 if(ctx->resolv_result)
617 return NULL;
618 else if(ctx->dns) {
619 /* A cached DNS entry may contain address families that we
620 * here never queried for. We want to give no results for those. */
621 if((ai_family == AF_INET) && !(ctx->dns_queries & CURL_DNSQ_A))
622 return NULL;
623#ifdef USE_IPV6
624 if((ai_family == AF_INET6) && !(ctx->dns_queries & CURL_DNSQ_AAAA))
625 return NULL;
626#endif
627 return Curl_addrinfo_get(ctx->dns->addr, ai_family, index);
628 }
629 else
630 return Curl_resolv_get_ai(data, ctx->resolv_id, ai_family, index);
631 }
632 }
633 }
634 return NULL;
637#ifdef USE_HTTPSRR
638CURLcode Curl_conn_dns_add_https_resolve(struct Curl_easy *data,
639 struct connectdata *conn,
640 int8_t sockindex,
641 struct Curl_peer *peer)
643 return cf_dns_add_resolve(data, conn, sockindex, peer,
644 CURL_DNSQ_HTTPS, conn->transport_wanted);
647/* Return the HTTPS-RR info from the first "resolve" filter at the
648 * connection. If the DNS resolving is not done yet or if there
649 * is no HTTPS-RR info, returns NULL.
650 */
651const struct Curl_https_rrinfo *Curl_conn_dns_get_https(struct Curl_easy *data,
652 int8_t sockindex,
653 struct Curl_peer *peer)
655 struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
656 for(; cf; cf = cf->next) {
657 if(cf->cft == &Curl_cft_dns) {
658 struct cf_dns_ctx *ctx = cf->ctx;
659 if(Curl_peer_same_destination(ctx->peer, peer) &&
660 (ctx->dns_queries & CURL_DNSQ_HTTPS)) {
661 if(ctx->dns)
662 return ctx->dns->hinfo;
663 else
664 return Curl_resolv_get_https(data, ctx->resolv_id);
665 }
666 }
667 }
668 return NULL;
671bool Curl_conn_dns_resolved_https(struct Curl_easy *data,
672 int8_t sockindex,
673 struct Curl_peer *peer)
675 struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
676 for(; cf; cf = cf->next) {
677 if(cf->cft == &Curl_cft_dns) {
678 struct cf_dns_ctx *ctx = cf->ctx;
679 if(Curl_peer_same_destination(ctx->peer, peer) &&
680 (ctx->dns_queries & CURL_DNSQ_HTTPS)) {
681 if(ctx->dns)
682 return TRUE;
683 else
684 return Curl_resolv_knows_https(data, ctx->resolv_id);
685 }
686 }
687 }
688 return TRUE;
691#endif /* USE_HTTPSRR */
Diagnostics4 git calls · 237 ms
CallStatusSizeTime0237 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
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=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=86
Open pack map
fetch2006.2 KiB231 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=231
git.response.bytes=6384
git.response.cache=MISS
git.response.duration_ms=231
git.fetch.wants=8a08912d93487d5429145e95059ec394375dcea9
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=6384
git.pkt.payload.max=6363
git.sideband.band1.bytes=6362
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
a5e9efa9cf7d0acb
Request
745b4794…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format