comparison src/event/ngx_event_quic.h @ 8334:72d20158c814 quic

Added reordering support for STREAM frames. Each stream node now includes incoming frames queue and sent/received counters for tracking offset. The sent counter is not used, c->sent is used, not like in crypto buffers, which have no connections.
author Vladimir Homutov <vl@nginx.com>
date Wed, 15 Apr 2020 11:11:54 +0300
parents 4cf00c14f11a
children 6481427ca3fc
comparison
equal deleted inserted replaced
8333:167d32476737 8334:72d20158c814
27 #define NGX_QUIC_STREAM_BUFSIZE 16384 27 #define NGX_QUIC_STREAM_BUFSIZE 16384
28 28
29 29
30 typedef struct { 30 typedef struct {
31 /* configurable */ 31 /* configurable */
32 ngx_msec_t max_idle_timeout; 32 ngx_msec_t max_idle_timeout;
33 ngx_msec_t max_ack_delay; 33 ngx_msec_t max_ack_delay;
34 34
35 ngx_uint_t max_packet_size; 35 ngx_uint_t max_packet_size;
36 ngx_uint_t initial_max_data; 36 ngx_uint_t initial_max_data;
37 ngx_uint_t initial_max_stream_data_bidi_local; 37 ngx_uint_t initial_max_stream_data_bidi_local;
38 ngx_uint_t initial_max_stream_data_bidi_remote; 38 ngx_uint_t initial_max_stream_data_bidi_remote;
39 ngx_uint_t initial_max_stream_data_uni; 39 ngx_uint_t initial_max_stream_data_uni;
40 ngx_uint_t initial_max_streams_bidi; 40 ngx_uint_t initial_max_streams_bidi;
41 ngx_uint_t initial_max_streams_uni; 41 ngx_uint_t initial_max_streams_uni;
42 ngx_uint_t ack_delay_exponent; 42 ngx_uint_t ack_delay_exponent;
43 ngx_uint_t disable_active_migration; 43 ngx_uint_t disable_active_migration;
44 ngx_uint_t active_connection_id_limit; 44 ngx_uint_t active_connection_id_limit;
45 45
46 /* TODO */ 46 /* TODO */
47 ngx_uint_t original_connection_id; 47 ngx_uint_t original_connection_id;
48 u_char stateless_reset_token[16]; 48 u_char stateless_reset_token[16];
49 void *preferred_address; 49 void *preferred_address;
50 } ngx_quic_tp_t; 50 } ngx_quic_tp_t;
51 51
52 52
53 typedef struct {
54 uint64_t sent;
55 uint64_t received;
56 ngx_queue_t frames; /* reorder queue */
57 size_t total; /* size of buffered data */
58 } ngx_quic_frames_stream_t;
59
60
53 struct ngx_quic_stream_s { 61 struct ngx_quic_stream_s {
54 ngx_rbtree_node_t node; 62 ngx_rbtree_node_t node;
55 ngx_connection_t *parent; 63 ngx_connection_t *parent;
56 ngx_connection_t *c; 64 ngx_connection_t *c;
57 uint64_t id; 65 uint64_t id;
58 ngx_buf_t *b; 66 ngx_buf_t *b;
67 ngx_quic_frames_stream_t fs;
59 }; 68 };
60 69
61 70
62 void ngx_quic_run(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_tp_t *tp, 71 void ngx_quic_run(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_tp_t *tp,
63 ngx_connection_handler_pt handler); 72 ngx_connection_handler_pt handler);