diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-08-22 16:59:57 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-08-25 15:10:43 +0200 |
commit | 9d6bd3d30f8068a5558efa0bda2db570500ff364 (patch) | |
tree | ae0a2678ddc64bafac019e3c48e42a34deb636bf /include | |
parent | 10536b7f5b07aab3dc9631e94a56258155a1d942 (diff) |
QUIC APL: Implement backpressure on stream creation
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21811)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/quic_channel.h | 6 | ||||
-rw-r--r-- | include/internal/quic_stream_map.h | 11 | ||||
-rw-r--r-- | include/openssl/ssl.h.in | 4 | ||||
-rw-r--r-- | include/openssl/sslerr.h | 1 |
4 files changed, 21 insertions, 1 deletions
diff --git a/include/internal/quic_channel.h b/include/internal/quic_channel.h index 2524a65fe7..44009d1c20 100644 --- a/include/internal/quic_channel.h +++ b/include/internal/quic_channel.h @@ -411,6 +411,12 @@ uint16_t ossl_quic_channel_get_diag_num_rx_ack(QUIC_CHANNEL *ch); */ void ossl_quic_channel_get_diag_local_cid(QUIC_CHANNEL *ch, QUIC_CONN_ID *cid); +/* + * Returns 1 if stream count flow control allows us to create a new + * locally-initiated stream. + */ +int ossl_quic_channel_is_new_local_stream_admissible(QUIC_CHANNEL *ch, int is_uni); + # endif #endif diff --git a/include/internal/quic_stream_map.h b/include/internal/quic_stream_map.h index 10b3cfa32c..cc071dba4c 100644 --- a/include/internal/quic_stream_map.h +++ b/include/internal/quic_stream_map.h @@ -608,6 +608,17 @@ void ossl_quic_stream_map_update_state(QUIC_STREAM_MAP *qsm, QUIC_STREAM *s); void ossl_quic_stream_map_set_rr_stepping(QUIC_STREAM_MAP *qsm, size_t stepping); /* + * Returns 1 if the stream ordinal given is allowed by the current stream count + * flow control limit, assuming a locally initiated stream of a type described + * by is_uni. + * + * Note that stream_ordinal is a stream ordinal, not a stream ID. + */ +int ossl_quic_stream_map_is_local_allowed_by_stream_limit(QUIC_STREAM_MAP *qsm, + uint64_t stream_ordinal, + int is_uni); + +/* * Stream Send Part * ================ */ diff --git a/include/openssl/ssl.h.in b/include/openssl/ssl.h.in index 1738d97021..9448974403 100644 --- a/include/openssl/ssl.h.in +++ b/include/openssl/ssl.h.in @@ -2284,7 +2284,9 @@ __owur uint64_t SSL_get_stream_id(SSL *s); #define SSL_DEFAULT_STREAM_MODE_AUTO_UNI 2 __owur int SSL_set_default_stream_mode(SSL *s, uint32_t mode); -#define SSL_STREAM_FLAG_UNI (1U << 0) +#define SSL_STREAM_FLAG_UNI (1U << 0) +#define SSL_STREAM_FLAG_NO_BLOCK (1U << 1) +#define SSL_STREAM_FLAG_ADVANCE (1U << 2) __owur SSL *SSL_new_stream(SSL *s, uint64_t flags); #define SSL_INCOMING_STREAM_POLICY_AUTO 0 diff --git a/include/openssl/sslerr.h b/include/openssl/sslerr.h index adaa91d7ff..0a4079b5c8 100644 --- a/include/openssl/sslerr.h +++ b/include/openssl/sslerr.h @@ -290,6 +290,7 @@ # define SSL_R_SSL_SESSION_ID_TOO_LONG 408 # define SSL_R_SSL_SESSION_VERSION_MISMATCH 210 # define SSL_R_STILL_IN_INIT 121 +# define SSL_R_STREAM_COUNT_LIMITED 395 # define SSL_R_STREAM_FINISHED 365 # define SSL_R_STREAM_RECV_ONLY 366 # define SSL_R_STREAM_RESET 375 |