Lines Matching refs:cf
158 #define CF_CTX_CALL_DATA(cf) \ argument
159 ((struct cf_msh3_ctx *)(cf)->ctx)->call_data
197 static CURLcode h3_data_setup(struct Curl_cfilter *cf, in h3_data_setup() argument
200 struct cf_msh3_ctx *ctx = cf->ctx; in h3_data_setup()
214 CURL_TRC_CF(data, cf, "data setup"); in h3_data_setup()
224 static void h3_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) in h3_data_done() argument
226 struct cf_msh3_ctx *ctx = cf->ctx; in h3_data_done()
229 (void)cf; in h3_data_done()
231 CURL_TRC_CF(data, cf, "easy handle is done"); in h3_data_done()
251 static void h3_drain_stream(struct Curl_cfilter *cf, in h3_drain_stream() argument
254 struct cf_msh3_ctx *ctx = cf->ctx; in h3_drain_stream()
258 (void)cf; in h3_drain_stream()
277 struct Curl_cfilter *cf = IfContext; in msh3_conn_connected() local
278 struct cf_msh3_ctx *ctx = cf->ctx; in msh3_conn_connected()
279 struct Curl_easy *data = CF_DATA_CURRENT(cf); in msh3_conn_connected()
282 CURL_TRC_CF(data, cf, "[MSH3] connected"); in msh3_conn_connected()
291 struct Curl_cfilter *cf = IfContext; in msh3_conn_shutdown_complete() local
292 struct cf_msh3_ctx *ctx = cf->ctx; in msh3_conn_shutdown_complete()
293 struct Curl_easy *data = CF_DATA_CURRENT(cf); in msh3_conn_shutdown_complete()
296 CURL_TRC_CF(data, cf, "[MSH3] shutdown complete"); in msh3_conn_shutdown_complete()
513 static ssize_t recv_closed_stream(struct Curl_cfilter *cf, in recv_closed_stream() argument
517 struct cf_msh3_ctx *ctx = cf->ctx; in recv_closed_stream()
525 (void)cf; in recv_closed_stream()
529 CURL_TRC_CF(data, cf, "cf_recv, was reset -> %d", *err); in recv_closed_stream()
536 CURL_TRC_CF(data, cf, "cf_recv, closed uncleanly -> %d", *err); in recv_closed_stream()
540 CURL_TRC_CF(data, cf, "cf_recv, closed ok -> %d", *err); in recv_closed_stream()
549 static void set_quic_expire(struct Curl_cfilter *cf, struct Curl_easy *data) in set_quic_expire() argument
551 struct cf_msh3_ctx *ctx = cf->ctx; in set_quic_expire()
557 (void)cf; in set_quic_expire()
566 static ssize_t cf_msh3_recv(struct Curl_cfilter *cf, struct Curl_easy *data, in cf_msh3_recv() argument
569 struct cf_msh3_ctx *ctx = cf->ctx; in cf_msh3_recv()
574 CURL_TRC_CF(data, cf, "cf_recv(len=%zu), stream=%d", len, !!stream); in cf_msh3_recv()
579 CF_DATA_SAVE(save, cf, data); in cf_msh3_recv()
594 CURL_TRC_CF(data, cf, "read recvbuf(len=%zu) -> %zd, %d", in cf_msh3_recv()
599 h3_drain_stream(cf, data); in cf_msh3_recv()
602 nread = recv_closed_stream(cf, data, err); in cf_msh3_recv()
606 CURL_TRC_CF(data, cf, "req: nothing here, call again"); in cf_msh3_recv()
612 set_quic_expire(cf, data); in cf_msh3_recv()
613 CF_DATA_RESTORE(cf, save); in cf_msh3_recv()
617 static ssize_t cf_msh3_send(struct Curl_cfilter *cf, struct Curl_easy *data, in cf_msh3_send() argument
621 struct cf_msh3_ctx *ctx = cf->ctx; in cf_msh3_send()
630 CF_DATA_SAVE(save, cf, data); in cf_msh3_send()
637 CURL_TRC_CF(data, cf, "req: send %zu bytes", len); in cf_msh3_send()
671 CURL_TRC_CF(data, cf, "req: send %zu headers", nheader); in cf_msh3_send()
687 CURL_TRC_CF(data, cf, "req: send %zu body bytes", len); in cf_msh3_send()
705 set_quic_expire(cf, data); in cf_msh3_send()
709 CF_DATA_RESTORE(cf, save); in cf_msh3_send()
713 static void cf_msh3_adjust_pollset(struct Curl_cfilter *cf, in cf_msh3_adjust_pollset() argument
717 struct cf_msh3_ctx *ctx = cf->ctx; in cf_msh3_adjust_pollset()
721 CF_DATA_SAVE(save, cf, data); in cf_msh3_adjust_pollset()
725 h3_drain_stream(cf, data); in cf_msh3_adjust_pollset()
729 h3_drain_stream(cf, data); in cf_msh3_adjust_pollset()
734 static bool cf_msh3_data_pending(struct Curl_cfilter *cf, in cf_msh3_data_pending() argument
737 struct cf_msh3_ctx *ctx = cf->ctx; in cf_msh3_data_pending()
742 CF_DATA_SAVE(save, cf, data); in cf_msh3_data_pending()
744 (void)cf; in cf_msh3_data_pending()
747 CURL_TRC_CF((struct Curl_easy *)data, cf, "data pending = %zu", in cf_msh3_data_pending()
752 h3_drain_stream(cf, (struct Curl_easy *)data); in cf_msh3_data_pending()
755 CF_DATA_RESTORE(cf, save); in cf_msh3_data_pending()
759 static CURLcode h3_data_pause(struct Curl_cfilter *cf, in h3_data_pause() argument
764 h3_drain_stream(cf, data); in h3_data_pause()
770 static CURLcode cf_msh3_data_event(struct Curl_cfilter *cf, in cf_msh3_data_event() argument
774 struct cf_msh3_ctx *ctx = cf->ctx; in cf_msh3_data_event()
779 CF_DATA_SAVE(save, cf, data); in cf_msh3_data_event()
785 result = h3_data_setup(cf, data); in cf_msh3_data_event()
788 result = h3_data_pause(cf, data, (arg1 != 0)); in cf_msh3_data_event()
791 h3_data_done(cf, data); in cf_msh3_data_event()
794 CURL_TRC_CF(data, cf, "req: send done"); in cf_msh3_data_event()
810 CF_DATA_RESTORE(cf, save); in cf_msh3_data_event()
814 static CURLcode cf_connect_start(struct Curl_cfilter *cf, in cf_connect_start() argument
817 struct cf_msh3_ctx *ctx = cf->ctx; in cf_connect_start()
824 conn_config = Curl_ssl_cf_get_primary_config(cf); in cf_connect_start()
830 MSH3_SET_PORT(&addr, (uint16_t)cf->conn->remote_port); in cf_connect_start()
836 CURL_TRC_CF(data, cf, "non-standard CA not supported, " in cf_connect_start()
840 CURL_TRC_CF(data, cf, "non-standard CA not supported, " in cf_connect_start()
845 CURL_TRC_CF(data, cf, "connecting to %s:%d (verify=%d)", in cf_connect_start()
846 cf->conn->host.name, (int)cf->conn->remote_port, verify); in cf_connect_start()
856 cf, in cf_connect_start()
857 cf->conn->host.name, in cf_connect_start()
869 result = h3_data_setup(cf, data); in cf_connect_start()
876 static CURLcode cf_msh3_connect(struct Curl_cfilter *cf, in cf_msh3_connect() argument
880 struct cf_msh3_ctx *ctx = cf->ctx; in cf_msh3_connect()
885 if(cf->connected) { in cf_msh3_connect()
890 CF_DATA_SAVE(save, cf, data); in cf_msh3_connect()
903 result = cf_connect_start(cf, data); in cf_msh3_connect()
911 CURL_TRC_CF(data, cf, "handshake succeeded"); in cf_msh3_connect()
912 cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ in cf_msh3_connect()
913 cf->conn->httpversion = 30; in cf_msh3_connect()
914 cf->connected = TRUE; in cf_msh3_connect()
915 cf->conn->alpn = CURL_HTTP_VERSION_3; in cf_msh3_connect()
917 connkeep(cf->conn, "HTTP/3 default"); in cf_msh3_connect()
927 CF_DATA_RESTORE(cf, save); in cf_msh3_connect()
931 static void cf_msh3_close(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_msh3_close() argument
933 struct cf_msh3_ctx *ctx = cf->ctx; in cf_msh3_close()
937 CF_DATA_SAVE(save, cf, data); in cf_msh3_close()
940 CURL_TRC_CF(data, cf, "destroying"); in cf_msh3_close()
956 if(ctx->sock[SP_LOCAL] == cf->conn->sock[cf->sockindex]) { in cf_msh3_close()
957 CURL_TRC_CF(data, cf, "cf_msh3_close(%d) active", in cf_msh3_close()
959 cf->conn->sock[cf->sockindex] = CURL_SOCKET_BAD; in cf_msh3_close()
962 CURL_TRC_CF(data, cf, "cf_socket_close(%d) no longer at " in cf_msh3_close()
966 if(cf->sockindex == FIRSTSOCKET) in cf_msh3_close()
967 cf->conn->remote_addr = NULL; in cf_msh3_close()
978 CF_DATA_RESTORE(cf, save); in cf_msh3_close()
981 static void cf_msh3_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_msh3_destroy() argument
985 CF_DATA_SAVE(save, cf, data); in cf_msh3_destroy()
986 cf_msh3_close(cf, data); in cf_msh3_destroy()
987 if(cf->ctx) { in cf_msh3_destroy()
988 cf_msh3_ctx_free(cf->ctx); in cf_msh3_destroy()
989 cf->ctx = NULL; in cf_msh3_destroy()
994 static CURLcode cf_msh3_query(struct Curl_cfilter *cf, in cf_msh3_query() argument
998 struct cf_msh3_ctx *ctx = cf->ctx; in cf_msh3_query()
1010 if(cf->connected) in cf_msh3_query()
1016 if(cf->connected) in cf_msh3_query()
1023 return cf->next ? in cf_msh3_query()
1024 cf->next->cft->query(cf->next, data, query, pres1, pres2) : in cf_msh3_query()
1028 static bool cf_msh3_conn_is_alive(struct Curl_cfilter *cf, in cf_msh3_conn_is_alive() argument
1032 struct cf_msh3_ctx *ctx = cf->ctx; in cf_msh3_conn_is_alive()
1062 struct Curl_cfilter *cf = data->conn->cfilter[FIRSTSOCKET]; in h3_get_msh3_ctx() local
1063 while(cf) { in h3_get_msh3_ctx()
1064 if(cf->cft == &Curl_cft_http3) in h3_get_msh3_ctx()
1065 return cf->ctx; in h3_get_msh3_ctx()
1066 cf = cf->next; in h3_get_msh3_ctx()
1079 struct Curl_cfilter *cf = NULL; in Curl_cf_msh3_create() local
1092 result = Curl_cf_create(&cf, &Curl_cft_http3, ctx); in Curl_cf_msh3_create()
1095 *pcf = (!result) ? cf : NULL; in Curl_cf_msh3_create()
1097 Curl_safefree(cf); in Curl_cf_msh3_create()
1108 struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL; in Curl_conn_is_msh3() local
1111 for(; cf; cf = cf->next) { in Curl_conn_is_msh3()
1112 if(cf->cft == &Curl_cft_http3) in Curl_conn_is_msh3()
1114 if(cf->cft->flags & CF_TYPE_IP_CONNECT) in Curl_conn_is_msh3()