lsquic_stream.h revision 04f8f447
1/* Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc. See LICENSE. */ 2#ifndef LSQUIC_STREAM_H 3#define LSQUIC_STREAM_H 4 5#define LSQUIC_STREAM_DEFAULT_PRIO 16 /* RFC 7540, Section 5.3.5 */ 6 7 8struct lsquic_stream_if; 9struct lsquic_stream_ctx; 10struct lsquic_conn_public; 11struct stream_frame; 12struct uncompressed_headers; 13enum enc_level; 14enum swtp_status; 15struct frame_gen_ctx; 16struct data_frame; 17enum quic_frame_type; 18struct push_promise; 19union hblock_ctx; 20struct lsquic_packet_out; 21struct lsquic_send_ctl; 22struct network_path; 23 24TAILQ_HEAD(lsquic_streams_tailq, lsquic_stream); 25 26 27#ifndef LSQUIC_KEEP_STREAM_HISTORY 28# define LSQUIC_KEEP_STREAM_HISTORY 1 29#endif 30 31 32#if LSQUIC_KEEP_STREAM_HISTORY 33#define SM_HIST_BITS 6 34#define SM_HIST_IDX_MASK ((1 << SM_HIST_BITS) - 1) 35typedef unsigned char sm_hist_idx_t; 36#endif 37 38 39/* 40 * +----------+----------------------------------+ 41 * | Low Bits | Stream Type | 42 * +----------+----------------------------------+ 43 * | 0x0 | Client-Initiated, Bidirectional | 44 * | | | 45 * | 0x1 | Server-Initiated, Bidirectional | 46 * | | | 47 * | 0x2 | Client-Initiated, Unidirectional | 48 * | | | 49 * | 0x3 | Server-Initiated, Unidirectional | 50 * +----------+----------------------------------+ 51 */ 52 53enum stream_id_type 54{ 55 SIT_BIDI_CLIENT, 56 SIT_BIDI_SERVER, 57 SIT_UNI_CLIENT, 58 SIT_UNI_SERVER, 59 N_SITS 60}; 61 62#define SIT_MASK (N_SITS - 1) 63 64#define SIT_SHIFT 2 65#define SD_SHIFT 1 66 67enum stream_dir { SD_BIDI, SD_UNI, N_SDS }; 68 69 70struct stream_hq_frame 71{ 72 STAILQ_ENTRY(stream_hq_frame) 73 shf_next; 74 /* At which point in the stream (sm_payload) to insert the HQ frame. */ 75 uint64_t shf_off; 76 union { 77 /* Points to the frame if SHF_FIXED_SIZE is not set */ 78 unsigned char *frame_ptr; 79 /* If SHF_FIXED_SIZE is set, the size of the frame to follow. 80 * Non-fixed frame size gets calculated using sm_payload when they 81 * are closed. 82 */ 83 size_t frame_size; 84 } shf_u; 85#define shf_frame_ptr shf_u.frame_ptr 86#define shf_frame_size shf_u.frame_size 87 enum hq_frame_type shf_frame_type; 88 enum shf_flags { 89 SHF_TWO_BYTES = 1 << 0, /* Use two byte to encode frame length */ 90 SHF_FIXED_SIZE = 1 << 1, /* Payload size guaranteed */ 91 SHF_ACTIVE = 1 << 2, /* On sm_hq_frames list */ 92 SHF_WRITTEN = 1 << 3, /* Framing bytes have been packetized */ 93 SHF_CC_PAID = 1 << 4, /* Paid connection cap */ 94 SHF_PHANTOM = 1 << 5, /* Phantom frame headers are not written */ 95 } shf_flags:8; 96}; 97 98 99struct hq_filter 100{ 101 struct varint_read2_state hqfi_vint2_state; 102 /* No need to copy the values: use it directly */ 103#define hqfi_left hqfi_vint2_state.vr2s_two 104#define hqfi_type hqfi_vint2_state.vr2s_one 105 struct varint_read_state hqfi_vint1_state; 106#define hqfi_push_id hqfi_vint1_state.value 107 enum { 108 HQFI_FLAG_UNUSED_0 = 1 << 0, 109 HQFI_FLAG_ERROR = 1 << 1, 110 HQFI_FLAG_BEGIN = 1 << 2, 111 HQFI_FLAG_BLOCKED = 1 << 3, 112 } hqfi_flags:8; 113 enum { 114 HQFI_STATE_FRAME_HEADER_BEGIN, 115 HQFI_STATE_FRAME_HEADER_CONTINUE, 116 HQFI_STATE_READING_PAYLOAD, 117 HQFI_STATE_PUSH_ID_BEGIN, 118 HQFI_STATE_PUSH_ID_CONTINUE, 119 } hqfi_state:8; 120 unsigned char hqfi_hist_idx; 121#define MAX_HQFI_ENTRIES (sizeof(unsigned) * 8 / 3) 122 unsigned hqfi_hist_buf; 123}; 124 125 126struct stream_filter_if 127{ 128 int (*sfi_readable)(struct lsquic_stream *); 129 size_t (*sfi_filter_df)(struct lsquic_stream *, struct data_frame *); 130 void (*sfi_decr_left)(struct lsquic_stream *, size_t); 131}; 132 133 134/* These flags indicate which queues -- or other entities -- currently 135 * reference the stream. 136 */ 137enum stream_q_flags 138{ 139 /* read_streams: */ 140 SMQF_WANT_READ = 1 << 0, 141 142 /* write_streams: */ 143#define SMQF_WRITE_Q_FLAGS (SMQF_WANT_FLUSH|SMQF_WANT_WRITE) 144 SMQF_WANT_WRITE = 1 << 1, 145 SMQF_WANT_FLUSH = 1 << 2, /* Flush until sm_flush_to is hit */ 146 147 /* There are more than one reason that a stream may be put onto 148 * connections's sending_streams queue. Note that writing STREAM 149 * frames is done separately. 150 */ 151#define SMQF_SENDING_FLAGS (SMQF_SEND_WUF|SMQF_SEND_RST|SMQF_SEND_BLOCKED\ 152 |SMQF_SEND_STOP_SENDING) 153 /* sending_streams: */ 154 SMQF_SEND_WUF = 1 << 3, /* WUF: Window Update Frame */ 155 SMQF_SEND_BLOCKED = 1 << 4, 156 SMQF_SEND_RST = 1 << 5, /* Error: want to send RST_STREAM */ 157 SMQF_SEND_STOP_SENDING = 1 << 10, 158 159 /* The equivalent of WINDOW_UPDATE frame for streams in IETF QUIC is 160 * the MAX_STREAM_DATA frame. Define an alias for use in the IETF 161 * QUIC code: 162 */ 163#define SMQF_SEND_MAX_STREAM_DATA SMQF_SEND_WUF 164 165#define SMQF_SERVICE_FLAGS (SMQF_CALL_ONCLOSE|SMQF_FREE_STREAM|SMQF_ABORT_CONN) 166 SMQF_CALL_ONCLOSE = 1 << 6, 167 SMQF_FREE_STREAM = 1 << 7, 168 SMQF_ABORT_CONN = 1 << 8, /* Unrecoverable error occurred */ 169 170 SMQF_QPACK_DEC = 1 << 9, /* QPACK decoder handler is holding a reference to this stream */ 171 172 /* The stream can reference itself, preventing its own destruction: */ 173#define SMQF_SELF_FLAGS SMQF_WAIT_FIN_OFF 174 SMQF_WAIT_FIN_OFF = 1 << 11, /* Waiting for final offset: FIN or RST */ 175}; 176 177 178/* Stream behavior flags */ 179enum stream_b_flags 180{ 181 SMBF_SERVER = 1 << 0, 182 SMBF_IETF = 1 << 1, 183 SMBF_USE_HEADERS = 1 << 2, 184 SMBF_CRYPTO = 1 << 3, /* Crypto stream: applies to both gQUIC and IETF QUIC */ 185 SMBF_CRITICAL = 1 << 4, /* This is a critical stream */ 186 SMBF_AUTOSWITCH = 1 << 5, 187 SMBF_RW_ONCE = 1 << 6, /* When set, read/write events are dispatched once per call */ 188 SMBF_CONN_LIMITED = 1 << 7, 189 SMBF_HEADERS = 1 << 8, /* Headers stream */ 190 SMBF_VERIFY_CL = 1 << 9, /* Verify content-length (stored in sm_cont_len) */ 191 SMBF_HTTP_PRIO = 1 <<10, /* Extensible HTTP Priorities are used */ 192 SMBF_INCREMENTAL = 1 <<11, /* Value of the "incremental" HTTP Priority parameter */ 193 SMBF_HPRIO_SET = 1 <<12, /* Extensible HTTP Priorities have been set once */ 194#define N_SMBF_FLAGS 13 195}; 196 197 198enum stream_flags { 199 STREAM_FIN_RECVD = 1 << 0, /* Received STREAM frame with FIN bit set */ 200 STREAM_RST_RECVD = 1 << 1, /* Received RST frame */ 201 STREAM_LAST_WRITE_OK= 1 << 2, /* Used to break out of write event dispatch loop */ 202 STREAM_U_READ_DONE = 1 << 3, /* User is done reading (shutdown was called) */ 203 STREAM_U_WRITE_DONE = 1 << 4, /* User is done writing (shutdown was called) */ 204 STREAM_FIN_SENT = 1 << 5, /* FIN was written to network */ 205 STREAM_RST_SENT = 1 << 6, /* RST_STREAM was written to network */ 206 STREAM_FIN_REACHED = 1 << 7, /* User read data up to FIN */ 207 STREAM_FINISHED = 1 << 8, /* Stream is finished */ 208 STREAM_ONCLOSE_DONE = 1 << 9, /* on_close has been called */ 209 STREAM_CACHED_FRAME = 1 << 10, /* If set, sm_has_frame can be used */ 210 STREAM_HEADERS_SENT = 1 << 11, 211 STREAM_HAVE_UH = 1 << 12, /* Have uncompressed headers */ 212 STREAM_ENCODER_DEP = 1 << 13, /* Encoder dependency: flush (IETF only) */ 213 STREAM_HEAD_IN_FIN = 1 << 14, /* Incoming headers has FIN bit set */ 214 STREAM_FRAMES_ELIDED= 1 << 15, 215 STREAM_FORCE_FINISH = 1 << 16, /* Replaces FIN sent and received */ 216 STREAM_ONNEW_DONE = 1 << 17, /* on_new_stream has been called */ 217 STREAM_PUSHING = 1 << 18, 218 STREAM_NOPUSH = 1 << 19, /* Disallow further push promises */ 219 STREAM_GOAWAY_IN = 1 << 20, /* Incoming GOAWAY has been processed */ 220 STREAM_SS_SENT = 1 << 21, /* STOP_SENDING sent */ 221 STREAM_RST_ACKED = 1 << 22, /* Packet containing RST has been acked */ 222 STREAM_BLOCKED_SENT = 1 << 23, /* Stays set once a STREAM_BLOCKED frame is sent */ 223 STREAM_RST_READ = 1 << 24, /* User code collected the error */ 224 STREAM_DATA_RECVD = 1 << 25, /* Cache stream state calculation */ 225 STREAM_UNUSED26 = 1 << 26, /* Unused */ 226 STREAM_HDRS_FLUSHED = 1 << 27, /* Only used in buffered packets mode */ 227 STREAM_SS_RECVD = 1 << 28, /* Received STOP_SENDING frame */ 228 STREAM_DELAYED_SW = 1 << 29, /* Delayed shutdown_write call */ 229}; 230 231 232/* By keeping this number low, we make sure that the code to allocate HQ 233 * frames dynamically gets exercised whenever push promises are sent. 234 */ 235#define NUM_ALLOCED_HQ_FRAMES 2 236 237 238struct lsquic_stream 239{ 240 struct lsquic_hash_elem sm_hash_el; 241 lsquic_stream_id_t id; 242 enum stream_flags stream_flags; 243 enum stream_b_flags sm_bflags; 244 enum stream_q_flags sm_qflags; 245 unsigned n_unacked; 246 247 const struct lsquic_stream_if *stream_if; 248 struct lsquic_stream_ctx *st_ctx; 249 struct lsquic_conn_public *conn_pub; 250 TAILQ_ENTRY(lsquic_stream) next_send_stream, next_read_stream, 251 next_write_stream, next_service_stream, 252 next_prio_stream; 253 254 uint64_t tosend_off; 255 uint64_t sm_payload; /* Not counting HQ frames */ 256 uint64_t max_send_off; 257 uint64_t sm_last_recv_off; 258 uint64_t error_code; 259 260 /* From the network, we get frames, which we keep on a list ordered 261 * by offset. 262 */ 263 struct data_in *data_in; 264 uint64_t read_offset; 265 lsquic_sfcw_t fc; 266 267 /* List of active HQ frames */ 268 STAILQ_HEAD(, stream_hq_frame) sm_hq_frames; 269 270 /* For efficiency, several frames are allocated as part of the stream 271 * itself. If more frames are needed, they are allocated. 272 */ 273 struct stream_hq_frame sm_hq_frame_arr[NUM_ALLOCED_HQ_FRAMES]; 274 275 struct hq_filter sm_hq_filter; 276 277 /* Optional tap for pwritev undo */ 278 struct hq_arr *sm_hq_arr; 279 280 /* We can safely use sm_hq_filter */ 281#define sm_uni_type_state sm_hq_filter.hqfi_vint2_state.vr2s_varint_state 282 283 /** If @ref SMQF_WANT_FLUSH is set, flush until this offset. */ 284 uint64_t sm_flush_to; 285 286 /** 287 * If @ref SMQF_WANT_FLUSH is set, this indicates payload offset 288 * to flush to. Used to adjust @ref sm_flush_to when H3 frame 289 * size grows. 290 */ 291 uint64_t sm_flush_to_payload; 292 293 /* Last offset sent in BLOCKED frame */ 294 uint64_t blocked_off; 295 296 struct uncompressed_headers *uh, 297 *push_req; 298 union hblock_ctx *sm_hblock_ctx; 299 300 unsigned char *sm_buf; 301 void *sm_onnew_arg; 302 303 unsigned char *sm_header_block; 304 uint64_t sm_hb_compl; 305 306 /* Valid if STREAM_FIN_RECVD is set: */ 307 uint64_t sm_fin_off; 308 309 /* A stream may be generating STREAM or CRYPTO frames */ 310 size_t (*sm_frame_header_sz)( 311 const struct lsquic_stream *, unsigned); 312 enum swtp_status (*sm_write_to_packet)(struct frame_gen_ctx *, 313 const size_t); 314 size_t (*sm_write_avail)(struct lsquic_stream *); 315 int (*sm_readable)(struct lsquic_stream *); 316 317 struct lsquic_packet_out * (*sm_get_packet_for_stream)( 318 struct lsquic_send_ctl *, 319 unsigned, const struct network_path *, 320 const struct lsquic_stream *); 321 322 /* This element is optional */ 323 const struct stream_filter_if *sm_sfi; 324 325 /* sm_promise and sm_promises are never used at the same time and can 326 * be combined into a union should space in this struct become tight. 327 */ 328 /* Push promise that engendered this push stream */ 329 struct push_promise *sm_promise; 330 331 /* Push promises sent on this stream */ 332 SLIST_HEAD(, push_promise) sm_promises; 333 334 uint64_t sm_last_frame_off; 335 336#ifndef NDEBUG 337 /* Last time stream made progress */ 338 lsquic_time_t sm_last_prog; 339#endif 340 341 /* Content length specified in incoming `content-length' header field. 342 * Used to verify size of DATA frames. 343 */ 344 unsigned long long sm_cont_len; 345 /* Sum of bytes in all incoming DATA frames. Used for verification. */ 346 unsigned long long sm_data_in; 347 348 /* How much data there is in sm_header_block and how much of it has been 349 * sent: 350 */ 351 unsigned sm_hblock_sz, 352 sm_hblock_off; 353 354 unsigned short sm_n_buffered; /* Amount of data in sm_buf */ 355 unsigned short sm_n_allocated; /* Size of sm_buf */ 356 357 /* If SMBF_HTTP_PRIO is set, the priority is used to represent the 358 * Extensible Priority urgency, which is in the range [0, 7]. 359 */ 360 unsigned char sm_priority; /* 0: high; 255: low */ 361 unsigned char sm_enc_level; 362 enum { 363 SSHS_BEGIN, /* Nothing has happened yet */ 364 SSHS_ENC_SENDING, /* Sending encoder stream data */ 365 SSHS_HBLOCK_SENDING,/* Sending header block data */ 366 } sm_send_headers_state:8; 367 signed char sm_saved_want_write; 368 signed char sm_has_frame; 369 370#if LSQUIC_KEEP_STREAM_HISTORY 371 sm_hist_idx_t sm_hist_idx; 372#endif 373 374#if LSQUIC_KEEP_STREAM_HISTORY 375 /* Stream history: see enum stream_history_event */ 376 unsigned char sm_hist_buf[ 1 << SM_HIST_BITS ]; 377#endif 378}; 379 380 381enum stream_ctor_flags 382{ 383 SCF_CALL_ON_NEW = (1 << (N_SMBF_FLAGS + 0)), /* Call on_new_stream() immediately */ 384 SCF_USE_DI_HASH = (1 << (N_SMBF_FLAGS + 1)), /* Use hash-based data input. If not set, 385 * the nocopy data input is used. 386 */ 387 SCF_CRYPTO_FRAMES = (1 << (N_SMBF_FLAGS + 2)), /* Write CRYPTO frames */ 388 SCF_DI_AUTOSWITCH = SMBF_AUTOSWITCH, /* Automatically switch between nocopy 389 * and hash-based to data input for optimal 390 * performance. 391 */ 392 SCF_DISP_RW_ONCE = SMBF_RW_ONCE, 393 SCF_CRITICAL = SMBF_CRITICAL, /* This is a critical stream */ 394 SCF_IETF = SMBF_IETF, 395 SCF_HTTP = SMBF_USE_HEADERS, 396 SCF_CRYPTO = SMBF_CRYPTO, 397 SCF_HEADERS = SMBF_HEADERS, 398 SCF_HTTP_PRIO = SMBF_HTTP_PRIO, 399}; 400 401 402lsquic_stream_t * 403lsquic_stream_new (lsquic_stream_id_t id, struct lsquic_conn_public *, 404 const struct lsquic_stream_if *, void *stream_if_ctx, 405 unsigned initial_sfrw, uint64_t initial_send_off, 406 enum stream_ctor_flags); 407 408struct lsquic_stream * 409lsquic_stream_new_crypto (enum enc_level, 410 struct lsquic_conn_public *conn_pub, 411 const struct lsquic_stream_if *stream_if, void *stream_if_ctx, 412 enum stream_ctor_flags ctor_flags); 413 414void 415lsquic_stream_call_on_new (lsquic_stream_t *); 416 417void 418lsquic_stream_destroy (lsquic_stream_t *); 419 420/* Any of these flags will cause user-facing read and write and 421 * shutdown calls to return an error. They also make the stream 422 * both readable and writeable, as we want the user to collect 423 * the error. 424 */ 425#define lsquic_stream_is_reset(stream) \ 426 (((stream)->stream_flags & \ 427 (STREAM_RST_RECVD|STREAM_RST_SENT|STREAM_SS_RECVD)) \ 428 || ((stream)->sm_qflags & SMQF_SEND_RST)) 429 430/* Data that from the network gets inserted into the stream using 431 * lsquic_stream_frame_in() function. Returns 0 on success, -1 on 432 * failure. The latter may be caused by flow control violation or 433 * invalid stream frame data, e.g. overlapping segments. 434 * 435 * Note that the caller gives up control of `frame' no matter 436 * what this function returns. 437 * 438 * This data is read by the user using lsquic_stream_read() function. 439 */ 440int 441lsquic_stream_frame_in (lsquic_stream_t *, struct stream_frame *frame); 442 443/* Only one (at least for now) uncompressed header structure is allowed to be 444 * passed in, and only in HTTP mode. 445 */ 446int 447lsquic_stream_uh_in (lsquic_stream_t *, struct uncompressed_headers *); 448 449void 450lsquic_stream_push_req (lsquic_stream_t *, 451 struct uncompressed_headers *push_req); 452 453int 454lsquic_stream_rst_in (lsquic_stream_t *, uint64_t offset, uint64_t error_code); 455 456void 457lsquic_stream_stop_sending_in (struct lsquic_stream *, uint64_t error_code); 458 459uint64_t 460lsquic_stream_read_offset (const lsquic_stream_t *stream); 461 462/* Return true if we sent all available data to the network and write 463 * end of the stream was closed. 464 */ 465int 466lsquic_stream_tosend_fin (const lsquic_stream_t *stream); 467 468void 469lsquic_stream_window_update (lsquic_stream_t *stream, uint64_t offset); 470 471int 472lsquic_stream_set_max_send_off (lsquic_stream_t *stream, uint64_t offset); 473 474/* The caller should only call this function if SMQF_SEND_WUF is set and 475 * it must generate a window update frame using this value. 476 */ 477uint64_t 478lsquic_stream_fc_recv_off (lsquic_stream_t *stream); 479 480void 481lsquic_stream_peer_blocked (struct lsquic_stream *, uint64_t); 482 483void 484lsquic_stream_peer_blocked_gquic (struct lsquic_stream *); 485 486void 487lsquic_stream_dispatch_read_events (lsquic_stream_t *); 488 489void 490lsquic_stream_dispatch_write_events (lsquic_stream_t *); 491 492void 493lsquic_stream_blocked_frame_sent (lsquic_stream_t *); 494 495void 496lsquic_stream_rst_frame_sent (lsquic_stream_t *); 497 498void 499lsquic_stream_stream_frame_sent (lsquic_stream_t *); 500 501void 502lsquic_stream_reset (lsquic_stream_t *, uint64_t error_code); 503 504void 505lsquic_stream_reset_ext (lsquic_stream_t *, uint64_t error_code, int close); 506 507void 508lsquic_stream_call_on_close (lsquic_stream_t *); 509 510void 511lsquic_stream_shutdown_internal (lsquic_stream_t *); 512 513void 514lsquic_stream_received_goaway (lsquic_stream_t *); 515 516void 517lsquic_stream_acked (struct lsquic_stream *, enum quic_frame_type); 518 519#define lsquic_stream_is_closed(s) \ 520 (((s)->stream_flags & (STREAM_U_READ_DONE|STREAM_U_WRITE_DONE)) \ 521 == (STREAM_U_READ_DONE|STREAM_U_WRITE_DONE)) 522int 523lsquic_stream_update_sfcw (lsquic_stream_t *, uint64_t max_off); 524 525int 526lsquic_stream_set_priority_internal (lsquic_stream_t *, unsigned priority); 527 528#define lsquic_stream_is_critical(s) ((s)->sm_bflags & SMBF_CRITICAL) 529 530#define lsquic_stream_is_crypto(s) ((s)->sm_bflags & SMBF_CRYPTO) 531 532size_t 533lsquic_stream_mem_used (const struct lsquic_stream *); 534 535const lsquic_cid_t * 536lsquic_stream_cid (const struct lsquic_stream *); 537 538#define lsquic_stream_has_data_to_flush(stream) ((stream)->sm_n_buffered > 0) 539 540int 541lsquic_stream_readable (struct lsquic_stream *); 542 543size_t 544lsquic_stream_write_avail (struct lsquic_stream *); 545 546void 547lsquic_stream_dump_state (const struct lsquic_stream *); 548 549#ifndef NDEBUG 550size_t 551lsquic_stream_flush_threshold (const struct lsquic_stream *, unsigned); 552#endif 553 554#define crypto_level(stream) (UINT64_MAX - (stream)->id) 555 556void 557lsquic_stream_set_stream_if (struct lsquic_stream *, 558 const struct lsquic_stream_if *, void *stream_if_ctx); 559 560uint64_t 561lsquic_stream_combined_send_off (const struct lsquic_stream *); 562 563/* [draft-ietf-quic-transport-16] Section 3.1 */ 564enum stream_state_sending 565{ 566 SSS_READY, 567 SSS_SEND, 568 SSS_DATA_SENT, 569 SSS_RESET_SENT, 570 SSS_DATA_RECVD, 571 SSS_RESET_RECVD, 572}; 573 574extern const char *const lsquic_sss2str[]; 575 576enum stream_state_sending 577lsquic_stream_sending_state (const struct lsquic_stream *); 578 579/* [draft-ietf-quic-transport-16] Section 3.2 */ 580enum stream_state_receiving 581{ 582 SSR_RECV, 583 SSR_SIZE_KNOWN, 584 SSR_DATA_RECVD, 585 SSR_RESET_RECVD, 586 SSR_DATA_READ, 587 SSR_RESET_READ, 588}; 589 590extern const char *const lsquic_ssr2str[]; 591 592enum stream_state_receiving 593lsquic_stream_receiving_state (struct lsquic_stream *); 594 595uint64_t 596lsquic_stream_fc_recv_off_const (const struct lsquic_stream *); 597 598void 599lsquic_stream_max_stream_data_sent (struct lsquic_stream *); 600 601void 602lsquic_stream_qdec_unblocked (struct lsquic_stream *); 603 604int 605lsquic_stream_can_push (const struct lsquic_stream *); 606 607int 608lsquic_stream_push_promise (struct lsquic_stream *, struct push_promise *); 609 610void 611lsquic_stream_force_finish (struct lsquic_stream *); 612 613int 614lsquic_stream_header_is_pp (const struct lsquic_stream *); 615 616int 617lsquic_stream_header_is_trailer (const struct lsquic_stream *); 618 619int 620lsquic_stream_verify_len (struct lsquic_stream *, unsigned long long); 621 622#define lsquic_stream_is_blocked(stream_) ((stream_)->blocked_off && \ 623 (stream_)->blocked_off == (stream_)->max_send_off) 624 625void 626lsquic_stream_ss_frame_sent (struct lsquic_stream *); 627 628#ifndef NDEBUG 629void 630lsquic_stream_set_pwritev_params (unsigned iovecs, unsigned frames); 631#endif 632 633void 634lsquic_stream_drop_hset_ref (struct lsquic_stream *); 635 636#endif 637