Mercurial > hg > nginx-quic
comparison src/event/quic/ngx_event_quic.h @ 8825:b42a041d23a2 quic
QUIC: introduced explicit stream states.
This allows to eliminate the usage of stream connection event flags for tracking
stream state.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Mon, 31 Jan 2022 09:46:02 +0300 |
parents | 3d0fc72d409e |
children | cba58cb06b3a |
comparison
equal
deleted
inserted
replaced
8824:81a3429db8b0 | 8825:b42a041d23a2 |
---|---|
24 | 24 |
25 #define NGX_QUIC_MIN_INITIAL_SIZE 1200 | 25 #define NGX_QUIC_MIN_INITIAL_SIZE 1200 |
26 | 26 |
27 #define NGX_QUIC_STREAM_SERVER_INITIATED 0x01 | 27 #define NGX_QUIC_STREAM_SERVER_INITIATED 0x01 |
28 #define NGX_QUIC_STREAM_UNIDIRECTIONAL 0x02 | 28 #define NGX_QUIC_STREAM_UNIDIRECTIONAL 0x02 |
29 | |
30 | |
31 typedef enum { | |
32 NGX_QUIC_STREAM_SEND_READY = 0, | |
33 NGX_QUIC_STREAM_SEND_SEND, | |
34 NGX_QUIC_STREAM_SEND_DATA_SENT, | |
35 NGX_QUIC_STREAM_SEND_DATA_RECVD, | |
36 NGX_QUIC_STREAM_SEND_RESET_SENT, | |
37 NGX_QUIC_STREAM_SEND_RESET_RECVD | |
38 } ngx_quic_stream_send_state_e; | |
39 | |
40 | |
41 typedef enum { | |
42 NGX_QUIC_STREAM_RECV_RECV = 0, | |
43 NGX_QUIC_STREAM_RECV_SIZE_KNOWN, | |
44 NGX_QUIC_STREAM_RECV_DATA_RECVD, | |
45 NGX_QUIC_STREAM_RECV_DATA_READ, | |
46 NGX_QUIC_STREAM_RECV_RESET_RECVD, | |
47 NGX_QUIC_STREAM_RECV_RESET_READ | |
48 } ngx_quic_stream_recv_state_e; | |
29 | 49 |
30 | 50 |
31 typedef struct { | 51 typedef struct { |
32 ngx_ssl_t *ssl; | 52 ngx_ssl_t *ssl; |
33 | 53 |
64 uint64_t recv_last; | 84 uint64_t recv_last; |
65 uint64_t final_size; | 85 uint64_t final_size; |
66 ngx_chain_t *in; | 86 ngx_chain_t *in; |
67 ngx_chain_t *out; | 87 ngx_chain_t *out; |
68 ngx_uint_t cancelable; /* unsigned cancelable:1; */ | 88 ngx_uint_t cancelable; /* unsigned cancelable:1; */ |
89 ngx_quic_stream_send_state_e send_state; | |
90 ngx_quic_stream_recv_state_e recv_state; | |
69 }; | 91 }; |
70 | 92 |
71 | 93 |
72 void ngx_quic_run(ngx_connection_t *c, ngx_quic_conf_t *conf); | 94 void ngx_quic_run(ngx_connection_t *c, ngx_quic_conf_t *conf); |
73 ngx_connection_t *ngx_quic_open_stream(ngx_connection_t *c, ngx_uint_t bidi); | 95 ngx_connection_t *ngx_quic_open_stream(ngx_connection_t *c, ngx_uint_t bidi); |