/src/openssl32/include/internal/quic_stream_map.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved. |
3 | | * |
4 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | | * this file except in compliance with the License. You can obtain a copy |
6 | | * in the file LICENSE in the source distribution or at |
7 | | * https://www.openssl.org/source/license.html |
8 | | */ |
9 | | |
10 | | #ifndef OSSL_INTERNAL_QUIC_STREAM_MAP_H |
11 | | # define OSSL_INTERNAL_QUIC_STREAM_MAP_H |
12 | | # pragma once |
13 | | |
14 | | # include "internal/e_os.h" |
15 | | # include "internal/time.h" |
16 | | # include "internal/common.h" |
17 | | # include "internal/quic_types.h" |
18 | | # include "internal/quic_stream.h" |
19 | | # include "internal/quic_fc.h" |
20 | | # include <openssl/lhash.h> |
21 | | |
22 | | # ifndef OPENSSL_NO_QUIC |
23 | | |
24 | | /* |
25 | | * QUIC Stream |
26 | | * =========== |
27 | | * |
28 | | * Logical QUIC stream composing all relevant send and receive components. |
29 | | */ |
30 | | typedef struct quic_stream_st QUIC_STREAM; |
31 | | |
32 | | typedef struct quic_stream_list_node_st QUIC_STREAM_LIST_NODE; |
33 | | |
34 | | struct quic_stream_list_node_st { |
35 | | QUIC_STREAM_LIST_NODE *prev, *next; |
36 | | }; |
37 | | |
38 | | /* |
39 | | * QUIC Send Stream States |
40 | | * ----------------------- |
41 | | * |
42 | | * These correspond to the states defined in RFC 9000 s. 3.1, with the |
43 | | * exception of the NONE state which represents the absence of a send stream |
44 | | * part. |
45 | | * |
46 | | * Invariants in each state are noted in comments below. In particular, once all |
47 | | * data has been acknowledged received, or we have reset the stream, we don't |
48 | | * need to keep the QUIC_SSTREAM and data buffers around. Of course, we also |
49 | | * don't have a QUIC_SSTREAM on a receive-only stream. |
50 | | */ |
51 | 154k | #define QUIC_SSTREAM_STATE_NONE 0 /* --- sstream == NULL */ |
52 | 76.4k | #define QUIC_SSTREAM_STATE_READY 1 /* \ */ |
53 | 512k | #define QUIC_SSTREAM_STATE_SEND 2 /* |-- sstream != NULL */ |
54 | 933k | #define QUIC_SSTREAM_STATE_DATA_SENT 3 /* / */ |
55 | 0 | #define QUIC_SSTREAM_STATE_DATA_RECVD 4 /* \ */ |
56 | 67.4k | #define QUIC_SSTREAM_STATE_RESET_SENT 5 /* |-- sstream == NULL */ |
57 | 44.6k | #define QUIC_SSTREAM_STATE_RESET_RECVD 6 /* / */ |
58 | | |
59 | | /* |
60 | | * QUIC Receive Stream States |
61 | | * -------------------------- |
62 | | * |
63 | | * These correspond to the states defined in RFC 9000 s. 3.2, with the exception |
64 | | * of the NONE state which represents the absence of a receive stream part. |
65 | | * |
66 | | * Invariants in each state are noted in comments below. In particular, once all |
67 | | * data has been read by the application, we don't need to keep the QUIC_RSTREAM |
68 | | * and data buffers around. If the receive part is instead reset before it is |
69 | | * finished, we also don't need to keep the QUIC_RSTREAM around. Finally, we |
70 | | * don't need a QUIC_RSTREAM on a send-only stream. |
71 | | */ |
72 | 528k | #define QUIC_RSTREAM_STATE_NONE 0 /* --- rstream == NULL */ |
73 | 6.22M | #define QUIC_RSTREAM_STATE_RECV 1 /* \ */ |
74 | 11.6M | #define QUIC_RSTREAM_STATE_SIZE_KNOWN 2 /* |-- rstream != NULL */ |
75 | 11.6M | #define QUIC_RSTREAM_STATE_DATA_RECVD 3 /* / */ |
76 | 12.6k | #define QUIC_RSTREAM_STATE_DATA_READ 4 /* \ */ |
77 | 875k | #define QUIC_RSTREAM_STATE_RESET_RECVD 5 /* |-- rstream == NULL */ |
78 | 434k | #define QUIC_RSTREAM_STATE_RESET_READ 6 /* / */ |
79 | | |
80 | | struct quic_stream_st { |
81 | | QUIC_STREAM_LIST_NODE active_node; /* for use by QUIC_STREAM_MAP */ |
82 | | QUIC_STREAM_LIST_NODE accept_node; /* accept queue of remotely-created streams */ |
83 | | QUIC_STREAM_LIST_NODE ready_for_gc_node; /* queue of streams now ready for GC */ |
84 | | |
85 | | /* Temporary link used by TXP. */ |
86 | | QUIC_STREAM *txp_next; |
87 | | |
88 | | /* |
89 | | * QUIC Stream ID. Do not assume that this encodes a type as this is a |
90 | | * version-specific property and may change between QUIC versions; instead, |
91 | | * use the type field. |
92 | | */ |
93 | | uint64_t id; |
94 | | |
95 | | /* |
96 | | * Application Error Code (AEC) used for STOP_SENDING frame. |
97 | | * This is only valid if stop_sending is 1. |
98 | | */ |
99 | | uint64_t stop_sending_aec; |
100 | | |
101 | | /* |
102 | | * Application Error Code (AEC) used for RESET_STREAM frame. |
103 | | * This is only valid if reset_stream is 1. |
104 | | */ |
105 | | uint64_t reset_stream_aec; |
106 | | |
107 | | /* |
108 | | * Application Error Code (AEC) for incoming STOP_SENDING frame. |
109 | | * This is only valid if peer_stop_sending is 1. |
110 | | */ |
111 | | uint64_t peer_stop_sending_aec; |
112 | | |
113 | | /* |
114 | | * Application Error Code (AEC) for incoming RESET_STREAM frame. |
115 | | * This is only valid if peer_reset_stream is 1. |
116 | | */ |
117 | | uint64_t peer_reset_stream_aec; |
118 | | |
119 | | /* Temporary value used by TXP. */ |
120 | | uint64_t txp_txfc_new_credit_consumed; |
121 | | |
122 | | /* |
123 | | * The final size of the send stream. Although this information can be |
124 | | * discerned from a QUIC_SSTREAM, it is stored separately as we need to keep |
125 | | * track of this even if we have thrown away the QUIC_SSTREAM. Use |
126 | | * ossl_quic_stream_send_get_final_size to determine if this contain a |
127 | | * valid value or if there is no final size yet for a sending part. |
128 | | * |
129 | | * For the receive part, the final size is tracked by the stream-level RXFC; |
130 | | * use ossl_quic_stream_recv_get_final_size or |
131 | | * ossl_quic_rxfc_get_final_size. |
132 | | */ |
133 | | uint64_t send_final_size; |
134 | | |
135 | | /* |
136 | | * Send stream part and receive stream part buffer management objects. |
137 | | * |
138 | | * DO NOT test these pointers (sstream, rstream) for NULL. Determine the |
139 | | * state of the send or receive stream part first using the appropriate |
140 | | * function; then the invariant of that state guarantees that sstream or |
141 | | * rstream either is or is not NULL respectively, therefore there is no |
142 | | * valid use case for testing these pointers for NULL. In particular, a |
143 | | * stream with a send part can still have sstream as NULL, and a stream with |
144 | | * a receive part can still have rstream as NULL. QUIC_SSTREAM and |
145 | | * QUIC_RSTREAM are stream buffer resource management objects which exist |
146 | | * only when they need to for buffer management purposes. The existence or |
147 | | * non-existence of a QUIC_SSTREAM or QUIC_RSTREAM object does not |
148 | | * correspond with whether a stream's respective send or receive part |
149 | | * logically exists or not. |
150 | | */ |
151 | | QUIC_SSTREAM *sstream; /* NULL if RX-only */ |
152 | | QUIC_RSTREAM *rstream; /* NULL if TX only */ |
153 | | |
154 | | /* Stream-level flow control managers. */ |
155 | | QUIC_TXFC txfc; /* NULL if RX-only */ |
156 | | QUIC_RXFC rxfc; /* NULL if TX-only */ |
157 | | |
158 | | unsigned int type : 8; /* QUIC_STREAM_INITIATOR_*, QUIC_STREAM_DIR_* */ |
159 | | |
160 | | unsigned int send_state : 8; /* QUIC_SSTREAM_STATE_* */ |
161 | | unsigned int recv_state : 8; /* QUIC_RSTREAM_STATE_* */ |
162 | | |
163 | | /* 1 iff this QUIC_STREAM is on the active queue (invariant). */ |
164 | | unsigned int active : 1; |
165 | | |
166 | | /* |
167 | | * This is a copy of the QUIC connection as_server value, indicating |
168 | | * whether we are locally operating as a server or not. Having this |
169 | | * significantly simplifies stream type determination relative to our |
170 | | * perspective. It never changes after a QUIC_STREAM is created and is the |
171 | | * same for all QUIC_STREAMS under a QUIC_STREAM_MAP. |
172 | | */ |
173 | | unsigned int as_server : 1; |
174 | | |
175 | | /* |
176 | | * Has STOP_SENDING been requested (by us)? Note that this is not the same |
177 | | * as want_stop_sending below, as a STOP_SENDING frame may already have been |
178 | | * sent and fully acknowledged. |
179 | | */ |
180 | | unsigned int stop_sending : 1; |
181 | | |
182 | | /* |
183 | | * Has RESET_STREAM been requested (by us)? Works identically to |
184 | | * STOP_SENDING for transmission purposes. |
185 | | */ |
186 | | /* Has our peer sent a STOP_SENDING frame? */ |
187 | | unsigned int peer_stop_sending : 1; |
188 | | |
189 | | /* Temporary flags used by TXP. */ |
190 | | unsigned int txp_sent_fc : 1; |
191 | | unsigned int txp_sent_stop_sending : 1; |
192 | | unsigned int txp_sent_reset_stream : 1; |
193 | | unsigned int txp_drained : 1; |
194 | | unsigned int txp_blocked : 1; |
195 | | |
196 | | /* Frame regeneration flags. */ |
197 | | unsigned int want_max_stream_data : 1; /* used for regen only */ |
198 | | unsigned int want_stop_sending : 1; /* used for gen or regen */ |
199 | | unsigned int want_reset_stream : 1; /* used for gen or regen */ |
200 | | |
201 | | /* Flags set when frames *we* sent were acknowledged. */ |
202 | | unsigned int acked_stop_sending : 1; |
203 | | |
204 | | /* |
205 | | * The stream's XSO has been deleted. Pending GC. |
206 | | * |
207 | | * Here is how stream deletion works: |
208 | | * |
209 | | * - A QUIC_STREAM cannot be deleted until it is neither in the accept |
210 | | * queue nor has an associated XSO. This condition occurs when and only |
211 | | * when deleted is true. |
212 | | * |
213 | | * - Once this is the case (i.e., no user-facing API object exposing the |
214 | | * stream), we can delete the stream once we determine that all of our |
215 | | * protocol obligations requiring us to keep the QUIC_STREAM around have |
216 | | * been met. |
217 | | * |
218 | | * The following frames relate to the streams layer for a specific |
219 | | * stream: |
220 | | * |
221 | | * STREAM |
222 | | * |
223 | | * RX Obligations: |
224 | | * Ignore for a deleted stream. |
225 | | * |
226 | | * (This is different from our obligation for a |
227 | | * locally-initiated stream ID we have not created yet, |
228 | | * which we must treat as a protocol error. This can be |
229 | | * distinguished via a simple monotonic counter.) |
230 | | * |
231 | | * TX Obligations: |
232 | | * None, once we've decided to (someday) delete the stream. |
233 | | * |
234 | | * STOP_SENDING |
235 | | * |
236 | | * We cannot delete the stream until we have finished informing |
237 | | * the peer that we are not going to be listening to it |
238 | | * anymore. |
239 | | * |
240 | | * RX Obligations: |
241 | | * When we delete a stream we must have already had a FIN |
242 | | * or RESET_STREAM we transmitted acknowledged by the peer. |
243 | | * Thus we can ignore STOP_SENDING frames for deleted |
244 | | * streams (if they occur, they are probably just |
245 | | * retransmissions). |
246 | | * |
247 | | * TX Obligations: |
248 | | * _Acknowledged_ receipt of a STOP_SENDING frame by the |
249 | | * peer (unless the peer's send part has already FIN'd). |
250 | | * |
251 | | * RESET_STREAM |
252 | | * |
253 | | * We cannot delete the stream until we have finished informing |
254 | | * the peer that we are not going to be transmitting on it |
255 | | * anymore. |
256 | | * |
257 | | * RX Obligations: |
258 | | * This indicates the peer is not going to send any more |
259 | | * data on the stream. We don't need to care about this |
260 | | * since once a stream is marked for deletion we don't care |
261 | | * about any data it does send. We can ignore this for |
262 | | * deleted streams. The important criterion is that the |
263 | | * peer has been successfully delivered our STOP_SENDING |
264 | | * frame. |
265 | | * |
266 | | * TX Obligations: |
267 | | * _Acknowledged_ receipt of a RESET_STREAM frame or FIN by |
268 | | * the peer. |
269 | | * |
270 | | * MAX_STREAM_DATA |
271 | | * |
272 | | * RX Obligations: |
273 | | * Ignore. Since we are not going to be sending any more |
274 | | * data on a stream once it has been marked for deletion, |
275 | | * we don't need to care about flow control information. |
276 | | * |
277 | | * TX Obligations: |
278 | | * None. |
279 | | * |
280 | | * In other words, our protocol obligation is simply: |
281 | | * |
282 | | * - either: |
283 | | * - the peer has acknowledged receipt of a STOP_SENDING frame sent |
284 | | * by us; -or- |
285 | | * - we have received a FIN and all preceding segments from the peer |
286 | | * |
287 | | * [NOTE: The actual criterion required here is simply 'we have |
288 | | * received a FIN from the peer'. However, due to reordering and |
289 | | * retransmissions we might subsequently receive non-FIN segments |
290 | | * out of order. The FIN means we know the peer will stop |
291 | | * transmitting on the stream at *some* point, but by sending |
292 | | * STOP_SENDING we can avoid these needless retransmissions we |
293 | | * will just ignore anyway. In actuality we could just handle all |
294 | | * cases by sending a STOP_SENDING. The strategy we choose is to |
295 | | * only avoid sending a STOP_SENDING and rely on a received FIN |
296 | | * when we have received all preceding data, as this makes it |
297 | | * reasonably certain no benefit would be gained by sending |
298 | | * STOP_SENDING.] |
299 | | * |
300 | | * TODO(QUIC FUTURE): Implement the latter case (currently we |
301 | | just always do STOP_SENDING). |
302 | | * |
303 | | * and; |
304 | | * |
305 | | * - we have drained our send stream (for a finished send stream) |
306 | | * and got acknowledgement all parts of it including the FIN, or |
307 | | * sent a RESET_STREAM frame and got acknowledgement of that frame. |
308 | | * |
309 | | * Once these conditions are met, we can GC the QUIC_STREAM. |
310 | | * |
311 | | */ |
312 | | unsigned int deleted : 1; |
313 | | /* Set to 1 once the above conditions are actually met. */ |
314 | | unsigned int ready_for_gc : 1; |
315 | | /* Set to 1 if this is currently counted in the shutdown flush stream count. */ |
316 | | unsigned int shutdown_flush : 1; |
317 | | }; |
318 | | |
319 | 4.79k | #define QUIC_STREAM_INITIATOR_CLIENT 0 |
320 | 2.29M | #define QUIC_STREAM_INITIATOR_SERVER 1 |
321 | 796k | #define QUIC_STREAM_INITIATOR_MASK 1 |
322 | | |
323 | 1.29M | #define QUIC_STREAM_DIR_BIDI 0 |
324 | 840k | #define QUIC_STREAM_DIR_UNI 2 |
325 | 698k | #define QUIC_STREAM_DIR_MASK 2 |
326 | | |
327 | | void ossl_quic_stream_check(const QUIC_STREAM *s); |
328 | | |
329 | | /* |
330 | | * Returns 1 if the QUIC_STREAM was initiated by the endpoint with the server |
331 | | * role. |
332 | | */ |
333 | | static ossl_inline ossl_unused int ossl_quic_stream_is_server_init(const QUIC_STREAM *s) |
334 | 613k | { |
335 | 613k | return (s->type & QUIC_STREAM_INITIATOR_MASK) == QUIC_STREAM_INITIATOR_SERVER; |
336 | 613k | } Unexecuted instantiation: methods.c:ossl_quic_stream_is_server_init Unexecuted instantiation: s3_lib.c:ossl_quic_stream_is_server_init Unexecuted instantiation: s3_msg.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_init.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_is_server_init Unexecuted instantiation: t1_lib.c:ossl_quic_stream_is_server_init Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_is_server_init Unexecuted instantiation: tls_depr.c:ossl_quic_stream_is_server_init Unexecuted instantiation: tls_srp.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic_impl.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic_method.c:ossl_quic_stream_is_server_init quic_stream_map.c:ossl_quic_stream_is_server_init Line | Count | Source | 334 | 552k | { | 335 | 552k | return (s->type & QUIC_STREAM_INITIATOR_MASK) == QUIC_STREAM_INITIATOR_SERVER; | 336 | 552k | } |
Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_is_server_init Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_is_server_init Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_is_server_init Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_is_server_init Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_is_server_init Unexecuted instantiation: tls_common.c:ossl_quic_stream_is_server_init Unexecuted instantiation: tls_multib.c:ossl_quic_stream_is_server_init Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_is_server_init Unexecuted instantiation: extensions.c:ossl_quic_stream_is_server_init Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_is_server_init Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_is_server_init Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_is_server_init Unexecuted instantiation: statem.c:ossl_quic_stream_is_server_init Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_is_server_init Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_is_server_init Unexecuted instantiation: statem_lib.c:ossl_quic_stream_is_server_init Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_is_server_init Unexecuted instantiation: d1_lib.c:ossl_quic_stream_is_server_init Unexecuted instantiation: d1_msg.c:ossl_quic_stream_is_server_init Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_is_server_init Unexecuted instantiation: pqueue.c:ossl_quic_stream_is_server_init Unexecuted instantiation: s3_enc.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_is_server_init Unexecuted instantiation: t1_enc.c:ossl_quic_stream_is_server_init quic_channel.c:ossl_quic_stream_is_server_init Line | Count | Source | 334 | 61.1k | { | 335 | 61.1k | return (s->type & QUIC_STREAM_INITIATOR_MASK) == QUIC_STREAM_INITIATOR_SERVER; | 336 | 61.1k | } |
Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic_rx_depack.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic_tls.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic_txp.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic_wire.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_is_server_init Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_is_server_init Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_is_server_init Unexecuted instantiation: quic-client.c:ossl_quic_stream_is_server_init |
337 | | |
338 | | /* |
339 | | * Returns 1 if the QUIC_STREAM is bidirectional and 0 if it is unidirectional. |
340 | | */ |
341 | | static ossl_inline ossl_unused int ossl_quic_stream_is_bidi(const QUIC_STREAM *s) |
342 | 515k | { |
343 | 515k | return (s->type & QUIC_STREAM_DIR_MASK) == QUIC_STREAM_DIR_BIDI; |
344 | 515k | } Unexecuted instantiation: methods.c:ossl_quic_stream_is_bidi Unexecuted instantiation: s3_lib.c:ossl_quic_stream_is_bidi Unexecuted instantiation: s3_msg.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_init.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_is_bidi Unexecuted instantiation: t1_lib.c:ossl_quic_stream_is_bidi Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_is_bidi Unexecuted instantiation: tls_depr.c:ossl_quic_stream_is_bidi Unexecuted instantiation: tls_srp.c:ossl_quic_stream_is_bidi Unexecuted instantiation: quic_impl.c:ossl_quic_stream_is_bidi Unexecuted instantiation: quic_method.c:ossl_quic_stream_is_bidi quic_stream_map.c:ossl_quic_stream_is_bidi Line | Count | Source | 342 | 124k | { | 343 | 124k | return (s->type & QUIC_STREAM_DIR_MASK) == QUIC_STREAM_DIR_BIDI; | 344 | 124k | } |
Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_is_bidi Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_is_bidi Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_is_bidi Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_is_bidi Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_is_bidi Unexecuted instantiation: tls_common.c:ossl_quic_stream_is_bidi Unexecuted instantiation: tls_multib.c:ossl_quic_stream_is_bidi Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_is_bidi Unexecuted instantiation: extensions.c:ossl_quic_stream_is_bidi Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_is_bidi Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_is_bidi Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_is_bidi Unexecuted instantiation: statem.c:ossl_quic_stream_is_bidi Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_is_bidi Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_is_bidi Unexecuted instantiation: statem_lib.c:ossl_quic_stream_is_bidi Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_is_bidi Unexecuted instantiation: d1_lib.c:ossl_quic_stream_is_bidi Unexecuted instantiation: d1_msg.c:ossl_quic_stream_is_bidi Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_is_bidi Unexecuted instantiation: pqueue.c:ossl_quic_stream_is_bidi Unexecuted instantiation: s3_enc.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_is_bidi Unexecuted instantiation: t1_enc.c:ossl_quic_stream_is_bidi quic_channel.c:ossl_quic_stream_is_bidi Line | Count | Source | 342 | 61.1k | { | 343 | 61.1k | return (s->type & QUIC_STREAM_DIR_MASK) == QUIC_STREAM_DIR_BIDI; | 344 | 61.1k | } |
Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_is_bidi Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_is_bidi Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_is_bidi Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_is_bidi quic_rx_depack.c:ossl_quic_stream_is_bidi Line | Count | Source | 342 | 329k | { | 343 | 329k | return (s->type & QUIC_STREAM_DIR_MASK) == QUIC_STREAM_DIR_BIDI; | 344 | 329k | } |
Unexecuted instantiation: quic_tls.c:ossl_quic_stream_is_bidi Unexecuted instantiation: quic_txp.c:ossl_quic_stream_is_bidi Unexecuted instantiation: quic_wire.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_is_bidi Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_is_bidi Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_is_bidi Unexecuted instantiation: quic-client.c:ossl_quic_stream_is_bidi |
345 | | |
346 | | /* Returns 1 if the QUIC_STREAM was locally initiated. */ |
347 | | static ossl_inline ossl_unused int ossl_quic_stream_is_local_init(const QUIC_STREAM *s) |
348 | 122k | { |
349 | 122k | return ossl_quic_stream_is_server_init(s) == s->as_server; |
350 | 122k | } Unexecuted instantiation: methods.c:ossl_quic_stream_is_local_init Unexecuted instantiation: s3_lib.c:ossl_quic_stream_is_local_init Unexecuted instantiation: s3_msg.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_init.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_is_local_init Unexecuted instantiation: t1_lib.c:ossl_quic_stream_is_local_init Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_is_local_init Unexecuted instantiation: tls_depr.c:ossl_quic_stream_is_local_init Unexecuted instantiation: tls_srp.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_impl.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_method.c:ossl_quic_stream_is_local_init quic_stream_map.c:ossl_quic_stream_is_local_init Line | Count | Source | 348 | 122k | { | 349 | 122k | return ossl_quic_stream_is_server_init(s) == s->as_server; | 350 | 122k | } |
Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_is_local_init Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_is_local_init Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_is_local_init Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_is_local_init Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_is_local_init Unexecuted instantiation: tls_common.c:ossl_quic_stream_is_local_init Unexecuted instantiation: tls_multib.c:ossl_quic_stream_is_local_init Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_is_local_init Unexecuted instantiation: extensions.c:ossl_quic_stream_is_local_init Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_is_local_init Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_is_local_init Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_is_local_init Unexecuted instantiation: statem.c:ossl_quic_stream_is_local_init Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_is_local_init Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_is_local_init Unexecuted instantiation: statem_lib.c:ossl_quic_stream_is_local_init Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_is_local_init Unexecuted instantiation: d1_lib.c:ossl_quic_stream_is_local_init Unexecuted instantiation: d1_msg.c:ossl_quic_stream_is_local_init Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_is_local_init Unexecuted instantiation: pqueue.c:ossl_quic_stream_is_local_init Unexecuted instantiation: s3_enc.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_is_local_init Unexecuted instantiation: t1_enc.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_channel.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_rx_depack.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_tls.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_txp.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic_wire.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_is_local_init Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_is_local_init Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_is_local_init Unexecuted instantiation: quic-client.c:ossl_quic_stream_is_local_init |
351 | | |
352 | | /* |
353 | | * Returns 1 if the QUIC_STREAM has a sending part, based on its stream type. |
354 | | * |
355 | | * Do NOT use (s->sstream != NULL) to test this; use this function. Note that |
356 | | * even if this function returns 1, s->sstream might be NULL if the QUIC_SSTREAM |
357 | | * has been deemed no longer needed, for example due to a RESET_STREAM. |
358 | | */ |
359 | | static ossl_inline ossl_unused int ossl_quic_stream_has_send(const QUIC_STREAM *s) |
360 | 50.4k | { |
361 | 50.4k | return s->send_state != QUIC_SSTREAM_STATE_NONE; |
362 | 50.4k | } Unexecuted instantiation: methods.c:ossl_quic_stream_has_send Unexecuted instantiation: s3_lib.c:ossl_quic_stream_has_send Unexecuted instantiation: s3_msg.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_init.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_has_send Unexecuted instantiation: t1_lib.c:ossl_quic_stream_has_send Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_has_send Unexecuted instantiation: tls_depr.c:ossl_quic_stream_has_send Unexecuted instantiation: tls_srp.c:ossl_quic_stream_has_send Unexecuted instantiation: quic_impl.c:ossl_quic_stream_has_send Unexecuted instantiation: quic_method.c:ossl_quic_stream_has_send quic_stream_map.c:ossl_quic_stream_has_send Line | Count | Source | 360 | 5.62k | { | 361 | 5.62k | return s->send_state != QUIC_SSTREAM_STATE_NONE; | 362 | 5.62k | } |
Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_has_send Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_has_send Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_has_send Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_has_send Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_has_send Unexecuted instantiation: tls_common.c:ossl_quic_stream_has_send Unexecuted instantiation: tls_multib.c:ossl_quic_stream_has_send Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_has_send Unexecuted instantiation: extensions.c:ossl_quic_stream_has_send Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_has_send Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_has_send Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_has_send Unexecuted instantiation: statem.c:ossl_quic_stream_has_send Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_has_send Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_has_send Unexecuted instantiation: statem_lib.c:ossl_quic_stream_has_send Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_has_send Unexecuted instantiation: d1_lib.c:ossl_quic_stream_has_send Unexecuted instantiation: d1_msg.c:ossl_quic_stream_has_send Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_has_send Unexecuted instantiation: pqueue.c:ossl_quic_stream_has_send Unexecuted instantiation: s3_enc.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_has_send Unexecuted instantiation: t1_enc.c:ossl_quic_stream_has_send Unexecuted instantiation: quic_channel.c:ossl_quic_stream_has_send Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_has_send Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_has_send Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_has_send Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_has_send quic_rx_depack.c:ossl_quic_stream_has_send Line | Count | Source | 360 | 44.8k | { | 361 | 44.8k | return s->send_state != QUIC_SSTREAM_STATE_NONE; | 362 | 44.8k | } |
Unexecuted instantiation: quic_tls.c:ossl_quic_stream_has_send Unexecuted instantiation: quic_txp.c:ossl_quic_stream_has_send Unexecuted instantiation: quic_wire.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_has_send Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_has_send Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_has_send Unexecuted instantiation: quic-client.c:ossl_quic_stream_has_send |
363 | | |
364 | | /* |
365 | | * Returns 1 if the QUIC_STREAM has a receiving part, based on its stream type. |
366 | | * |
367 | | * Do NOT use (s->rstream != NULL) to test this; use this function. Note that |
368 | | * even if this function returns 1, s->rstream might be NULL if the QUIC_RSTREAM |
369 | | * has been deemed no longer needed, for example if the receive stream is |
370 | | * completely finished with. |
371 | | */ |
372 | | static ossl_inline ossl_unused int ossl_quic_stream_has_recv(const QUIC_STREAM *s) |
373 | 467k | { |
374 | 467k | return s->recv_state != QUIC_RSTREAM_STATE_NONE; |
375 | 467k | } Unexecuted instantiation: methods.c:ossl_quic_stream_has_recv Unexecuted instantiation: s3_lib.c:ossl_quic_stream_has_recv Unexecuted instantiation: s3_msg.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_init.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_has_recv Unexecuted instantiation: t1_lib.c:ossl_quic_stream_has_recv Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_has_recv Unexecuted instantiation: tls_depr.c:ossl_quic_stream_has_recv Unexecuted instantiation: tls_srp.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic_impl.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic_method.c:ossl_quic_stream_has_recv quic_stream_map.c:ossl_quic_stream_has_recv Line | Count | Source | 373 | 435k | { | 374 | 435k | return s->recv_state != QUIC_RSTREAM_STATE_NONE; | 375 | 435k | } |
Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_has_recv Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_has_recv Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_has_recv Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_has_recv Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_has_recv Unexecuted instantiation: tls_common.c:ossl_quic_stream_has_recv Unexecuted instantiation: tls_multib.c:ossl_quic_stream_has_recv Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_has_recv Unexecuted instantiation: extensions.c:ossl_quic_stream_has_recv Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_has_recv Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_has_recv Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_has_recv Unexecuted instantiation: statem.c:ossl_quic_stream_has_recv Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_has_recv Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_has_recv Unexecuted instantiation: statem_lib.c:ossl_quic_stream_has_recv Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_has_recv Unexecuted instantiation: d1_lib.c:ossl_quic_stream_has_recv Unexecuted instantiation: d1_msg.c:ossl_quic_stream_has_recv Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_has_recv Unexecuted instantiation: pqueue.c:ossl_quic_stream_has_recv Unexecuted instantiation: s3_enc.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_has_recv Unexecuted instantiation: t1_enc.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic_channel.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_has_recv quic_rx_depack.c:ossl_quic_stream_has_recv Line | Count | Source | 373 | 31.7k | { | 374 | 31.7k | return s->recv_state != QUIC_RSTREAM_STATE_NONE; | 375 | 31.7k | } |
Unexecuted instantiation: quic_tls.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic_txp.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic_wire.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_has_recv Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_has_recv Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_has_recv Unexecuted instantiation: quic-client.c:ossl_quic_stream_has_recv |
376 | | |
377 | | /* |
378 | | * Returns 1 if the QUIC_STREAM has a QUIC_SSTREAM send buffer associated with |
379 | | * it. If this returns 1, s->sstream is guaranteed to be non-NULL. The converse |
380 | | * is not necessarily true; erasure of a send stream buffer which is no longer |
381 | | * required is an optimisation which the QSM may, but is not obliged, to |
382 | | * perform. |
383 | | * |
384 | | * This call should be used where it is desired to do something with the send |
385 | | * stream buffer but there is no more specific send state restriction which is |
386 | | * applicable. |
387 | | * |
388 | | * Note: This does NOT indicate whether it is suitable to allow an application |
389 | | * to append to the buffer. DATA_SENT indicates all data (including FIN) has |
390 | | * been *sent*; the absence of DATA_SENT does not mean a FIN has not been queued |
391 | | * (meaning no more application data can be appended). This is enforced by |
392 | | * QUIC_SSTREAM. |
393 | | */ |
394 | | static ossl_inline ossl_unused int ossl_quic_stream_has_send_buffer(const QUIC_STREAM *s) |
395 | 12.6k | { |
396 | 12.6k | switch (s->send_state) { |
397 | 0 | case QUIC_SSTREAM_STATE_READY: |
398 | 7.00k | case QUIC_SSTREAM_STATE_SEND: |
399 | 7.00k | case QUIC_SSTREAM_STATE_DATA_SENT: |
400 | 7.00k | return 1; |
401 | 5.64k | default: |
402 | 5.64k | return 0; |
403 | 12.6k | } |
404 | 12.6k | } Unexecuted instantiation: methods.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: s3_lib.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: s3_msg.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_init.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: t1_lib.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: tls_depr.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: tls_srp.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_impl.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_method.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_stream_map.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: tls_common.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: tls_multib.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: extensions.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: statem.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: statem_lib.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: d1_lib.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: d1_msg.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: pqueue.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: s3_enc.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: t1_enc.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_channel.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_rx_depack.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic_tls.c:ossl_quic_stream_has_send_buffer quic_txp.c:ossl_quic_stream_has_send_buffer Line | Count | Source | 395 | 12.6k | { | 396 | 12.6k | switch (s->send_state) { | 397 | 0 | case QUIC_SSTREAM_STATE_READY: | 398 | 7.00k | case QUIC_SSTREAM_STATE_SEND: | 399 | 7.00k | case QUIC_SSTREAM_STATE_DATA_SENT: | 400 | 7.00k | return 1; | 401 | 5.64k | default: | 402 | 5.64k | return 0; | 403 | 12.6k | } | 404 | 12.6k | } |
Unexecuted instantiation: quic_wire.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_has_send_buffer Unexecuted instantiation: quic-client.c:ossl_quic_stream_has_send_buffer |
405 | | |
406 | | /* |
407 | | * Returns 1 if the QUIC_STREAM has a sending part which is in one of the reset |
408 | | * states. |
409 | | */ |
410 | | static ossl_inline ossl_unused int ossl_quic_stream_send_is_reset(const QUIC_STREAM *s) |
411 | 9.50k | { |
412 | 9.50k | return s->send_state == QUIC_SSTREAM_STATE_RESET_SENT |
413 | 9.50k | || s->send_state == QUIC_SSTREAM_STATE_RESET_RECVD; |
414 | 9.50k | } Unexecuted instantiation: methods.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: s3_lib.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: s3_msg.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_init.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: t1_lib.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: tls_depr.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: tls_srp.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic_impl.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic_method.c:ossl_quic_stream_send_is_reset quic_stream_map.c:ossl_quic_stream_send_is_reset Line | Count | Source | 411 | 5.32k | { | 412 | 5.32k | return s->send_state == QUIC_SSTREAM_STATE_RESET_SENT | 413 | 5.32k | || s->send_state == QUIC_SSTREAM_STATE_RESET_RECVD; | 414 | 5.32k | } |
Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: tls_common.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: tls_multib.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: extensions.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: statem.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: statem_lib.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: d1_lib.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: d1_msg.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: pqueue.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: s3_enc.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: t1_enc.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic_channel.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic_rx_depack.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic_tls.c:ossl_quic_stream_send_is_reset quic_txp.c:ossl_quic_stream_send_is_reset Line | Count | Source | 411 | 4.18k | { | 412 | 4.18k | return s->send_state == QUIC_SSTREAM_STATE_RESET_SENT | 413 | 4.18k | || s->send_state == QUIC_SSTREAM_STATE_RESET_RECVD; | 414 | 4.18k | } |
Unexecuted instantiation: quic_wire.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_send_is_reset Unexecuted instantiation: quic-client.c:ossl_quic_stream_send_is_reset |
415 | | |
416 | | /* |
417 | | * Returns 1 if the QUIC_STREAM has a QUIC_RSTREAM receive buffer associated |
418 | | * with it. If this returns 1, s->rstream is guaranteed to be non-NULL. The |
419 | | * converse is not necessarily true; erasure of a receive stream buffer which is |
420 | | * no longer required is an optimisation which the QSM may, but is not obliged, |
421 | | * to perform. |
422 | | * |
423 | | * This call should be used where it is desired to do something with the receive |
424 | | * stream buffer but there is no more specific receive state restriction which is |
425 | | * applicable. |
426 | | */ |
427 | | static ossl_inline ossl_unused int ossl_quic_stream_has_recv_buffer(const QUIC_STREAM *s) |
428 | 0 | { |
429 | 0 | switch (s->recv_state) { |
430 | 0 | case QUIC_RSTREAM_STATE_RECV: |
431 | 0 | case QUIC_RSTREAM_STATE_SIZE_KNOWN: |
432 | 0 | case QUIC_RSTREAM_STATE_DATA_RECVD: |
433 | 0 | return 1; |
434 | 0 | default: |
435 | 0 | return 0; |
436 | 0 | } |
437 | 0 | } Unexecuted instantiation: methods.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: s3_lib.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: s3_msg.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_init.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: t1_lib.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: tls_depr.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: tls_srp.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_impl.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_method.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_stream_map.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: tls_common.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: tls_multib.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: extensions.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: statem.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: statem_lib.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: d1_lib.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: d1_msg.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: pqueue.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: s3_enc.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: t1_enc.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_channel.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_rx_depack.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_tls.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_txp.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic_wire.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_has_recv_buffer Unexecuted instantiation: quic-client.c:ossl_quic_stream_has_recv_buffer |
438 | | |
439 | | /* |
440 | | * Returns 1 if the QUIC_STREAM has a receiving part which is in one of the |
441 | | * reset states. |
442 | | */ |
443 | | static ossl_inline ossl_unused int ossl_quic_stream_recv_is_reset(const QUIC_STREAM *s) |
444 | 430k | { |
445 | 430k | return s->recv_state == QUIC_RSTREAM_STATE_RESET_RECVD |
446 | 430k | || s->recv_state == QUIC_RSTREAM_STATE_RESET_READ; |
447 | 430k | } Unexecuted instantiation: methods.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: s3_lib.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: s3_msg.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_init.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: t1_lib.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: tls_depr.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: tls_srp.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_impl.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_method.c:ossl_quic_stream_recv_is_reset quic_stream_map.c:ossl_quic_stream_recv_is_reset Line | Count | Source | 444 | 430k | { | 445 | 430k | return s->recv_state == QUIC_RSTREAM_STATE_RESET_RECVD | 446 | 430k | || s->recv_state == QUIC_RSTREAM_STATE_RESET_READ; | 447 | 430k | } |
Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: tls_common.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: tls_multib.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: extensions.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: statem.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: statem_lib.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: d1_lib.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: d1_msg.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: pqueue.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: s3_enc.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: t1_enc.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_channel.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_rx_depack.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_tls.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_txp.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic_wire.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_recv_is_reset Unexecuted instantiation: quic-client.c:ossl_quic_stream_recv_is_reset |
448 | | |
449 | | /* |
450 | | * Returns 1 if the stream has a send part and that part has a final size. |
451 | | * |
452 | | * If final_size is non-NULL, *final_size is the final size (on success) or an |
453 | | * undefined value otherwise. |
454 | | */ |
455 | | static ossl_inline ossl_unused int ossl_quic_stream_send_get_final_size(const QUIC_STREAM *s, |
456 | | uint64_t *final_size) |
457 | 2.88k | { |
458 | 2.88k | switch (s->send_state) { |
459 | 0 | default: |
460 | 0 | case QUIC_SSTREAM_STATE_NONE: |
461 | 0 | return 0; |
462 | 0 | case QUIC_SSTREAM_STATE_SEND: |
463 | | /* |
464 | | * SEND may or may not have had a FIN - even if we have a FIN we do not |
465 | | * move to DATA_SENT until we have actually sent all the data. So |
466 | | * ask the QUIC_SSTREAM. |
467 | | */ |
468 | 0 | return ossl_quic_sstream_get_final_size(s->sstream, final_size); |
469 | 0 | case QUIC_SSTREAM_STATE_DATA_SENT: |
470 | 0 | case QUIC_SSTREAM_STATE_DATA_RECVD: |
471 | 2.88k | case QUIC_SSTREAM_STATE_RESET_SENT: |
472 | 2.88k | case QUIC_SSTREAM_STATE_RESET_RECVD: |
473 | 2.88k | if (final_size != NULL) |
474 | 2.88k | *final_size = s->send_final_size; |
475 | 2.88k | return 1; |
476 | 2.88k | } |
477 | 2.88k | } Unexecuted instantiation: methods.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: s3_lib.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: s3_msg.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_init.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: t1_lib.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: tls_depr.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: tls_srp.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_impl.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_method.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_stream_map.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: tls_common.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: tls_multib.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: extensions.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: statem.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: statem_lib.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: d1_lib.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: d1_msg.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: pqueue.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: s3_enc.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: t1_enc.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_channel.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_rx_depack.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic_tls.c:ossl_quic_stream_send_get_final_size quic_txp.c:ossl_quic_stream_send_get_final_size Line | Count | Source | 457 | 2.88k | { | 458 | 2.88k | switch (s->send_state) { | 459 | 0 | default: | 460 | 0 | case QUIC_SSTREAM_STATE_NONE: | 461 | 0 | return 0; | 462 | 0 | case QUIC_SSTREAM_STATE_SEND: | 463 | | /* | 464 | | * SEND may or may not have had a FIN - even if we have a FIN we do not | 465 | | * move to DATA_SENT until we have actually sent all the data. So | 466 | | * ask the QUIC_SSTREAM. | 467 | | */ | 468 | 0 | return ossl_quic_sstream_get_final_size(s->sstream, final_size); | 469 | 0 | case QUIC_SSTREAM_STATE_DATA_SENT: | 470 | 0 | case QUIC_SSTREAM_STATE_DATA_RECVD: | 471 | 2.88k | case QUIC_SSTREAM_STATE_RESET_SENT: | 472 | 2.88k | case QUIC_SSTREAM_STATE_RESET_RECVD: | 473 | 2.88k | if (final_size != NULL) | 474 | 2.88k | *final_size = s->send_final_size; | 475 | 2.88k | return 1; | 476 | 2.88k | } | 477 | 2.88k | } |
Unexecuted instantiation: quic_wire.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_send_get_final_size Unexecuted instantiation: quic-client.c:ossl_quic_stream_send_get_final_size |
478 | | |
479 | | /* |
480 | | * Returns 1 if the stream has a receive part and that part has a final size. |
481 | | * |
482 | | * If final_size is non-NULL, *final_size is the final size (on success) or an |
483 | | * undefined value otherwise. |
484 | | */ |
485 | | static ossl_inline ossl_unused int ossl_quic_stream_recv_get_final_size(const QUIC_STREAM *s, |
486 | | uint64_t *final_size) |
487 | 9.94k | { |
488 | 9.94k | switch (s->recv_state) { |
489 | 0 | default: |
490 | 0 | case QUIC_RSTREAM_STATE_NONE: |
491 | 2.17k | case QUIC_RSTREAM_STATE_RECV: |
492 | 2.17k | return 0; |
493 | | |
494 | 7.76k | case QUIC_RSTREAM_STATE_SIZE_KNOWN: |
495 | 7.76k | case QUIC_RSTREAM_STATE_DATA_RECVD: |
496 | 7.76k | case QUIC_RSTREAM_STATE_DATA_READ: |
497 | 7.76k | case QUIC_RSTREAM_STATE_RESET_RECVD: |
498 | 7.76k | case QUIC_RSTREAM_STATE_RESET_READ: |
499 | 7.76k | if (!ossl_assert(ossl_quic_rxfc_get_final_size(&s->rxfc, final_size))) |
500 | 0 | return 0; |
501 | | |
502 | 7.76k | return 1; |
503 | 9.94k | } |
504 | 9.94k | } Unexecuted instantiation: methods.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: s3_lib.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: s3_msg.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_init.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: t1_lib.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: tls_depr.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: tls_srp.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic_impl.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic_method.c:ossl_quic_stream_recv_get_final_size quic_stream_map.c:ossl_quic_stream_recv_get_final_size Line | Count | Source | 487 | 349 | { | 488 | 349 | switch (s->recv_state) { | 489 | 0 | default: | 490 | 0 | case QUIC_RSTREAM_STATE_NONE: | 491 | 347 | case QUIC_RSTREAM_STATE_RECV: | 492 | 347 | return 0; | 493 | | | 494 | 1 | case QUIC_RSTREAM_STATE_SIZE_KNOWN: | 495 | 2 | case QUIC_RSTREAM_STATE_DATA_RECVD: | 496 | 2 | case QUIC_RSTREAM_STATE_DATA_READ: | 497 | 2 | case QUIC_RSTREAM_STATE_RESET_RECVD: | 498 | 2 | case QUIC_RSTREAM_STATE_RESET_READ: | 499 | 2 | if (!ossl_assert(ossl_quic_rxfc_get_final_size(&s->rxfc, final_size))) | 500 | 0 | return 0; | 501 | | | 502 | 2 | return 1; | 503 | 349 | } | 504 | 349 | } |
Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: tls_common.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: tls_multib.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: extensions.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: statem.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: statem_lib.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: d1_lib.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: d1_msg.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: pqueue.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: s3_enc.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: t1_enc.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic_channel.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_recv_get_final_size quic_rx_depack.c:ossl_quic_stream_recv_get_final_size Line | Count | Source | 487 | 9.59k | { | 488 | 9.59k | switch (s->recv_state) { | 489 | 0 | default: | 490 | 0 | case QUIC_RSTREAM_STATE_NONE: | 491 | 1.82k | case QUIC_RSTREAM_STATE_RECV: | 492 | 1.82k | return 0; | 493 | | | 494 | 7.76k | case QUIC_RSTREAM_STATE_SIZE_KNOWN: | 495 | 7.76k | case QUIC_RSTREAM_STATE_DATA_RECVD: | 496 | 7.76k | case QUIC_RSTREAM_STATE_DATA_READ: | 497 | 7.76k | case QUIC_RSTREAM_STATE_RESET_RECVD: | 498 | 7.76k | case QUIC_RSTREAM_STATE_RESET_READ: | 499 | 7.76k | if (!ossl_assert(ossl_quic_rxfc_get_final_size(&s->rxfc, final_size))) | 500 | 0 | return 0; | 501 | | | 502 | 7.76k | return 1; | 503 | 9.59k | } | 504 | 9.59k | } |
Unexecuted instantiation: quic_tls.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic_txp.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic_wire.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_recv_get_final_size Unexecuted instantiation: quic-client.c:ossl_quic_stream_recv_get_final_size |
505 | | |
506 | | /* |
507 | | * Determines the number of bytes available still to be read, and (if |
508 | | * include_fin is 1) whether a FIN or reset has yet to be read. |
509 | | */ |
510 | | static ossl_inline ossl_unused int ossl_quic_stream_recv_pending(const QUIC_STREAM *s, |
511 | | int include_fin) |
512 | 0 | { |
513 | 0 | size_t avail; |
514 | 0 | int fin = 0; |
515 | |
|
516 | 0 | switch (s->recv_state) { |
517 | 0 | default: |
518 | 0 | case QUIC_RSTREAM_STATE_NONE: |
519 | 0 | return 0; |
520 | | |
521 | 0 | case QUIC_RSTREAM_STATE_RECV: |
522 | 0 | case QUIC_RSTREAM_STATE_SIZE_KNOWN: |
523 | 0 | case QUIC_RSTREAM_STATE_DATA_RECVD: |
524 | 0 | if (!ossl_quic_rstream_available(s->rstream, &avail, &fin)) |
525 | 0 | avail = 0; |
526 | |
|
527 | 0 | if (avail == 0 && include_fin && fin) |
528 | 0 | avail = 1; |
529 | |
|
530 | 0 | return avail; |
531 | | |
532 | 0 | case QUIC_RSTREAM_STATE_RESET_RECVD: |
533 | 0 | return include_fin; |
534 | | |
535 | 0 | case QUIC_RSTREAM_STATE_DATA_READ: |
536 | 0 | case QUIC_RSTREAM_STATE_RESET_READ: |
537 | 0 | return 0; |
538 | 0 | } |
539 | 0 | } Unexecuted instantiation: methods.c:ossl_quic_stream_recv_pending Unexecuted instantiation: s3_lib.c:ossl_quic_stream_recv_pending Unexecuted instantiation: s3_msg.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_cert.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_ciph.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_init.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_lib.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_mcnf.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_rsa.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_sess.c:ossl_quic_stream_recv_pending Unexecuted instantiation: t1_lib.c:ossl_quic_stream_recv_pending Unexecuted instantiation: tls13_enc.c:ossl_quic_stream_recv_pending Unexecuted instantiation: tls_depr.c:ossl_quic_stream_recv_pending Unexecuted instantiation: tls_srp.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_impl.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_method.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_stream_map.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_thread_assist.c:ossl_quic_stream_recv_pending Unexecuted instantiation: rec_layer_d1.c:ossl_quic_stream_recv_pending Unexecuted instantiation: rec_layer_s3.c:ossl_quic_stream_recv_pending Unexecuted instantiation: dtls_meth.c:ossl_quic_stream_recv_pending Unexecuted instantiation: tls1_meth.c:ossl_quic_stream_recv_pending Unexecuted instantiation: tls_common.c:ossl_quic_stream_recv_pending Unexecuted instantiation: tls_multib.c:ossl_quic_stream_recv_pending Unexecuted instantiation: tlsany_meth.c:ossl_quic_stream_recv_pending Unexecuted instantiation: extensions.c:ossl_quic_stream_recv_pending Unexecuted instantiation: extensions_clnt.c:ossl_quic_stream_recv_pending Unexecuted instantiation: extensions_cust.c:ossl_quic_stream_recv_pending Unexecuted instantiation: extensions_srvr.c:ossl_quic_stream_recv_pending Unexecuted instantiation: statem.c:ossl_quic_stream_recv_pending Unexecuted instantiation: statem_clnt.c:ossl_quic_stream_recv_pending Unexecuted instantiation: statem_dtls.c:ossl_quic_stream_recv_pending Unexecuted instantiation: statem_lib.c:ossl_quic_stream_recv_pending Unexecuted instantiation: statem_srvr.c:ossl_quic_stream_recv_pending Unexecuted instantiation: d1_lib.c:ossl_quic_stream_recv_pending Unexecuted instantiation: d1_msg.c:ossl_quic_stream_recv_pending Unexecuted instantiation: d1_srtp.c:ossl_quic_stream_recv_pending Unexecuted instantiation: pqueue.c:ossl_quic_stream_recv_pending Unexecuted instantiation: s3_enc.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_asn1.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_conf.c:ossl_quic_stream_recv_pending Unexecuted instantiation: t1_enc.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_channel.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_record_rx.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_record_shared.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_record_tx.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_record_util.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_rx_depack.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_tls.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_txp.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic_wire.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl3_meth.c:ossl_quic_stream_recv_pending Unexecuted instantiation: tls13_meth.c:ossl_quic_stream_recv_pending Unexecuted instantiation: ssl_txt.c:ossl_quic_stream_recv_pending Unexecuted instantiation: quic-client.c:ossl_quic_stream_recv_pending |
540 | | |
541 | | /* |
542 | | * QUIC Stream Map |
543 | | * =============== |
544 | | * |
545 | | * The QUIC stream map: |
546 | | * |
547 | | * - maps stream IDs to QUIC_STREAM objects; |
548 | | * - tracks which streams are 'active' (currently have data for transmission); |
549 | | * - allows iteration over the active streams only. |
550 | | * |
551 | | */ |
552 | | typedef struct quic_stream_map_st { |
553 | | LHASH_OF(QUIC_STREAM) *map; |
554 | | QUIC_STREAM_LIST_NODE active_list; |
555 | | QUIC_STREAM_LIST_NODE accept_list; |
556 | | QUIC_STREAM_LIST_NODE ready_for_gc_list; |
557 | | size_t rr_stepping, rr_counter; |
558 | | size_t num_accept, num_shutdown_flush; |
559 | | QUIC_STREAM *rr_cur; |
560 | | uint64_t (*get_stream_limit_cb)(int uni, void *arg); |
561 | | void *get_stream_limit_cb_arg; |
562 | | QUIC_RXFC *max_streams_bidi_rxfc; |
563 | | QUIC_RXFC *max_streams_uni_rxfc; |
564 | | int is_server; |
565 | | } QUIC_STREAM_MAP; |
566 | | |
567 | | /* |
568 | | * get_stream_limit is a callback which is called to retrieve the current stream |
569 | | * limit for streams created by us. This mechanism is not used for |
570 | | * peer-initiated streams. If a stream's stream ID is x, a stream is allowed if |
571 | | * (x >> 2) < returned limit value; i.e., the returned value is exclusive. |
572 | | * |
573 | | * If uni is 1, get the limit for locally-initiated unidirectional streams, else |
574 | | * get the limit for locally-initiated bidirectional streams. |
575 | | * |
576 | | * If the callback is NULL, stream limiting is not applied. |
577 | | * Stream limiting is used to determine if frames can currently be produced for |
578 | | * a stream. |
579 | | */ |
580 | | int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm, |
581 | | uint64_t (*get_stream_limit_cb)(int uni, void *arg), |
582 | | void *get_stream_limit_cb_arg, |
583 | | QUIC_RXFC *max_streams_bidi_rxfc, |
584 | | QUIC_RXFC *max_streams_uni_rxfc, |
585 | | int is_server); |
586 | | |
587 | | /* |
588 | | * Any streams still in the map will be released as though |
589 | | * ossl_quic_stream_map_release was called on them. |
590 | | */ |
591 | | void ossl_quic_stream_map_cleanup(QUIC_STREAM_MAP *qsm); |
592 | | |
593 | | /* |
594 | | * Allocate a new stream. type is a combination of one QUIC_STREAM_INITIATOR_* |
595 | | * value and one QUIC_STREAM_DIR_* value. Note that clients can e.g. allocate |
596 | | * server-initiated streams as they will need to allocate a QUIC_STREAM |
597 | | * structure to track any stream created by the server, etc. |
598 | | * |
599 | | * stream_id must be a valid value. Returns NULL if a stream already exists |
600 | | * with the given ID. |
601 | | */ |
602 | | QUIC_STREAM *ossl_quic_stream_map_alloc(QUIC_STREAM_MAP *qsm, |
603 | | uint64_t stream_id, |
604 | | int type); |
605 | | |
606 | | /* |
607 | | * Releases a stream object. Note that this must only be done once the teardown |
608 | | * process is entirely complete and the object will never be referenced again. |
609 | | */ |
610 | | void ossl_quic_stream_map_release(QUIC_STREAM_MAP *qsm, QUIC_STREAM *stream); |
611 | | |
612 | | /* |
613 | | * Calls visit_cb() for each stream in the map. visit_cb_arg is an opaque |
614 | | * argument which is passed through. |
615 | | */ |
616 | | void ossl_quic_stream_map_visit(QUIC_STREAM_MAP *qsm, |
617 | | void (*visit_cb)(QUIC_STREAM *stream, void *arg), |
618 | | void *visit_cb_arg); |
619 | | |
620 | | /* |
621 | | * Retrieves a stream by stream ID. Returns NULL if it does not exist. |
622 | | */ |
623 | | QUIC_STREAM *ossl_quic_stream_map_get_by_id(QUIC_STREAM_MAP *qsm, |
624 | | uint64_t stream_id); |
625 | | |
626 | | /* |
627 | | * Marks the given stream as active or inactive based on its state. Idempotent. |
628 | | * |
629 | | * When a stream is marked active, it becomes available in the iteration list, |
630 | | * and when a stream is marked inactive, it no longer appears in the iteration |
631 | | * list. |
632 | | * |
633 | | * Calling this function invalidates any iterator currently pointing at the |
634 | | * given stream object, but iterators not currently pointing at the given stream |
635 | | * object are not invalidated. |
636 | | */ |
637 | | void ossl_quic_stream_map_update_state(QUIC_STREAM_MAP *qsm, QUIC_STREAM *s); |
638 | | |
639 | | /* |
640 | | * Sets the RR stepping value, n. The RR rotation will be advanced every n |
641 | | * packets. The default value is 1. |
642 | | */ |
643 | | void ossl_quic_stream_map_set_rr_stepping(QUIC_STREAM_MAP *qsm, size_t stepping); |
644 | | |
645 | | /* |
646 | | * Returns 1 if the stream ordinal given is allowed by the current stream count |
647 | | * flow control limit, assuming a locally initiated stream of a type described |
648 | | * by is_uni. |
649 | | * |
650 | | * Note that stream_ordinal is a stream ordinal, not a stream ID. |
651 | | */ |
652 | | int ossl_quic_stream_map_is_local_allowed_by_stream_limit(QUIC_STREAM_MAP *qsm, |
653 | | uint64_t stream_ordinal, |
654 | | int is_uni); |
655 | | |
656 | | /* |
657 | | * Stream Send Part |
658 | | * ================ |
659 | | */ |
660 | | |
661 | | /* |
662 | | * Ensures that the sending part has transitioned out of the READY state (i.e., |
663 | | * to SEND, or a subsequent state). This function is named as it is because, |
664 | | * while on paper the distinction between READY and SEND is whether we have |
665 | | * started transmitting application data, in practice the meaningful distinction |
666 | | * between the two states is whether we have allocated a stream ID to the stream |
667 | | * or not. QUIC permits us to defer stream ID allocation until first STREAM (or |
668 | | * STREAM_DATA_BLOCKED) frame transmission for locally-initiated streams. |
669 | | * |
670 | | * Our implementation does not currently do this and we allocate stream IDs up |
671 | | * front, however we may revisit this in the future. Calling this represents a |
672 | | * demand for a stream ID by the caller and ensures one has been allocated to |
673 | | * the stream, and causes us to transition to SEND if we are still in the READY |
674 | | * state. |
675 | | * |
676 | | * Returns 0 if there is no send part (caller error) and 1 otherwise. |
677 | | */ |
678 | | int ossl_quic_stream_map_ensure_send_part_id(QUIC_STREAM_MAP *qsm, |
679 | | QUIC_STREAM *qs); |
680 | | |
681 | | /* |
682 | | * Transitions from SEND to the DATA_SENT state. Note that this is NOT the same |
683 | | * as the point in time at which the final size of the stream becomes known |
684 | | * (i.e., the time at which ossl_quic_sstream_fin()) is called as it occurs when |
685 | | * we have SENT all data on a given stream send part, not merely buffered it. |
686 | | * Note that this transition is NOT reversed in the event of some of that data |
687 | | * being lost. |
688 | | * |
689 | | * Returns 1 if the state transition was successfully taken. Returns 0 if there |
690 | | * is no send part (caller error) or if the state transition cannot be taken |
691 | | * because the send part is not in the SEND state. |
692 | | */ |
693 | | int ossl_quic_stream_map_notify_all_data_sent(QUIC_STREAM_MAP *qsm, |
694 | | QUIC_STREAM *qs); |
695 | | |
696 | | /* |
697 | | * Transitions from the DATA_SENT to DATA_RECVD state; should be called |
698 | | * when all transmitted stream data is ACKed by the peer. |
699 | | * |
700 | | * Returns 1 if the state transition was successfully taken. Returns 0 if there |
701 | | * is no send part (caller error) or the state transition cannot be taken |
702 | | * because the send part is not in the DATA_SENT state. Because |
703 | | * ossl_quic_stream_map_notify_all_data_sent() should always be called prior to |
704 | | * this function, the send state must already be in DATA_SENT in order for this |
705 | | * function to succeed. |
706 | | */ |
707 | | int ossl_quic_stream_map_notify_totally_acked(QUIC_STREAM_MAP *qsm, |
708 | | QUIC_STREAM *qs); |
709 | | |
710 | | /* |
711 | | * Resets the sending part of a stream. This is a transition from the READY, |
712 | | * SEND or DATA_SENT send stream states to the RESET_SENT state. |
713 | | * |
714 | | * This function returns 1 if the transition is taken (i.e., if the send stream |
715 | | * part was in one of the states above), or if it is already in the RESET_SENT |
716 | | * state (idempotent operation), or if it has reached the RESET_RECVD state. |
717 | | * |
718 | | * It returns 0 if in the DATA_RECVD state, as a send stream cannot be reset |
719 | | * in this state. It also returns 0 if there is no send part (caller error). |
720 | | */ |
721 | | int ossl_quic_stream_map_reset_stream_send_part(QUIC_STREAM_MAP *qsm, |
722 | | QUIC_STREAM *qs, |
723 | | uint64_t aec); |
724 | | |
725 | | /* |
726 | | * Transitions from the RESET_SENT to the RESET_RECVD state. This should be |
727 | | * called when a sent RESET_STREAM frame has been acknowledged by the peer. |
728 | | * |
729 | | * This function returns 1 if the transition is taken (i.e., if the send stream |
730 | | * part was in one of the states above) or if it is already in the RESET_RECVD |
731 | | * state (idempotent operation). |
732 | | * |
733 | | * It returns 0 if not in the RESET_SENT or RESET_RECVD states, as this function |
734 | | * should only be called after we have already sent a RESET_STREAM frame and |
735 | | * entered the RESET_SENT state. It also returns 0 if there is no send part |
736 | | * (caller error). |
737 | | */ |
738 | | int ossl_quic_stream_map_notify_reset_stream_acked(QUIC_STREAM_MAP *qsm, |
739 | | QUIC_STREAM *qs); |
740 | | |
741 | | |
742 | | /* |
743 | | * Stream Receive Part |
744 | | * =================== |
745 | | */ |
746 | | |
747 | | /* |
748 | | * Transitions from the RECV receive stream state to the SIZE_KNOWN state. This |
749 | | * should be called once a STREAM frame is received for the stream with the FIN |
750 | | * bit set. final_size should be the final size of the stream in bytes. |
751 | | * |
752 | | * Returns 1 if the transition was taken. |
753 | | */ |
754 | | int ossl_quic_stream_map_notify_size_known_recv_part(QUIC_STREAM_MAP *qsm, |
755 | | QUIC_STREAM *qs, |
756 | | uint64_t final_size); |
757 | | |
758 | | /* |
759 | | * Transitions from the SIZE_KNOWN receive stream state to the DATA_RECVD state. |
760 | | * This should be called once all data for a receive stream is received. |
761 | | * |
762 | | * Returns 1 if the transition was taken. |
763 | | */ |
764 | | int ossl_quic_stream_map_notify_totally_received(QUIC_STREAM_MAP *qsm, |
765 | | QUIC_STREAM *qs); |
766 | | |
767 | | /* |
768 | | * Transitions from the DATA_RECVD receive stream state to the DATA_READ state. |
769 | | * This should be called once all data for a receive stream is read by the |
770 | | * application. |
771 | | * |
772 | | * Returns 1 if the transition was taken. |
773 | | */ |
774 | | int ossl_quic_stream_map_notify_totally_read(QUIC_STREAM_MAP *qsm, |
775 | | QUIC_STREAM *qs); |
776 | | |
777 | | /* |
778 | | * Transitions from the RECV, SIZE_KNOWN or DATA_RECVD receive stream state to |
779 | | * the RESET_RECVD state. This should be called on RESET_STREAM. |
780 | | * |
781 | | * Returns 1 if the transition was taken. |
782 | | */ |
783 | | int ossl_quic_stream_map_notify_reset_recv_part(QUIC_STREAM_MAP *qsm, |
784 | | QUIC_STREAM *qs, |
785 | | uint64_t app_error_code, |
786 | | uint64_t final_size); |
787 | | |
788 | | /* |
789 | | * Transitions from the RESET_RECVD receive stream state to the RESET_READ |
790 | | * receive stream state. This should be called when the application is notified |
791 | | * of a stream reset. |
792 | | */ |
793 | | int ossl_quic_stream_map_notify_app_read_reset_recv_part(QUIC_STREAM_MAP *qsm, |
794 | | QUIC_STREAM *qs); |
795 | | |
796 | | /* |
797 | | * Marks the receiving part of a stream for STOP_SENDING. This is orthogonal to |
798 | | * receive stream state as it does not affect it directly. |
799 | | * |
800 | | * Returns 1 if the receiving part of a stream was not already marked for |
801 | | * STOP_SENDING. |
802 | | * Returns 0 otherwise, which need not be considered an error. |
803 | | */ |
804 | | int ossl_quic_stream_map_stop_sending_recv_part(QUIC_STREAM_MAP *qsm, |
805 | | QUIC_STREAM *qs, |
806 | | uint64_t aec); |
807 | | |
808 | | /* |
809 | | * Marks the stream as wanting a STOP_SENDING frame transmitted. It is not valid |
810 | | * to call this if ossl_quic_stream_map_stop_sending_recv_part() has not been |
811 | | * called. For TXP use. |
812 | | */ |
813 | | int ossl_quic_stream_map_schedule_stop_sending(QUIC_STREAM_MAP *qsm, |
814 | | QUIC_STREAM *qs); |
815 | | |
816 | | |
817 | | /* |
818 | | * Accept Queue Management |
819 | | * ======================= |
820 | | */ |
821 | | |
822 | | /* |
823 | | * Adds a stream to the accept queue. |
824 | | */ |
825 | | void ossl_quic_stream_map_push_accept_queue(QUIC_STREAM_MAP *qsm, |
826 | | QUIC_STREAM *s); |
827 | | |
828 | | /* |
829 | | * Returns the next item to be popped from the accept queue, or NULL if it is |
830 | | * empty. |
831 | | */ |
832 | | QUIC_STREAM *ossl_quic_stream_map_peek_accept_queue(QUIC_STREAM_MAP *qsm); |
833 | | |
834 | | /* |
835 | | * Removes a stream from the accept queue. rtt is the estimated connection RTT. |
836 | | * The stream is retired for the purposes of MAX_STREAMS RXFC. |
837 | | * |
838 | | * Precondition: s is in the accept queue. |
839 | | */ |
840 | | void ossl_quic_stream_map_remove_from_accept_queue(QUIC_STREAM_MAP *qsm, |
841 | | QUIC_STREAM *s, |
842 | | OSSL_TIME rtt); |
843 | | |
844 | | /* Returns the length of the accept queue. */ |
845 | | size_t ossl_quic_stream_map_get_accept_queue_len(QUIC_STREAM_MAP *qsm); |
846 | | |
847 | | /* |
848 | | * Shutdown Flush and GC |
849 | | * ===================== |
850 | | */ |
851 | | |
852 | | /* |
853 | | * Delete streams ready for GC. Pointers to those QUIC_STREAM objects become |
854 | | * invalid. |
855 | | */ |
856 | | void ossl_quic_stream_map_gc(QUIC_STREAM_MAP *qsm); |
857 | | |
858 | | /* |
859 | | * Begins shutdown stream flush triage. Analyses all streams, including deleted |
860 | | * but not yet GC'd streams, to determine if we should wait for that stream to |
861 | | * be fully flushed before shutdown. After calling this, call |
862 | | * ossl_quic_stream_map_is_shutdown_flush_finished() to determine if all |
863 | | * shutdown flush eligible streams have been flushed. |
864 | | */ |
865 | | void ossl_quic_stream_map_begin_shutdown_flush(QUIC_STREAM_MAP *qsm); |
866 | | |
867 | | /* |
868 | | * Returns 1 if all shutdown flush eligible streams have finished flushing, |
869 | | * or if ossl_quic_stream_map_begin_shutdown_flush() has not been called. |
870 | | */ |
871 | | int ossl_quic_stream_map_is_shutdown_flush_finished(QUIC_STREAM_MAP *qsm); |
872 | | |
873 | | /* |
874 | | * QUIC Stream Iterator |
875 | | * ==================== |
876 | | * |
877 | | * Allows the current set of active streams to be walked using a RR-based |
878 | | * algorithm. Each time ossl_quic_stream_iter_init is called, the RR algorithm |
879 | | * is stepped. The RR algorithm rotates the iteration order such that the next |
880 | | * active stream is returned first after n calls to ossl_quic_stream_iter_init, |
881 | | * where n is the stepping value configured via |
882 | | * ossl_quic_stream_map_set_rr_stepping. |
883 | | * |
884 | | * Suppose there are three active streams and the configured stepping is n: |
885 | | * |
886 | | * Iteration 0n: [Stream 1] [Stream 2] [Stream 3] |
887 | | * Iteration 1n: [Stream 2] [Stream 3] [Stream 1] |
888 | | * Iteration 2n: [Stream 3] [Stream 1] [Stream 2] |
889 | | * |
890 | | */ |
891 | | typedef struct quic_stream_iter_st { |
892 | | QUIC_STREAM_MAP *qsm; |
893 | | QUIC_STREAM *first_stream, *stream; |
894 | | } QUIC_STREAM_ITER; |
895 | | |
896 | | /* |
897 | | * Initialise an iterator, advancing the RR algorithm as necessary (if |
898 | | * advance_rr is 1). After calling this, it->stream will be the first stream in |
899 | | * the iteration sequence, or NULL if there are no active streams. |
900 | | */ |
901 | | void ossl_quic_stream_iter_init(QUIC_STREAM_ITER *it, QUIC_STREAM_MAP *qsm, |
902 | | int advance_rr); |
903 | | |
904 | | /* |
905 | | * Advances to next stream in iteration sequence. You do not need to call this |
906 | | * immediately after calling ossl_quic_stream_iter_init(). If the end of the |
907 | | * list is reached, it->stream will be NULL after calling this. |
908 | | */ |
909 | | void ossl_quic_stream_iter_next(QUIC_STREAM_ITER *it); |
910 | | |
911 | | # endif |
912 | | |
913 | | #endif |