Lines Matching refs:cf

147 #define CF_CTX_CALL_DATA(cf)  \  argument
148 ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
179 static CURLcode cf_progress_ingress(struct Curl_cfilter *cf,
182 static CURLcode cf_progress_egress(struct Curl_cfilter *cf,
223 static CURLcode h3_data_setup(struct Curl_cfilter *cf, in h3_data_setup() argument
226 struct cf_ngtcp2_ctx *ctx = cf->ctx; in h3_data_setup()
254 static void cf_ngtcp2_stream_close(struct Curl_cfilter *cf, in cf_ngtcp2_stream_close() argument
258 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_stream_close()
269 result = cf_progress_egress(cf, data, NULL); in cf_ngtcp2_stream_close()
271 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cancel stream -> %d", in cf_ngtcp2_stream_close()
276 static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) in h3_data_done() argument
278 struct cf_ngtcp2_ctx *ctx = cf->ctx; in h3_data_done()
280 (void)cf; in h3_data_done()
282 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] easy handle is done", in h3_data_done()
284 cf_ngtcp2_stream_close(cf, data, stream); in h3_data_done()
289 static struct Curl_easy *get_stream_easy(struct Curl_cfilter *cf, in get_stream_easy() argument
294 struct cf_ngtcp2_ctx *ctx = cf->ctx; in get_stream_easy()
297 (void)cf; in get_stream_easy()
321 static void h3_drain_stream(struct Curl_cfilter *cf, in h3_drain_stream() argument
324 struct cf_ngtcp2_ctx *ctx = cf->ctx; in h3_drain_stream()
328 (void)cf; in h3_drain_stream()
343 struct Curl_cfilter *cf; member
350 struct Curl_cfilter *cf) in pktx_update_time() argument
352 struct cf_ngtcp2_ctx *ctx = cf->ctx; in pktx_update_time()
360 struct Curl_cfilter *cf, in pktx_init() argument
363 pktx->cf = cf; in pktx_init()
366 pktx_update_time(pktx, cf); in pktx_init()
375 struct Curl_cfilter *cf = conn_ref->user_data; in get_conn() local
376 struct cf_ngtcp2_ctx *ctx = cf->ctx; in get_conn()
383 struct Curl_cfilter *cf = user_data; in quic_printf() local
384 struct cf_ngtcp2_ctx *ctx = cf->ctx; in quic_printf()
398 struct Curl_cfilter *cf = user_data; in qlog_callback() local
399 struct cf_ngtcp2_ctx *ctx = cf->ctx; in qlog_callback()
445 static CURLcode init_ngh3_conn(struct Curl_cfilter *cf);
454 static void cf_ngtcp2_conn_close(struct Curl_cfilter *cf,
464 static void cf_ngtcp2_err_set(struct Curl_cfilter *cf, in cf_ngtcp2_err_set() argument
467 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_err_set()
479 cf_ngtcp2_conn_close(cf, data); in cf_ngtcp2_err_set()
488 static void cf_ngtcp2_h3_err_set(struct Curl_cfilter *cf, in cf_ngtcp2_h3_err_set() argument
491 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_h3_err_set()
497 cf_ngtcp2_conn_close(cf, data); in cf_ngtcp2_h3_err_set()
505 struct Curl_cfilter *cf = user_data; in cb_recv_stream_data() local
506 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_recv_stream_data()
517 data = CF_DATA_CURRENT(cf); in cb_recv_stream_data()
519 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read_stream(len=%zu) -> %zd", in cb_recv_stream_data()
524 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] error on known stream, " in cb_recv_stream_data()
545 struct Curl_cfilter *cf = user_data; in cb_acked_stream_data_offset() local
546 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_acked_stream_data_offset()
566 struct Curl_cfilter *cf = user_data; in cb_stream_close() local
567 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_stream_close()
575 data = CF_DATA_CURRENT(cf); in cb_stream_close()
584 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] quic close(app_error=%" in cb_stream_close()
588 cf_ngtcp2_h3_err_set(cf, data, rv); in cb_stream_close()
599 struct Curl_cfilter *cf = user_data; in cb_stream_reset() local
600 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_stream_reset()
610 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reset -> %d", stream_id, rv); in cb_stream_reset()
622 struct Curl_cfilter *cf = user_data; in cb_stream_stop_sending() local
623 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_stream_stop_sending()
641 struct Curl_cfilter *cf = user_data; in cb_extend_max_local_streams_bidi() local
642 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_extend_max_local_streams_bidi()
643 struct Curl_easy *data = CF_DATA_CURRENT(cf); in cb_extend_max_local_streams_bidi()
648 CURL_TRC_CF(data, cf, "max bidi streams now %" FMT_PRIu64 in cb_extend_max_local_streams_bidi()
658 struct Curl_cfilter *cf = user_data; in cb_extend_max_stream_data() local
659 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_extend_max_stream_data()
661 struct Curl_easy *data = CF_DATA_CURRENT(cf); in cb_extend_max_stream_data()
673 s_data = get_stream_easy(cf, data, stream_id, &stream); in cb_extend_max_stream_data()
675 CURL_TRC_CF(s_data, cf, "[%" FMT_PRId64 "] unblock quic flow", stream_id); in cb_extend_max_stream_data()
677 h3_drain_stream(cf, s_data); in cb_extend_max_stream_data()
719 struct Curl_cfilter *cf = user_data; in cb_recv_rx_key() local
726 if(init_ngh3_conn(cf) != CURLE_OK) { in cb_recv_rx_key()
792 static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, in check_and_set_expiry() argument
796 struct cf_ngtcp2_ctx *ctx = cf->ctx; in check_and_set_expiry()
801 pktx_init(&local_pktx, cf, data); in check_and_set_expiry()
805 pktx_update_time(pktx, cf); in check_and_set_expiry()
816 cf_ngtcp2_err_set(cf, data, rv); in check_and_set_expiry()
819 result = cf_progress_ingress(cf, data, pktx); in check_and_set_expiry()
822 result = cf_progress_egress(cf, data, pktx); in check_and_set_expiry()
841 static void cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf, in cf_ngtcp2_adjust_pollset() argument
845 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_adjust_pollset()
860 CF_DATA_SAVE(save, cf, data); in cf_ngtcp2_adjust_pollset()
870 CF_DATA_RESTORE(cf, save); in cf_ngtcp2_adjust_pollset()
878 struct Curl_cfilter *cf = user_data; in cb_h3_stream_close() local
879 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_h3_stream_close()
895 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] RESET: error %" FMT_PRIu64, in cb_h3_stream_close()
899 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] CLOSED", stream->id); in cb_h3_stream_close()
901 h3_drain_stream(cf, data); in cb_h3_stream_close()
905 static void h3_xfer_write_resp_hd(struct Curl_cfilter *cf, in h3_xfer_write_resp_hd() argument
915 CURL_TRC_CF(data, cf, "[%"FMT_PRId64"] error %d writing %zu " in h3_xfer_write_resp_hd()
920 static void h3_xfer_write_resp(struct Curl_cfilter *cf, in h3_xfer_write_resp() argument
931 CURL_TRC_CF(data, cf, "[%"FMT_PRId64"] error %d writing %zu bytes " in h3_xfer_write_resp()
941 struct Curl_cfilter *cf = user_data; in cb_h3_recv_data() local
942 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_h3_recv_data()
952 h3_xfer_write_resp(cf, data, stream, (char *)buf, blen, FALSE); in cb_h3_recv_data()
954 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] ACK %zu bytes of DATA", in cb_h3_recv_data()
959 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] DATA len=%zu", stream->id, blen); in cb_h3_recv_data()
967 struct Curl_cfilter *cf = user_data; in cb_h3_deferred_consume() local
968 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_h3_deferred_consume()
982 struct Curl_cfilter *cf = user_data; in cb_h3_end_headers() local
983 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_h3_end_headers()
990 (void)cf; in cb_h3_end_headers()
995 h3_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"), stream->closed); in cb_h3_end_headers()
997 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] end_headers, status=%d", in cb_h3_end_headers()
1002 h3_drain_stream(cf, data); in cb_h3_end_headers()
1011 struct Curl_cfilter *cf = user_data; in cb_h3_recv_header() local
1012 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_h3_recv_header()
1023 (void)cf; in cb_h3_recv_header()
1043 h3_xfer_write_resp_hd(cf, data, stream, Curl_dyn_ptr(&ctx->scratch), in cb_h3_recv_header()
1045 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] status: %s", in cb_h3_recv_header()
1053 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] header: %.*s: %.*s", in cb_h3_recv_header()
1067 h3_xfer_write_resp_hd(cf, data, stream, Curl_dyn_ptr(&ctx->scratch), in cb_h3_recv_header()
1077 struct Curl_cfilter *cf = user_data; in cb_h3_stop_sending() local
1078 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_h3_stop_sending()
1095 struct Curl_cfilter *cf = user_data; in cb_h3_reset_stream() local
1096 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_h3_reset_stream()
1105 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] reset -> %d", stream_id, rv); in cb_h3_reset_stream()
1131 static CURLcode init_ngh3_conn(struct Curl_cfilter *cf) in init_ngh3_conn() argument
1133 struct cf_ngtcp2_ctx *ctx = cf->ctx; in init_ngh3_conn()
1148 cf); in init_ngh3_conn()
1191 static ssize_t recv_closed_stream(struct Curl_cfilter *cf, in recv_closed_stream() argument
1198 (void)cf; in recv_closed_stream()
1220 static ssize_t cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, in cf_ngtcp2_recv() argument
1223 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_recv()
1232 CF_DATA_SAVE(save, cf, data); in cf_ngtcp2_recv()
1233 DEBUGASSERT(cf->connected); in cf_ngtcp2_recv()
1239 pktx_init(&pktx, cf, data); in cf_ngtcp2_recv()
1246 if(cf_progress_ingress(cf, data, &pktx)) { in cf_ngtcp2_recv()
1253 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] xfer write failed", stream->id); in cf_ngtcp2_recv()
1254 cf_ngtcp2_stream_close(cf, data, stream); in cf_ngtcp2_recv()
1260 nread = recv_closed_stream(cf, data, stream, err); in cf_ngtcp2_recv()
1267 if(cf_progress_egress(cf, data, &pktx)) { in cf_ngtcp2_recv()
1272 CURLcode result2 = check_and_set_expiry(cf, data, &pktx); in cf_ngtcp2_recv()
1278 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_recv(blen=%zu) -> %zd, %d", in cf_ngtcp2_recv()
1280 CF_DATA_RESTORE(cf, save); in cf_ngtcp2_recv()
1288 struct Curl_cfilter *cf = user_data; in cb_h3_acked_req_body() local
1289 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_h3_acked_req_body()
1294 (void)cf; in cb_h3_acked_req_body()
1323 struct Curl_cfilter *cf = user_data; in cb_h3_read_req_body() local
1324 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cb_h3_read_req_body()
1329 (void)cf; in cb_h3_read_req_body()
1369 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> AGAIN", in cb_h3_read_req_body()
1374 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> " in cb_h3_read_req_body()
1387 static ssize_t h3_stream_open(struct Curl_cfilter *cf, in h3_stream_open() argument
1392 struct cf_ngtcp2_ctx *ctx = cf->ctx; in h3_stream_open()
1406 *err = h3_data_setup(cf, data); in h3_stream_open()
1489 CURL_TRC_CF(data, cf, "h3sid[%" FMT_PRId64 "] failed to send, " in h3_stream_open()
1493 CURL_TRC_CF(data, cf, "h3sid[%" FMT_PRId64 "] failed to send -> " in h3_stream_open()
1518 static ssize_t cf_ngtcp2_send(struct Curl_cfilter *cf, struct Curl_easy *data, in cf_ngtcp2_send() argument
1522 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_send()
1529 CF_DATA_SAVE(save, cf, data); in cf_ngtcp2_send()
1530 DEBUGASSERT(cf->connected); in cf_ngtcp2_send()
1533 pktx_init(&pktx, cf, data); in cf_ngtcp2_send()
1537 result = cf_progress_ingress(cf, data, &pktx); in cf_ngtcp2_send()
1545 CURL_TRC_CF(data, cf, "cannot open stream on closed connection"); in cf_ngtcp2_send()
1550 sent = h3_stream_open(cf, data, buf, len, err); in cf_ngtcp2_send()
1552 CURL_TRC_CF(data, cf, "failed to open stream -> %d", *err); in cf_ngtcp2_send()
1558 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] xfer write failed", stream->id); in cf_ngtcp2_send()
1559 cf_ngtcp2_stream_close(cf, data, stream); in cf_ngtcp2_send()
1571 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] discarding data" in cf_ngtcp2_send()
1577 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] send_body(len=%zu) " in cf_ngtcp2_send()
1584 CURL_TRC_CF(data, cf, "cannot send on closed connection"); in cf_ngtcp2_send()
1591 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send, add to " in cf_ngtcp2_send()
1601 result = cf_progress_egress(cf, data, &pktx); in cf_ngtcp2_send()
1608 result = check_and_set_expiry(cf, data, &pktx); in cf_ngtcp2_send()
1613 CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send(len=%zu) -> %zd, %d", in cf_ngtcp2_send()
1615 CF_DATA_RESTORE(cf, save); in cf_ngtcp2_send()
1619 static CURLcode qng_verify_peer(struct Curl_cfilter *cf, in qng_verify_peer() argument
1622 struct cf_ngtcp2_ctx *ctx = cf->ctx; in qng_verify_peer()
1624 cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ in qng_verify_peer()
1625 cf->conn->httpversion = 30; in qng_verify_peer()
1627 return Curl_vquic_tls_verify_peer(&ctx->tls, cf, data, &ctx->peer); in qng_verify_peer()
1636 struct cf_ngtcp2_ctx *ctx = pktx->cf->ctx; in recv_pkt()
1649 CURL_TRC_CF(pktx->data, pktx->cf, "ingress, read_pkt -> %s (%d)", in recv_pkt()
1651 cf_ngtcp2_err_set(pktx->cf, pktx->data, rv); in recv_pkt()
1663 static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, in cf_progress_ingress() argument
1667 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_progress_ingress()
1672 pktx_init(&local_pktx, cf, data); in cf_progress_ingress()
1676 result = Curl_vquic_tls_before_recv(&ctx->tls, cf, data); in cf_progress_ingress()
1680 return vquic_recv_packets(cf, data, &ctx->q, 1000, recv_pkt, pktx); in cf_progress_ingress()
1692 struct cf_ngtcp2_ctx *ctx = x->cf->ctx; in read_pkt_to_send()
1721 cf_ngtcp2_h3_err_set(x->cf, x->data, (int)veccnt); in read_pkt_to_send()
1745 CURL_TRC_CF(x->data, x->cf, "[%" FMT_PRId64 "] block quic flow", in read_pkt_to_send()
1768 cf_ngtcp2_err_set(x->cf, x->data, (int)n); in read_pkt_to_send()
1795 static CURLcode cf_progress_egress(struct Curl_cfilter *cf, in cf_progress_egress() argument
1799 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_progress_egress()
1808 pktx_init(&local_pktx, cf, data); in cf_progress_egress()
1812 pktx_update_time(pktx, cf); in cf_progress_egress()
1816 curlcode = vquic_flush(cf, data, &ctx->q); in cf_progress_egress()
1851 curlcode = vquic_send(cf, data, &ctx->q, gsolen); in cf_progress_egress()
1873 curlcode = vquic_send_tail_split(cf, data, &ctx->q, in cf_progress_egress()
1890 curlcode = vquic_send(cf, data, &ctx->q, gsolen); in cf_progress_egress()
1911 static bool cf_ngtcp2_data_pending(struct Curl_cfilter *cf, in cf_ngtcp2_data_pending() argument
1914 (void)cf; in cf_ngtcp2_data_pending()
1919 static CURLcode h3_data_pause(struct Curl_cfilter *cf, in h3_data_pause() argument
1926 h3_drain_stream(cf, data); in h3_data_pause()
1932 static CURLcode cf_ngtcp2_data_event(struct Curl_cfilter *cf, in cf_ngtcp2_data_event() argument
1936 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_data_event()
1940 CF_DATA_SAVE(save, cf, data); in cf_ngtcp2_data_event()
1947 result = h3_data_pause(cf, data, (arg1 != 0)); in cf_ngtcp2_data_event()
1950 h3_data_done(cf, data); in cf_ngtcp2_data_event()
1953 h3_data_done(cf, data); in cf_ngtcp2_data_event()
1967 CURL_TRC_CF(data, cf, "data idle"); in cf_ngtcp2_data_event()
1969 result = check_and_set_expiry(cf, data, NULL); in cf_ngtcp2_data_event()
1971 CURL_TRC_CF(data, cf, "data idle, check_and_set_expiry -> %d", result); in cf_ngtcp2_data_event()
1978 CF_DATA_RESTORE(cf, save); in cf_ngtcp2_data_event()
2001 static CURLcode cf_ngtcp2_shutdown(struct Curl_cfilter *cf, in cf_ngtcp2_shutdown() argument
2004 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_shutdown()
2009 if(cf->shutdown || !ctx->qconn) { in cf_ngtcp2_shutdown()
2014 CF_DATA_SAVE(save, cf, data); in cf_ngtcp2_shutdown()
2016 pktx_init(&pktx, cf, data); in cf_ngtcp2_shutdown()
2023 CURL_TRC_CF(data, cf, "shutdown, flushing sendbuf"); in cf_ngtcp2_shutdown()
2024 result = cf_progress_egress(cf, data, &pktx); in cf_ngtcp2_shutdown()
2026 CURL_TRC_CF(data, cf, "sending shutdown packets blocked"); in cf_ngtcp2_shutdown()
2031 CURL_TRC_CF(data, cf, "shutdown, error %d flushing sendbuf", result); in cf_ngtcp2_shutdown()
2043 CURL_TRC_CF(data, cf, "start shutdown(err_type=%d, err_code=%" in cf_ngtcp2_shutdown()
2050 CURL_TRC_CF(data, cf, "error %d adding shutdown packets to sendbuf, " in cf_ngtcp2_shutdown()
2061 CURL_TRC_CF(data, cf, "shutdown, flushing egress"); in cf_ngtcp2_shutdown()
2062 result = vquic_flush(cf, data, &ctx->q); in cf_ngtcp2_shutdown()
2064 CURL_TRC_CF(data, cf, "sending shutdown packets blocked"); in cf_ngtcp2_shutdown()
2069 CURL_TRC_CF(data, cf, "shutdown, error %d flushing sendbuf", result); in cf_ngtcp2_shutdown()
2078 CURL_TRC_CF(data, cf, "shutdown completely sent off, done"); in cf_ngtcp2_shutdown()
2083 CF_DATA_RESTORE(cf, save); in cf_ngtcp2_shutdown()
2087 static void cf_ngtcp2_conn_close(struct Curl_cfilter *cf, in cf_ngtcp2_conn_close() argument
2091 cf_ngtcp2_shutdown(cf, data, &done); in cf_ngtcp2_conn_close()
2094 static void cf_ngtcp2_close(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_ngtcp2_close() argument
2096 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_close()
2099 CF_DATA_SAVE(save, cf, data); in cf_ngtcp2_close()
2101 cf_ngtcp2_conn_close(cf, data); in cf_ngtcp2_close()
2103 CURL_TRC_CF(data, cf, "close"); in cf_ngtcp2_close()
2105 cf->connected = FALSE; in cf_ngtcp2_close()
2106 CF_DATA_RESTORE(cf, save); in cf_ngtcp2_close()
2109 static void cf_ngtcp2_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_ngtcp2_destroy() argument
2111 CURL_TRC_CF(data, cf, "destroy"); in cf_ngtcp2_destroy()
2112 if(cf->ctx) { in cf_ngtcp2_destroy()
2113 cf_ngtcp2_ctx_free(cf->ctx); in cf_ngtcp2_destroy()
2114 cf->ctx = NULL; in cf_ngtcp2_destroy()
2124 struct Curl_cfilter *cf; in quic_ossl_new_session_cb() local
2130 cf = cref ? cref->user_data : NULL; in quic_ossl_new_session_cb()
2131 ctx = cf ? cf->ctx : NULL; in quic_ossl_new_session_cb()
2132 data = cf ? CF_DATA_CURRENT(cf) : NULL; in quic_ossl_new_session_cb()
2133 if(cf && data && ctx) { in quic_ossl_new_session_cb()
2134 Curl_ossl_add_session(cf, data, &ctx->peer, ssl_sessionid); in quic_ossl_new_session_cb()
2147 struct Curl_cfilter *cf = conn_ref ? conn_ref->user_data : NULL; in quic_gtls_handshake_cb() local
2148 struct cf_ngtcp2_ctx *ctx = cf ? cf->ctx : NULL; in quic_gtls_handshake_cb()
2152 if(when && cf && ctx) { /* after message has been processed */ in quic_gtls_handshake_cb()
2153 struct Curl_easy *data = CF_DATA_CURRENT(cf); in quic_gtls_handshake_cb()
2156 CURL_TRC_CF(data, cf, "handshake: %s message type %d", in quic_gtls_handshake_cb()
2161 (void)Curl_gtls_update_session_id(cf, data, session, &ctx->peer, "h3"); in quic_gtls_handshake_cb()
2176 struct Curl_cfilter *cf = conn_ref ? conn_ref->user_data : NULL; in wssl_quic_new_session_cb() local
2178 DEBUGASSERT(cf != NULL); in wssl_quic_new_session_cb()
2179 if(cf && session) { in wssl_quic_new_session_cb()
2180 struct cf_ngtcp2_ctx *ctx = cf->ctx; in wssl_quic_new_session_cb()
2181 struct Curl_easy *data = CF_DATA_CURRENT(cf); in wssl_quic_new_session_cb()
2184 (void)wssl_cache_session(cf, data, &ctx->peer, session); in wssl_quic_new_session_cb()
2191 static CURLcode tls_ctx_setup(struct Curl_cfilter *cf, in tls_ctx_setup() argument
2196 struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); in tls_ctx_setup()
2249 static CURLcode cf_connect_start(struct Curl_cfilter *cf, in cf_connect_start() argument
2253 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_connect_start()
2261 result = Curl_ssl_peer_init(&ctx->peer, cf, TRNSPRT_QUIC); in cf_connect_start()
2266 result = Curl_vquic_tls_init(&ctx->tls, cf, data, &ctx->peer, in cf_connect_start()
2294 Curl_cf_socket_peek(cf->next, data, &ctx->q.sockfd, &sockaddr, NULL); in cf_connect_start()
2313 NULL, cf); in cf_connect_start()
2330 ctx->conn_ref.user_data = cf; in cf_connect_start()
2335 static CURLcode cf_ngtcp2_connect(struct Curl_cfilter *cf, in cf_ngtcp2_connect() argument
2339 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_connect()
2345 if(cf->connected) { in cf_ngtcp2_connect()
2351 if(!cf->next->connected) { in cf_ngtcp2_connect()
2352 result = Curl_conn_cf_connect(cf->next, data, blocking, done); in cf_ngtcp2_connect()
2359 pktx_init(&pktx, cf, data); in cf_ngtcp2_connect()
2361 CF_DATA_SAVE(save, cf, data); in cf_ngtcp2_connect()
2365 result = cf_connect_start(cf, data, &pktx); in cf_ngtcp2_connect()
2368 result = cf_progress_egress(cf, data, &pktx); in cf_ngtcp2_connect()
2373 result = cf_progress_ingress(cf, data, &pktx); in cf_ngtcp2_connect()
2377 result = cf_progress_egress(cf, data, &pktx); in cf_ngtcp2_connect()
2383 CURL_TRC_CF(data, cf, "handshake complete after %dms", in cf_ngtcp2_connect()
2385 result = qng_verify_peer(cf, data); in cf_ngtcp2_connect()
2387 CURL_TRC_CF(data, cf, "peer verified"); in cf_ngtcp2_connect()
2388 cf->connected = TRUE; in cf_ngtcp2_connect()
2389 cf->conn->alpn = CURL_HTTP_VERSION_3; in cf_ngtcp2_connect()
2391 connkeep(cf->conn, "HTTP/3 default"); in cf_ngtcp2_connect()
2409 Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip); in cf_ngtcp2_connect()
2415 result = check_and_set_expiry(cf, data, &pktx); in cf_ngtcp2_connect()
2418 CURL_TRC_CF(data, cf, "connect -> %d, done=%d", result, *done); in cf_ngtcp2_connect()
2419 CF_DATA_RESTORE(cf, save); in cf_ngtcp2_connect()
2423 static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf, in cf_ngtcp2_query() argument
2427 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_query()
2433 CF_DATA_SAVE(save, cf, data); in cf_ngtcp2_query()
2443 uint64_t max_streams = CONN_INUSE(cf->conn); in cf_ngtcp2_query()
2451 CURL_TRC_CF(data, cf, "query conn[%" FMT_OFF_T "]: " in cf_ngtcp2_query()
2453 cf->conn->connection_id, *pres1, CONN_INUSE(cf->conn)); in cf_ngtcp2_query()
2454 CF_DATA_RESTORE(cf, save); in cf_ngtcp2_query()
2473 if(cf->connected) in cf_ngtcp2_query()
2480 return cf->next ? in cf_ngtcp2_query()
2481 cf->next->cft->query(cf->next, data, query, pres1, pres2) : in cf_ngtcp2_query()
2485 static bool cf_ngtcp2_conn_is_alive(struct Curl_cfilter *cf, in cf_ngtcp2_conn_is_alive() argument
2489 struct cf_ngtcp2_ctx *ctx = cf->ctx; in cf_ngtcp2_conn_is_alive()
2494 CF_DATA_SAVE(save, cf, data); in cf_ngtcp2_conn_is_alive()
2517 if(!cf->next || !cf->next->cft->is_alive(cf->next, data, input_pending)) in cf_ngtcp2_conn_is_alive()
2527 result = cf_progress_ingress(cf, data, NULL); in cf_ngtcp2_conn_is_alive()
2528 CURL_TRC_CF(data, cf, "is_alive, progress ingress -> %d", result); in cf_ngtcp2_conn_is_alive()
2533 CF_DATA_RESTORE(cf, save); in cf_ngtcp2_conn_is_alive()
2562 struct Curl_cfilter *cf = NULL, *udp_cf = NULL; in Curl_cf_ngtcp2_create() local
2573 result = Curl_cf_create(&cf, &Curl_cft_http3, ctx); in Curl_cf_ngtcp2_create()
2581 cf->conn = conn; in Curl_cf_ngtcp2_create()
2582 udp_cf->conn = cf->conn; in Curl_cf_ngtcp2_create()
2583 udp_cf->sockindex = cf->sockindex; in Curl_cf_ngtcp2_create()
2584 cf->next = udp_cf; in Curl_cf_ngtcp2_create()
2587 *pcf = (!result) ? cf : NULL; in Curl_cf_ngtcp2_create()
2590 Curl_conn_cf_discard_sub(cf, udp_cf, data, TRUE); in Curl_cf_ngtcp2_create()
2591 Curl_safefree(cf); in Curl_cf_ngtcp2_create()
2601 struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL; in Curl_conn_is_ngtcp2() local
2604 for(; cf; cf = cf->next) { in Curl_conn_is_ngtcp2()
2605 if(cf->cft == &Curl_cft_http3) in Curl_conn_is_ngtcp2()
2607 if(cf->cft->flags & CF_TYPE_IP_CONNECT) in Curl_conn_is_ngtcp2()