|
|
#ifndef HEADER_CURL_VQUIC_QUIC_INT_H |
|
|
#define HEADER_CURL_VQUIC_QUIC_INT_H |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "curl_setup.h" |
|
|
#include "bufq.h" |
|
|
|
|
|
#ifdef USE_HTTP3 |
|
|
|
|
|
#define MAX_PKT_BURST 10 |
|
|
#define MAX_UDP_PAYLOAD_SIZE 1452 |
|
|
|
|
|
#define CURL_QUIC_MAX_IDLE_MS (120 * 1000) |
|
|
|
|
|
struct cf_quic_ctx { |
|
|
curl_socket_t sockfd; |
|
|
struct sockaddr_storage local_addr; |
|
|
socklen_t local_addrlen; |
|
|
|
|
|
struct bufq sendbuf; |
|
|
struct curltime first_byte_at; |
|
|
struct curltime last_op; |
|
|
struct curltime last_io; |
|
|
size_t gsolen; |
|
|
size_t split_len; |
|
|
size_t split_gsolen; |
|
|
#ifdef DEBUGBUILD |
|
|
int wblock_percent; |
|
|
#endif |
|
|
BIT(got_first_byte); |
|
|
BIT(no_gso); |
|
|
}; |
|
|
|
|
|
CURLcode vquic_ctx_init(struct cf_quic_ctx *qctx); |
|
|
void vquic_ctx_free(struct cf_quic_ctx *qctx); |
|
|
|
|
|
void vquic_ctx_update_time(struct cf_quic_ctx *qctx); |
|
|
|
|
|
void vquic_push_blocked_pkt(struct Curl_cfilter *cf, |
|
|
struct cf_quic_ctx *qctx, |
|
|
const uint8_t *pkt, size_t pktlen, size_t gsolen); |
|
|
|
|
|
CURLcode vquic_send_blocked_pkts(struct Curl_cfilter *cf, |
|
|
struct Curl_easy *data, |
|
|
struct cf_quic_ctx *qctx); |
|
|
|
|
|
CURLcode vquic_send(struct Curl_cfilter *cf, struct Curl_easy *data, |
|
|
struct cf_quic_ctx *qctx, size_t gsolen); |
|
|
|
|
|
CURLcode vquic_send_tail_split(struct Curl_cfilter *cf, struct Curl_easy *data, |
|
|
struct cf_quic_ctx *qctx, size_t gsolen, |
|
|
size_t tail_len, size_t tail_gsolen); |
|
|
|
|
|
CURLcode vquic_flush(struct Curl_cfilter *cf, struct Curl_easy *data, |
|
|
struct cf_quic_ctx *qctx); |
|
|
|
|
|
|
|
|
typedef CURLcode vquic_recv_pkt_cb(const unsigned char *pkt, size_t pktlen, |
|
|
struct sockaddr_storage *remote_addr, |
|
|
socklen_t remote_addrlen, int ecn, |
|
|
void *userp); |
|
|
|
|
|
CURLcode vquic_recv_packets(struct Curl_cfilter *cf, |
|
|
struct Curl_easy *data, |
|
|
struct cf_quic_ctx *qctx, |
|
|
size_t max_pkts, |
|
|
vquic_recv_pkt_cb *recv_cb, void *userp); |
|
|
|
|
|
#endif |
|
|
|
|
|
#endif |
|
|
|