master
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#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGTCP2) && defined(USE_NGHTTP3)
28#include "urldata.h"
29#include "url.h"
30#include "u32_ptrset.h"
31#include "curl_trc.h"
32#include "rand.h"
33#include "multiif.h"
34#include "cfilters.h"
35#include "cf-socket.h"
36#include "connect.h"
37#include "progress.h"
38#include "curlx/win32-fopen.h"
39#include "curlx/dynbuf.h"
40#include "http1.h"
41#include "select.h"
42#include "transfer.h"
43#include "bufref.h"
44#include "vdns/cf-dns.h"
45#include "vquic/vquic.h"
46#include "vquic/vquic_int.h"
47#include "vquic/cf-ngtcp2-cmn.h"
48#include "vquic/cf-ngtcp2.h"
51static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id,
52 uint64_t datalen, void *user_data,
53 void *stream_user_data);
55static CURLcode cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf,
56 struct Curl_easy *data,
57 struct easy_pollset *ps)
58{
59 struct cf_ngtcp2_ctx *ctx = cf->ctx;
60 bool want_recv, want_send;
61 CURLcode result = CURLE_OK;
62 curl_socket_t sock = (ctx->q.sockfd != CURL_SOCKET_BAD) ?
63 ctx->q.sockfd : Curl_conn_cf_get_socket(cf, data);
65 if(!ctx->qconn || (sock == CURL_SOCKET_BAD))
66 return CURLE_OK;
68 Curl_pollset_check(data, ps, sock, &want_recv, &want_send);
69 if(!want_send && !Curl_bufq_is_empty(&ctx->q.sendbuf))
70 want_send = TRUE;
72 if(want_recv || want_send) {
73 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
74 struct cf_call_data save;
75 bool c_exhaust, s_exhaust;
77 CF_DATA_SAVE(save, cf, data);
78 c_exhaust = want_send && (!ngtcp2_conn_get_cwnd_left(ctx->qconn) ||
79 !ngtcp2_conn_get_max_data_left(ctx->qconn));
80 s_exhaust = want_send && stream && stream->id >= 0 &&
81 (stream->quic_flow_blocked ||
82 stream->tx_in_flight_size >= stream->tx_in_flight_ideal);
83 want_recv = (want_recv || c_exhaust || s_exhaust);
84 want_send = (!s_exhaust && want_send) ||
85 !Curl_bufq_is_empty(&ctx->q.sendbuf);
87 result = Curl_pollset_set(data, ps, sock, want_recv, want_send);
88 CF_DATA_RESTORE(cf, save);
89 }
90 return result;
91}
93static int cb_h3_stream_close(nghttp3_conn *conn, int64_t stream_id,
94 uint64_t app_error_code, void *user_data,
95 void *stream_user_data)
96{
97 struct Curl_cfilter *cf = user_data;
98 struct h3_stream_ctx *stream;
99 struct Curl_easy *data =
100 Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
101 (void)conn;
102 (void)stream_id;
104 /* we might be called by nghttp3 after we already cleaned up */
105 if(!data || !stream)
106 return 0;
108 stream->closed = TRUE;
109 stream->error3 = app_error_code;
110 if(stream->error3 != NGHTTP3_H3_NO_ERROR) {
111 stream->reset = TRUE;
112 stream->send_closed = TRUE;
113 CURL_TRC_CF(data, cf, "[%" PRId64 "] RESET: error %" PRIu64,
114 stream->id, stream->error3);
115 }
116 else {
117 CURL_TRC_CF(data, cf, "[%" PRId64 "] CLOSED", stream->id);
118 }
119 Curl_multi_mark_dirty(data);
120 return 0;
121}
123static void h3_xfer_write_resp_hd(struct Curl_cfilter *cf,
124 struct Curl_easy *data,
125 struct h3_stream_ctx *stream,
126 const char *buf, size_t buflen, bool eos)
127{
128 /* This function returns no error intentionally, but records
129 * the result at the stream, skipping further writes once the
130 * `result` of the transfer is known.
131 * The stream is subsequently cancelled "higher up" in the filter's
132 * send/recv callbacks. Closing the stream here leads to SEND/RECV
133 * errors in other places that then overwrite the transfer's result. */
134 if(!stream->xfer_result) {
135 stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, buflen, eos);
136 if(stream->xfer_result)
137 CURL_TRC_CF(data, cf, "[%" PRId64 "] error %d writing %zu "
138 "bytes of headers", stream->id, (int)stream->xfer_result,
139 buflen);
140 }
141}
143static void h3_xfer_write_resp(struct Curl_cfilter *cf,
144 struct Curl_easy *data,
145 struct h3_stream_ctx *stream,
146 const char *buf, size_t buflen, bool eos)
147{
148 /* This function returns no error intentionally, but records
149 * the result at the stream, skipping further writes once the
150 * `result` of the transfer is known.
151 * The stream is subsequently cancelled "higher up" in the filter's
152 * send/recv callbacks. Closing the stream here leads to SEND/RECV
153 * errors in other places that then overwrite the transfer's result. */
154 if(!stream->xfer_result) {
155 stream->xfer_result = Curl_xfer_write_resp(data, buf, buflen, eos);
156 /* If the transfer write is errored, we do not want any more data */
157 if(stream->xfer_result) {
158 CURL_TRC_CF(data, cf, "[%" PRId64 "] error %d writing %zu bytes of data",
159 stream->id, (int)stream->xfer_result, buflen);
160 }
161 }
162}
164static void cf_ngtcp2_upd_rx_win(struct Curl_cfilter *cf,
165 struct Curl_easy *data,
166 struct h3_stream_ctx *stream)
167{
168 struct cf_ngtcp2_ctx *ctx = cf->ctx;
169 uint64_t cur_win, wanted_win = H3_STREAM_WINDOW_SIZE_MAX;
171 /* how much does rate limiting allow us to acknowledge? */
172 if(Curl_rlimit_active(&data->progress.dl.rlimit)) {
173 int64_t avail;
175 /* start rate limit updates only after first bytes arrived */
176 if(!stream->rx_offset)
177 return;
179 avail = Curl_rlimit_avail(&data->progress.dl.rlimit, NULL);
180 if(avail <= 0) {
181 /* nothing available, do not extend the rx offset */
182 CURL_TRC_CF(data, cf, "[%" PRId64 "] dl rate limit exhausted (%" PRId64
183 " tokens)", stream->id, avail);
184 return;
185 }
186 wanted_win = CURLMIN((uint64_t)avail, H3_STREAM_WINDOW_SIZE_MAX);
187 }
189 if(stream->rx_offset_max < stream->rx_offset) {
190 DEBUGASSERT(0);
191 return;
192 }
193 cur_win = stream->rx_offset_max - stream->rx_offset;
195 if(wanted_win > cur_win) {
196 uint64_t delta = wanted_win - cur_win;
198 if(UINT64_MAX - delta < stream->rx_offset_max)
199 delta = UINT64_MAX - stream->rx_offset_max;
200 if(delta) {
201 CURL_TRC_CF(data, cf, "[%" PRId64 "] rx window, extend by %" PRIu64
202 " bytes", stream->id, delta);
203 stream->rx_offset_max += delta;
204 ngtcp2_conn_extend_max_stream_offset(ctx->qconn, stream->id, delta);
205 }
206 }
207}
209static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream3_id,
210 const uint8_t *buf, size_t buflen,
211 void *user_data, void *stream_user_data)
212{
213 struct Curl_cfilter *cf = user_data;
214 struct cf_ngtcp2_ctx *ctx = cf->ctx;
215 struct h3_stream_ctx *stream;
216 struct Curl_easy *data =
217 Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
219 (void)conn;
220 (void)stream3_id;
222 if(!stream || !data)
223 return NGHTTP3_ERR_CALLBACK_FAILURE;
225 h3_xfer_write_resp(cf, data, stream, (const char *)buf, buflen, FALSE);
227 ngtcp2_conn_extend_max_offset(ctx->qconn, buflen);
228 stream->rx_offset += buflen;
229 if(stream->rx_offset_max < stream->rx_offset)
230 stream->rx_offset_max = stream->rx_offset;
232 CURL_TRC_CF(data, cf, "[%" PRId64 "] DATA len=%zu, rx win=%" PRIu64,
233 stream->id, buflen, stream->rx_offset_max - stream->rx_offset);
234 cf_ngtcp2_upd_rx_win(cf, data, stream);
235 return 0;
236}
238static int cb_h3_deferred_consume(nghttp3_conn *conn, int64_t stream3_id,
239 size_t consumed, void *user_data,
240 void *stream_user_data)
241{
242 struct Curl_cfilter *cf = user_data;
243 struct cf_ngtcp2_ctx *ctx = cf->ctx;
244 struct h3_stream_ctx *stream = stream_user_data;
245 (void)conn;
247 /* nghttp3 has consumed bytes on the QUIC stream and we need to
248 * tell the QUIC connection to increase its flow control */
249 ngtcp2_conn_extend_max_stream_offset(ctx->qconn, stream3_id, consumed);
250 ngtcp2_conn_extend_max_offset(ctx->qconn, consumed);
252 if(stream) {
253 stream->rx_offset += consumed;
254 stream->rx_offset_max += consumed;
255 }
256 return 0;
257}
259static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id,
260 int fin, void *user_data, void *stream_user_data)
261{
262 struct Curl_cfilter *cf = user_data;
263 struct h3_stream_ctx *stream;
264 struct Curl_easy *data =
265 Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
266 (void)conn;
267 (void)stream_id;
268 (void)fin;
269 (void)cf;
271 if(!stream || !data)
272 return 0;
273 /* add a CRLF only if we have received some headers */
274 h3_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"),
275 (bool)stream->closed);
277 CURL_TRC_CF(data, cf, "[%" PRId64 "] end_headers, status=%d",
278 stream_id, stream->status_code);
279 if(stream->status_code / 100 != 1) {
280 stream->resp_hds_complete = TRUE;
281 }
282 Curl_multi_mark_dirty(data);
283 return 0;
284}
286static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id,
287 int32_t token, nghttp3_rcbuf *name,
288 nghttp3_rcbuf *value, uint8_t flags,
289 void *user_data, void *stream_user_data)
290{
291 struct Curl_cfilter *cf = user_data;
292 struct cf_ngtcp2_ctx *ctx = cf->ctx;
293 nghttp3_vec h3name = nghttp3_rcbuf_get_buf(name);
294 nghttp3_vec h3val = nghttp3_rcbuf_get_buf(value);
295 struct h3_stream_ctx *stream;
296 struct Curl_easy *data =
297 Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
298 CURLcode result = CURLE_OK;
299 (void)conn;
300 (void)stream_id;
301 (void)token;
302 (void)flags;
303 (void)cf;
305 /* we might have cleaned up this transfer already */
306 if(!stream || !data)
307 return 0;
309 if(token == NGHTTP3_QPACK_TOKEN__STATUS) {
311 result = Curl_http_decode_status(&stream->status_code,
312 (const char *)h3val.base, h3val.len);
313 if(result)
314 return NGHTTP3_ERR_CALLBACK_FAILURE;
315 curlx_dyn_reset(&ctx->scratch);
316 result = curlx_dyn_addn(&ctx->scratch, STRCONST("HTTP/3 "));
317 if(!result)
318 result = curlx_dyn_addn(&ctx->scratch,
319 (const char *)h3val.base, h3val.len);
320 if(!result)
321 result = curlx_dyn_addn(&ctx->scratch, STRCONST(" \r\n"));
322 if(!result)
323 h3_xfer_write_resp_hd(cf, data, stream, curlx_dyn_ptr(&ctx->scratch),
324 curlx_dyn_len(&ctx->scratch), FALSE);
325 CURL_TRC_CF(data, cf, "[%" PRId64 "] status: %s",
326 stream_id, curlx_dyn_ptr(&ctx->scratch));
327 if(result) {
328 return NGHTTP3_ERR_CALLBACK_FAILURE;
329 }
330 }
331 else {
332 /* store as an HTTP1-style header */
333 CURL_TRC_CF(data, cf, "[%" PRId64 "] header: %.*s: %.*s",
334 stream_id, (int)h3name.len, h3name.base,
335 (int)h3val.len, h3val.base);
336 curlx_dyn_reset(&ctx->scratch);
337 result = curlx_dyn_addn(&ctx->scratch,
338 (const char *)h3name.base, h3name.len);
339 if(!result)
340 result = curlx_dyn_addn(&ctx->scratch, STRCONST(": "));
341 if(!result)
342 result = curlx_dyn_addn(&ctx->scratch,
343 (const char *)h3val.base, h3val.len);
344 if(!result)
345 result = curlx_dyn_addn(&ctx->scratch, STRCONST("\r\n"));
346 if(!result)
347 h3_xfer_write_resp_hd(cf, data, stream, curlx_dyn_ptr(&ctx->scratch),
348 curlx_dyn_len(&ctx->scratch), FALSE);
349 }
350 return 0;
351}
353static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t stream_id,
354 uint64_t app_error_code, void *user_data,
355 void *stream_user_data)
356{
357 struct Curl_cfilter *cf = user_data;
358 struct cf_ngtcp2_ctx *ctx = cf->ctx;
359 int rv;
360 (void)conn;
361 (void)stream_user_data;
363 rv = ngtcp2_conn_shutdown_stream_read(ctx->qconn, 0, stream_id,
364 app_error_code);
365 if(rv && rv != NGTCP2_ERR_STREAM_NOT_FOUND) {
366 return NGHTTP3_ERR_CALLBACK_FAILURE;
367 }
369 return 0;
370}
372static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id,
373 uint64_t app_error_code, void *user_data,
374 void *stream_user_data)
375{
376 struct Curl_cfilter *cf = user_data;
377 struct cf_ngtcp2_ctx *ctx = cf->ctx;
378 struct Curl_easy *data = Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, NULL);
379 int rv;
380 (void)conn;
382 rv = ngtcp2_conn_shutdown_stream_write(ctx->qconn, 0, stream_id,
383 app_error_code);
384 if(data)
385 CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv);
386 if(rv && rv != NGTCP2_ERR_STREAM_NOT_FOUND) {
387 return NGHTTP3_ERR_CALLBACK_FAILURE;
388 }
390 return 0;
391}
393#ifdef CURL_HAVE_DIAG
394#pragma GCC diagnostic push
395#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
396#endif
397static nghttp3_callbacks ngh3_callbacks = {
398 cb_h3_acked_req_body, /* acked_stream_data */
399 cb_h3_stream_close,
400 cb_h3_recv_data,
401 cb_h3_deferred_consume,
402 NULL, /* begin_headers */
403 cb_h3_recv_header,
404 cb_h3_end_headers,
405 NULL, /* begin_trailers */
406 cb_h3_recv_header,
407 NULL, /* end_trailers */
408 cb_h3_stop_sending,
409 NULL, /* end_stream */
410 cb_h3_reset_stream,
411 NULL, /* shutdown */
412 NULL, /* recv_settings (deprecated) */
413#ifdef NGHTTP3_CALLBACKS_V2 /* nghttp3 v1.11.0+ */
414 NULL, /* recv_origin */
415 NULL, /* end_origin */
416 NULL, /* rand */
417#endif
418#ifdef NGHTTP3_CALLBACKS_V3 /* nghttp3 v1.14.0+ */
419 NULL, /* recv_settings2 */
420#endif
421#ifdef NGHTTP3_CALLBACKS_V4 /* nghttp3 v1.18.0+ */
422 NULL, /* stream_close2 */
423#endif
424};
425#ifdef CURL_HAVE_DIAG
426#pragma GCC diagnostic pop
427#endif
429static CURLcode init_ngh3_conn(struct Curl_cfilter *cf,
430 struct Curl_easy *data,
431 struct cf_ngtcp2_ctx *ctx)
432{
433 int rc;
435 if(ngtcp2_conn_get_streams_uni_left(ctx->qconn) < 3) {
436 failf(data, "QUIC connection lacks 3 uni streams to run HTTP/3");
437 return CURLE_QUIC_CONNECT_ERROR;
438 }
440 nghttp3_settings_default(&ctx->h3settings);
442 rc = nghttp3_conn_client_new(&ctx->h3conn,
443 &ngh3_callbacks,
444 &ctx->h3settings,
445 Curl_nghttp3_mem(),
446 cf);
447 if(rc) {
448 failf(data, "error creating nghttp3 connection instance");
449 return CURLE_OUT_OF_MEMORY;
450 }
452 return Curl_cf_ngtcp2_h3_init_ctrls(ctx, data);
453}
455static CURLcode recv_closed_stream(struct Curl_cfilter *cf,
456 struct Curl_easy *data,
457 struct h3_stream_ctx *stream,
458 size_t *pnread)
459{
460 (void)cf;
461 *pnread = 0;
462 if(stream->reset) {
463 if(stream->error3 == CURL_H3_ERR_REQUEST_REJECTED) {
464 infof(data, "HTTP/3 stream %" PRId64 " refused by server, try again "
465 "on a new connection", stream->id);
466 connclose(cf->conn); /* do not use this anymore */
467 data->state.refused_stream = TRUE;
468 return CURLE_RECV_ERROR; /* trigger Curl_retry_request() later */
469 }
470 else if(stream->resp_hds_complete && data->req.no_body) {
471 CURL_TRC_CF(data, cf, "[%" PRId64 "] error after response headers, "
472 "but we did not want a body anyway, ignore error 0x%"
473 PRIx64 " %s", stream->id, stream->error3,
474 Curl_vquic_h3_err_str(stream->error3));
475 return CURLE_OK;
476 }
477 failf(data, "HTTP/3 stream %" PRId64 " reset by server (error 0x%" PRIx64
478 " %s)", stream->id, stream->error3,
479 Curl_vquic_h3_err_str(stream->error3));
480 return data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3;
481 }
482 else if(!stream->resp_hds_complete) {
483 failf(data,
484 "HTTP/3 stream %" PRId64 " was closed cleanly, but before "
485 "getting all response header fields, treated as error",
486 stream->id);
487 return CURLE_HTTP3;
488 }
489 return CURLE_OK;
490}
492/* incoming data frames on the h3 stream */
493static CURLcode cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
494 char *buf, size_t buflen, size_t *pnread)
495{
496 struct cf_ngtcp2_ctx *ctx = cf->ctx;
497 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
498 struct cf_call_data save;
499 struct cf_ngtcp2_io_ctx pktx;
500 CURLcode result = CURLE_OK;
501 int i;
503 (void)ctx;
504 (void)buf;
505 NOVERBOSE((void)buflen);
507 CF_DATA_SAVE(save, cf, data);
508 DEBUGASSERT(cf->connected);
509 DEBUGASSERT(ctx);
510 DEBUGASSERT(ctx->qconn);
511 DEBUGASSERT(ctx->h3conn);
512 *pnread = 0;
514 /* handshake verification failed in callback, do not recv anything */
515 if(ctx->tls_vrfy_result) {
516 result = ctx->tls_vrfy_result;
517 goto denied;
518 }
520 Curl_cf_ngtcp2_io_ctx_init(&pktx, cf, data);
522 if(!stream || ctx->shutdown_started) {
523 result = CURLE_RECV_ERROR;
524 goto out;
525 }
527 cf_ngtcp2_upd_rx_win(cf, data, stream);
529 /* first check for results/closed already known without touching
530 * the connection. For an already failed/closed stream, errors on
531 * the connection do not count.
532 * Then handle incoming data and check for failed/closed again.
533 */
534 for(i = 0; i < 2; ++i) {
535 if(stream->xfer_result) {
536 CURL_TRC_CF(data, cf, "[%" PRId64 "] xfer write failed", stream->id);
537 Curl_cf_ngtcp2_h3_stream_close(cf, data, stream);
538 result = stream->xfer_result;
539 goto out;
540 }
541 else if(stream->closed) {
542 result = recv_closed_stream(cf, data, stream, pnread);
543 goto out;
544 }
546 if(!i && Curl_cf_ngtcp2_progress_ingress(cf, data, &pktx)) {
547 result = CURLE_RECV_ERROR;
548 goto out;
549 }
550 }
552 result = CURLE_AGAIN;
554out:
555 result = Curl_1st_fatal(result,
556 Curl_cf_ngtcp2_progress_egress(cf, data, &pktx));
557 result = Curl_1st_fatal(result,
558 Curl_cf_ngtcp2_cmn_set_expiry(cf, data, &pktx));
559 if(ctx->tls_vrfy_result)
560 result = ctx->tls_vrfy_result;
561denied:
562 CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_recv(buflen=%zu) -> %d, %zu",
563 stream ? stream->id : -1, buflen, (int)result, *pnread);
564 CF_DATA_RESTORE(cf, save);
565 return result;
566}
568static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id,
569 uint64_t datalen, void *user_data,
570 void *stream_user_data)
571{
572 struct Curl_cfilter *cf = user_data;
573 struct h3_stream_ctx *stream = stream_user_data;
574 size_t skiplen;
576 (void)cf;
577 if(!stream)
578 return 0;
579 /* The server acknowledged `datalen` of bytes from our request body.
580 * This is a delta. We have kept this data in `sendbuf` for
581 * re-transmissions and can free it now. */
582 if(datalen >= (uint64_t)stream->tx_in_flight_size)
583 skiplen = stream->tx_in_flight_size;
584 else
585 skiplen = (size_t)datalen;
586 Curl_bufq_skip(&stream->sendbuf, skiplen);
587 stream->tx_in_flight_size -= skiplen;
589 /* Resume upload processing if we have more data to send */
590 if(stream->tx_in_flight_size < Curl_bufq_len(&stream->sendbuf)) {
591 int rv = nghttp3_conn_resume_stream(conn, stream_id);
592 if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) {
593 return NGHTTP3_ERR_CALLBACK_FAILURE;
594 }
595 }
596 return 0;
597}
599static nghttp3_ssize cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id,
600 nghttp3_vec *vec, size_t veccnt,
601 uint32_t *pflags, void *user_data,
602 void *stream_user_data)
603{
604 struct Curl_cfilter *cf = user_data;
605 struct h3_stream_ctx *stream;
606 struct Curl_easy *data =
607 Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
608 size_t nwritten = 0;
609 size_t nvecs = 0;
610 (void)cf;
611 (void)conn;
612 (void)stream_id;
613 (void)user_data;
614 (void)veccnt;
616 if(!stream || !data)
617 return NGHTTP3_ERR_CALLBACK_FAILURE;
618 /* nghttp3 keeps references to the sendbuf data until it is ACKed
619 * by the server (see `cb_h3_acked_req_body()` for updates).
620 * `tx_in_flight_size` is the amount of bytes in `sendbuf`
621 * that we have already passed to nghttp3, but which have not been
622 * ACKed yet.
623 * Any amount beyond `tx_in_flight_size` we need still to pass
624 * to nghttp3. Do that now, if we can. */
625 if(stream->tx_in_flight_size < Curl_bufq_len(&stream->sendbuf)) {
626 nvecs = 0;
627 while(nvecs < veccnt &&
628 Curl_bufq_peek_at(&stream->sendbuf,
629 stream->tx_in_flight_size,
630 CURL_UNCONST(&vec[nvecs].base),
631 &vec[nvecs].len)) {
632 stream->tx_in_flight_size += vec[nvecs].len;
633 nwritten += vec[nvecs].len;
634 ++nvecs;
635 }
636 DEBUGASSERT(nvecs > 0); /* we SHOULD have been be able to peek */
637 }
639 if(nwritten > 0 && stream->upload_left != -1)
640 stream->upload_left -= nwritten;
642 /* When we stopped sending and everything in `sendbuf` is "in flight",
643 * we are at the end of the request body. */
644 if(stream->upload_left == 0) {
645 *pflags = NGHTTP3_DATA_FLAG_EOF;
646 stream->send_closed = TRUE;
647 }
648 else if(!nwritten) {
649 /* Not EOF, and nothing to give, we signal WOULDBLOCK. */
650 CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> AGAIN", stream->id);
651 return NGHTTP3_ERR_WOULDBLOCK;
652 }
654 CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> "
655 "%zu vecs%s with %zu (buffered=%zu, left=%" FMT_OFF_T ")",
656 stream->id, nvecs,
657 *pflags == NGHTTP3_DATA_FLAG_EOF ? " EOF" : "",
658 nwritten, Curl_bufq_len(&stream->sendbuf),
659 stream->upload_left);
660 return (nghttp3_ssize)nvecs;
661}
663static CURLcode h3_stream_open(struct Curl_cfilter *cf,
664 struct Curl_easy *data,
665 const uint8_t *buf, size_t len,
666 size_t *pnwritten)
667{
668 struct cf_ngtcp2_ctx *ctx = cf->ctx;
669 struct h3_stream_ctx *stream = NULL;
670 int64_t sid;
671 struct dynhds h2_headers;
672 size_t nheader;
673 nghttp3_nv *nva = NULL;
674 int rc = 0;
675 unsigned int i;
676 nghttp3_data_reader reader;
677 nghttp3_data_reader *preader = NULL;
678 CURLcode result;
680 *pnwritten = 0;
681 Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST);
683 result = Curl_cf_ngtcp2_h3_stream_setup(cf, data, &stream);
684 if(result)
685 goto out;
687 result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
688 !data->state.http_ignorecustom ?
689 CURL_EASY_STR(data, STRING_CUSTOMREQUEST) : NULL,
690 0, pnwritten);
691 if(result)
692 goto out;
693 if(!stream->h1.done) {
694 /* need more data */
695 goto out;
696 }
697 DEBUGASSERT(stream->h1.req);
699 result = Curl_http_req_to_h2(&h2_headers, stream->h1.req, data);
700 if(result)
701 goto out;
703 /* no longer needed */
704 Curl_h1_req_parse_free(&stream->h1);
706 nheader = Curl_dynhds_count(&h2_headers);
707 nva = curlx_malloc(sizeof(nghttp3_nv) * nheader);
708 if(!nva) {
709 result = CURLE_OUT_OF_MEMORY;
710 goto out;
711 }
713 for(i = 0; i < nheader; ++i) {
714 struct dynhds_entry *e = Curl_dynhds_getn(&h2_headers, i);
715 nva[i].name = (unsigned char *)e->name;
716 nva[i].namelen = e->namelen;
717 nva[i].value = (unsigned char *)e->value;
718 nva[i].valuelen = e->valuelen;
719 nva[i].flags = NGHTTP3_NV_FLAG_NONE;
720 }
722 rc = ngtcp2_conn_open_bidi_stream(ctx->qconn, &sid, stream);
723 if(rc) {
724 failf(data, "cannot open bidi streams");
725 result = CURLE_SEND_ERROR;
726 goto out;
727 }
728 stream->id = sid;
729 ++ctx->used_bidi_streams;
731 switch(data->state.httpreq) {
732 case HTTPREQ_POST:
733 case HTTPREQ_POST_FORM:
734 case HTTPREQ_POST_MIME:
735 case HTTPREQ_PUT:
736 /* known request body size or -1 */
737 if(data->state.infilesize != -1)
738 stream->upload_left = data->state.infilesize;
739 else
740 /* data sending without specifying the data amount up front */
741 stream->upload_left = -1; /* unknown */
742 break;
743 default:
744 /* there is no request body */
745 stream->upload_left = 0; /* no request body */
746 break;
747 }
749 stream->send_closed = (stream->upload_left == 0);
750 if(!stream->send_closed) {
751 reader.read_data = cb_h3_read_req_body;
752 preader = &reader;
753 }
755 rc = nghttp3_conn_submit_request(ctx->h3conn, stream->id,
756 nva, nheader, preader, stream);
757 if(rc) {
758 switch(rc) {
759 case NGHTTP3_ERR_CONN_CLOSING:
760 CURL_TRC_CF(data, cf, "h3sid[%" PRId64 "] failed to send, "
761 "connection is closing", stream->id);
762 break;
763 default:
764 CURL_TRC_CF(data, cf, "h3sid[%" PRId64 "] failed to send -> "
765 "%d (%s)", stream->id, rc, nghttp3_strerror(rc));
766 break;
767 }
768 Curl_cf_ngtcp2_h3_stream_close(cf, data, stream);
769 result = CURLE_SEND_ERROR;
770 goto out;
771 }
773 cf_ngtcp2_upd_rx_win(cf, data, stream);
775 if(Curl_trc_is_verbose(data)) {
776 infof(data, "[HTTP/3] [%" PRId64 "] OPENED stream for %s",
777 stream->id, Curl_bufref_ptr(&data->state.url));
778 for(i = 0; i < nheader; ++i) {
779 infof(data, "[HTTP/3] [%" PRId64 "] [%.*s: %.*s]", stream->id,
780 (int)nva[i].namelen, nva[i].name,
781 (int)nva[i].valuelen, nva[i].value);
782 }
783 }
785out:
786 curlx_free(nva);
787 Curl_dynhds_free(&h2_headers);
788 return result;
789}
791static CURLcode cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data,
792 const uint8_t *buf, size_t len, bool eos,
793 size_t *pnwritten)
794{
795 struct cf_ngtcp2_ctx *ctx = cf->ctx;
796 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
797 struct cf_call_data save;
798 struct cf_ngtcp2_io_ctx pktx;
799 CURLcode result = CURLE_OK;
801 CF_DATA_SAVE(save, cf, data);
802 DEBUGASSERT(cf->connected);
803 DEBUGASSERT(ctx->qconn);
804 DEBUGASSERT(ctx->h3conn);
805 Curl_cf_ngtcp2_io_ctx_init(&pktx, cf, data);
806 *pnwritten = 0;
808 /* handshake verification failed in callback, do not send anything */
809 if(ctx->tls_vrfy_result) {
810 result = ctx->tls_vrfy_result;
811 goto denied;
812 }
814 (void)eos; /* use for stream EOF and block handling */
815 result = Curl_cf_ngtcp2_progress_ingress(cf, data, &pktx);
816 if(result)
817 goto out;
819 if(!stream || stream->id < 0) {
820 if(ctx->shutdown_started) {
821 CURL_TRC_CF(data, cf, "cannot open stream on closed connection");
822 result = CURLE_SEND_ERROR;
823 goto out;
824 }
825 result = h3_stream_open(cf, data, buf, len, pnwritten);
826 if(result) {
827 CURL_TRC_CF(data, cf, "failed to open stream -> %d", (int)result);
828 goto out;
829 }
830 stream = H3_STREAM_CTX(ctx, data);
831 }
832 else if(stream->xfer_result) {
833 CURL_TRC_CF(data, cf, "[%" PRId64 "] xfer write failed", stream->id);
834 Curl_cf_ngtcp2_h3_stream_close(cf, data, stream);
835 result = stream->xfer_result;
836 goto out;
837 }
838 else if(stream->closed) {
839 if(stream->resp_hds_complete) {
840 /* Server decided to close the stream after having sent us a final
841 * response. This is valid if it is not interested in the request
842 * body. This happens on 30x or 40x responses.
843 * We silently discard the data sent, since this is not a transport
844 * error situation. */
845 CURL_TRC_CF(data, cf, "[%" PRId64 "] discarding data"
846 "on closed stream with response", stream->id);
847 result = CURLE_OK;
848 *pnwritten = len;
849 goto out;
850 }
851 CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) "
852 "-> stream closed", stream->id, len);
853 result = CURLE_HTTP3;
854 goto out;
855 }
856 else if(ctx->shutdown_started) {
857 CURL_TRC_CF(data, cf, "cannot send on closed connection");
858 result = CURLE_SEND_ERROR;
859 goto out;
860 }
861 else if(stream->tx_in_flight_size >= stream->tx_in_flight_ideal) {
862 result = CURLE_AGAIN;
863 goto out;
864 }
865 else {
866 result = Curl_bufq_write(&stream->sendbuf, buf, len, pnwritten);
867 CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send, add to "
868 "sendbuf(len=%zu) -> %d, %zu",
869 stream->id, len, (int)result, *pnwritten);
870 if(result)
871 goto out;
872 (void)nghttp3_conn_resume_stream(ctx->h3conn, stream->id);
873 }
875 if(*pnwritten > 0 && !ctx->tls_handshake_complete && ctx->use_earlydata)
876 ctx->earlydata_skip += *pnwritten;
878 DEBUGASSERT(!result);
879 result = Curl_cf_ngtcp2_progress_egress(cf, data, &pktx);
881 if(*pnwritten > 0) {
882 const size_t delta = (2 * 1024);
883 if(stream->tx_in_flight_size > (stream->tx_in_flight_ideal + delta)) {
884 /* ngtcp2 keeps more in flight than we try to provide for,
885 * increase our "ideal" tx buffer length */
886 stream->tx_in_flight_ideal += delta;
887 CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(%zu), added %zu, "
888 "inflight=%zu, increase tx_win=%zu",
889 stream->id, len, *pnwritten,
890 stream->tx_in_flight_size, stream->tx_in_flight_ideal);
891 }
892 else if((stream->tx_in_flight_size + delta) < stream->tx_in_flight_ideal) {
893 /* ngtcp2 keeps less in flight than we try to provide for,
894 * decrease our "ideal" tx buffer length */
895 stream->tx_in_flight_ideal -= delta;
896 CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(%zu), added %zu, "
897 "inflight=%zu, reduce tx_win=%zu",
898 stream->id, len, *pnwritten,
899 stream->tx_in_flight_size, stream->tx_in_flight_ideal);
900 }
901 }
903out:
904 result = Curl_1st_fatal(result,
905 Curl_cf_ngtcp2_cmn_set_expiry(cf, data, &pktx));
906 if(ctx->tls_vrfy_result)
907 result = ctx->tls_vrfy_result;
908denied:
909 CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(len=%zu) -> %d, %zu",
910 stream ? stream->id : -1, len, (int)result, *pnwritten);
911 CF_DATA_RESTORE(cf, save);
912 return result;
913}
915static CURLcode h3_data_pause(struct Curl_cfilter *cf,
916 struct Curl_easy *data,
917 bool pause)
918{
919 /* There seems to exist no API in ngtcp2 to shrink/enlarge the streams
920 * windows. As we do in HTTP/2. */
921 (void)cf;
922 if(!pause)
923 Curl_multi_mark_dirty(data);
924 return CURLE_OK;
925}
927static CURLcode cf_ngtcp2_cntrl(struct Curl_cfilter *cf,
928 struct Curl_easy *data,
929 int event, int arg1, void *arg2)
930{
931 struct cf_ngtcp2_ctx *ctx = cf->ctx;
932 CURLcode result = CURLE_OK;
933 struct cf_call_data save;
935 CF_DATA_SAVE(save, cf, data);
936 switch(event) {
937 case CF_CTRL_DATA_SETUP:
938 break;
939 case CF_CTRL_DATA_PAUSE:
940 result = h3_data_pause(cf, data, (arg1 != 0));
941 break;
942 case CF_CTRL_DATA_DONE:
943 Curl_cf_ngtcp2_h3_stream_done(cf, data);
944 break;
945 case CF_CTRL_DATA_DONE_SEND: {
946 struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
947 if(stream && !stream->send_closed) {
948 stream->send_closed = TRUE;
949 stream->upload_left = Curl_bufq_len(&stream->sendbuf) -
950 stream->tx_in_flight_size;
951 (void)nghttp3_conn_resume_stream(ctx->h3conn, stream->id);
952 }
953 break;
954 }
955 case CF_CTRL_CONN_INFO_UPDATE:
956 if(!cf->sockindex && cf->connected) {
957 cf->conn->httpversion_seen = 30;
958 Curl_conn_set_multiplex(cf->conn);
959 }
960 break;
961 default:
962 result = Curl_cf_ngtcp2_cmn_cntrl(cf, data, event, arg1, arg2);
963 break;
964 }
965 CF_DATA_RESTORE(cf, save);
966 return result;
967}
969static void cf_ngtcp2_destroy(struct Curl_cfilter *cf, struct Curl_easy *data)
970{
971 struct cf_ngtcp2_ctx *ctx = cf->ctx;
973 CURL_TRC_CF(data, cf, "destroy");
974 if(ctx) {
975 if(ctx->qconn) {
976 struct cf_call_data save;
977 CF_DATA_SAVE(save, cf, data);
978 Curl_cf_ngtcp2_cmn_conn_close(cf, data);
979 CF_DATA_RESTORE(cf, save);
980 }
981 Curl_cf_ngtcp2_ctx_cleanup(ctx);
982 curlx_free(ctx);
983 cf->ctx = NULL;
984 }
985}
987static CURLcode cf_ngtcp2_connect(struct Curl_cfilter *cf,
988 struct Curl_easy *data,
989 bool *done)
990{
991 return Curl_cf_ngtcp2_cmn_connect(cf, data, done);
992}
994static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf,
995 struct Curl_easy *data,
996 int query, int *pres1, void *pres2)
997{
998 struct cf_ngtcp2_ctx *ctx = cf->ctx;
999 struct cf_call_data save;
1001 switch(query) {
1002 case CF_QUERY_MAX_CONCURRENT: {
1003 DEBUGASSERT(pres1);
1004 CF_DATA_SAVE(save, cf, data);
1005 /* Set after transport params arrived and continually updated
1006 * by callback. QUIC counts the number over the lifetime of the
1007 * connection, ever increasing.
1008 * We count the *open* transfers plus the budget for new ones. */
1009 if(!ctx->qconn || ctx->shutdown_started) {
1010 *pres1 = 0;
1011 }
1012 else if(ctx->max_bidi_streams) {
1013 uint64_t avail_bidi_streams = 0;
1014 uint64_t max_streams = cf->conn->attached_xfers;
1015 if(ctx->max_bidi_streams > ctx->used_bidi_streams)
1016 avail_bidi_streams = ctx->max_bidi_streams - ctx->used_bidi_streams;
1017 max_streams += avail_bidi_streams;
1018 *pres1 = (max_streams > INT_MAX) ? INT_MAX : (int)max_streams;
1019 }
1020 else { /* transport params not arrived yet? take our default. */
1021 uint32_t n = Curl_multi_max_concurrent_streams(data->multi);
1022 *pres1 = (n < INT_MAX) ? (int)n : INT_MAX;
1023 }
1024 CURL_TRC_CF(data, cf, "query conn[%" FMT_OFF_T "]: "
1025 "MAX_CONCURRENT -> %d (%u in use)",
1026 cf->conn->connection_id, *pres1, cf->conn->attached_xfers);
1027 CF_DATA_RESTORE(cf, save);
1028 return CURLE_OK;
1029 }
1030 case CF_QUERY_HTTP_VERSION:
1031 *pres1 = 30;
1032 return CURLE_OK;
1033 case CF_QUERY_SSL_INFO:
1034 case CF_QUERY_SSL_CTX_INFO: {
1035 struct curl_tlssessioninfo *info = pres2;
1036 if(Curl_vquic_tls_get_ssl_info(&ctx->tls,
1037 (query == CF_QUERY_SSL_CTX_INFO), info))
1038 return CURLE_OK;
1039 break;
1040 }
1041 case CF_QUERY_ALPN_NEGOTIATED: {
1042 const char **palpn = pres2;
1043 DEBUGASSERT(palpn);
1044 *palpn = cf->connected ? "h3" : NULL;
1045 return CURLE_OK;
1046 }
1047 default:
1048 break;
1049 }
1050 return Curl_cf_ngtcp2_cmn_query(cf, data, query, pres1, pres2);
1051}
1053struct Curl_cftype Curl_cft_http3 = {
1054 "HTTP/3",
1055 CF_TYPE_IP_CONNECT | CF_TYPE_SSL | CF_TYPE_MULTIPLEX | CF_TYPE_HTTP,
1056 0,
1057 cf_ngtcp2_destroy,
1058 cf_ngtcp2_connect,
1059 Curl_cf_ngtcp2_cmn_shutdown,
1060 cf_ngtcp2_adjust_pollset,
1061 Curl_cf_def_data_pending,
1062 cf_ngtcp2_send,
1063 cf_ngtcp2_recv,
1064 cf_ngtcp2_cntrl,
1065 Curl_cf_ngtcp2_cmn_conn_is_alive,
1066 Curl_cf_def_conn_keep_alive,
1067 cf_ngtcp2_query,
1068};
1070CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf,
1071 struct Curl_easy *data,
1072 struct Curl_peer *origin,
1073 struct Curl_peer *peer,
1074 struct connectdata *conn,
1075 struct Curl_sockaddr_ex *addr)
1076{
1077 struct cf_ngtcp2_ctx *ctx = NULL;
1078 struct Curl_cfilter *cf = NULL;
1079 CURLcode result;
1081 ctx = curlx_calloc(1, sizeof(*ctx));
1082 if(!ctx) {
1083 result = CURLE_OUT_OF_MEMORY;
1084 goto out;
1085 }
1086 result = Curl_cf_ngtcp2_ctx_init(ctx, origin, peer,
1087 &conn->ssl_config, init_ngh3_conn);
1088 if(!result)
1089 result = Curl_cf_create(&cf, &Curl_cft_http3, ctx);
1090 if(result)
1091 goto out;
1092 cf->conn = conn;
1094 result = Curl_cf_udp_create(&cf->next, data, origin, peer, TRNSPRT_QUIC,
1095 conn, addr, NULL, TRNSPRT_QUIC);
1096 if(result)
1097 goto out;
1098 cf->next->conn = cf->conn;
1099 cf->next->sockindex = cf->sockindex;
1101out:
1102 *pcf = (!result) ? cf : NULL;
1103 if(result) {
1104 if(cf)
1105 Curl_conn_cf_discard_chain(&cf, data);
1106 else if(ctx) {
1107 Curl_cf_ngtcp2_ctx_cleanup(ctx);
1108 curlx_free(ctx);
1109 }
1110 }
1111 return result;
1112}
1114CURLcode Curl_cf_ngtcp2_insert_after(struct Curl_cfilter *cf_at,
1115 struct Curl_peer *origin,
1116 struct Curl_peer *peer,
1117 struct Curl_cfilter **pcf)
1118{
1119 struct cf_ngtcp2_ctx *ctx = NULL;
1120 struct Curl_cfilter *cf = NULL;
1121 CURLcode result;
1123 ctx = curlx_calloc(1, sizeof(*ctx));
1124 if(!ctx) {
1125 result = CURLE_OUT_OF_MEMORY;
1126 goto out;
1127 }
1128 result = Curl_cf_ngtcp2_ctx_init(ctx, origin, peer,
1129 &cf_at->conn->ssl_config, init_ngh3_conn);
1130 if(!result)
1131 result = Curl_cf_create(&cf, &Curl_cft_http3, ctx);
1132 if(result)
1133 goto out;
1134 Curl_conn_cf_insert_after(cf_at, cf);
1135out:
1136 if(result) {
1137 curlx_safefree(cf);
1138 if(ctx) {
1139 Curl_cf_ngtcp2_ctx_cleanup(ctx);
1140 curlx_free(ctx);
1141 }
1142 }
1143 *pcf = cf;
1144 return result;
1145}
1147#endif
Diagnostics4 git calls · 688 ms
CallStatusSizeTime0688 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 · hit2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=149 git.response.cache=HIT git.response.duration_ms=2 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=681 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=86Open pack map
fetch2009.8 KiB681 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=10002 git.response.cache=MISS git.response.duration_ms=681 git.fetch.wants=8cda37656da4cd7b1a023eb84691f7f64f95021c 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=10002 git.pkt.payload.max=9981 git.sideband.band1.bytes=9980 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
- a5e36decda13e88e
- Request
- 2834fa46…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format