summaryrefslogtreecommitdiffstats
path: root/include/internal
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-07-26 18:10:16 +0100
committerHugo Landau <hlandau@openssl.org>2023-08-10 18:19:45 +0100
commit40c8c756c86fc17751b989426aa66fb33319c4ca (patch)
tree77eae277108a725e7ea4d2b7c52cd4fb05f49d05 /include/internal
parentd56b81ac9f02dd55ecf3281d16fdb156897b4d8d (diff)
QUIC APL/CHANNEL: Wire up connection closure reason
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21565)
Diffstat (limited to 'include/internal')
-rw-r--r--include/internal/quic_channel.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/internal/quic_channel.h b/include/internal/quic_channel.h
index e36acb4eeb..2524a65fe7 100644
--- a/include/internal/quic_channel.h
+++ b/include/internal/quic_channel.h
@@ -149,6 +149,21 @@ typedef struct quic_terminate_cause_st {
*/
uint64_t frame_type;
+ /*
+ * Optional reason string. When calling ossl_quic_channel_local_close, if a
+ * reason string pointer is passed, it is copied and stored inside
+ * QUIC_CHANNEL for the remainder of the lifetime of the channel object.
+ * Thus the string pointed to by this value, if non-NULL, is valid for the
+ * lifetime of the QUIC_CHANNEL object.
+ */
+ const char *reason;
+
+ /*
+ * Length of reason in bytes. The reason is supposed to contain a UTF-8
+ * string but may be arbitrary data if the reason came from the network.
+ */
+ size_t reason_len;
+
/* Is this error code in the transport (0) or application (1) space? */
unsigned int app : 1;
@@ -196,7 +211,8 @@ int ossl_quic_channel_set_mutator(QUIC_CHANNEL *ch,
int ossl_quic_channel_start(QUIC_CHANNEL *ch);
/* Start a locally initiated connection shutdown. */
-void ossl_quic_channel_local_close(QUIC_CHANNEL *ch, uint64_t app_error_code);
+void ossl_quic_channel_local_close(QUIC_CHANNEL *ch, uint64_t app_error_code,
+ const char *app_reason);
/*
* Called when the handshake is confirmed.