diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-04-18 19:30:56 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-05-12 14:47:13 +0100 |
commit | f0e22d1be8a66106932f6f7c069087372ff33789 (patch) | |
tree | 6d9961d49e6c8909f1f5796b1f5d50c29b4ca193 /ssl | |
parent | 228940168529ba7c10b86934849b19818f79f74e (diff) |
QUIC TSERVER: Allow STOP_SENDING/RESET_STREAM to be queried
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20765)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_tserver.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c index 46d39c9d90..cd24d5c59e 100644 --- a/ssl/quic/quic_tserver.c +++ b/ssl/quic/quic_tserver.c @@ -363,3 +363,37 @@ BIO *ossl_quic_tserver_get0_rbio(QUIC_TSERVER *srv) { return srv->args.net_rbio; } + +int ossl_quic_tserver_stream_has_peer_stop_sending(QUIC_TSERVER *srv, + uint64_t stream_id, + uint64_t *app_error_code) +{ + QUIC_STREAM *qs; + + qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch), + stream_id); + if (qs == NULL) + return 0; + + if (qs->peer_stop_sending && app_error_code != NULL) + *app_error_code = qs->peer_stop_sending_aec; + + return qs->peer_stop_sending; +} + +int ossl_quic_tserver_stream_has_peer_reset_stream(QUIC_TSERVER *srv, + uint64_t stream_id, + uint64_t *app_error_code) +{ + QUIC_STREAM *qs; + + qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch), + stream_id); + if (qs == NULL) + return 0; + + if (qs->peer_reset_stream && app_error_code != NULL) + *app_error_code = qs->peer_reset_stream_aec; + + return qs->peer_reset_stream; +} |