From 80d93c66e9b4274c42ba9396bf8fc9fb91987d54 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Wed, 29 May 2024 12:16:56 -0400 Subject: [PATCH] connection: more docs for rustls_connection_is_handshaking Previously the rustls-ffi `rustls_connection_is_handshaking` fn only pointed at the upstream Rustls documentation. This commit adds a bit of the detail present there, customizing it for rustls-ffi (e.g. by ref'ing `rustls_connection_write_tls()`). --- src/connection.rs | 7 +++++++ src/rustls.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/connection.rs b/src/connection.rs index 2602ed9e..cda5739f 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -277,6 +277,13 @@ impl rustls_connection { } } + /// Returns true if the connection is currently performing the TLS handshake. + /// + /// Note: This may return `false` while there are still handshake packets waiting + /// to be extracted and transmitted with `rustls_connection_write_tls()`. + /// + /// See the rustls documentation for more information. + /// /// #[no_mangle] pub extern "C" fn rustls_connection_is_handshaking(conn: *const rustls_connection) -> bool { diff --git a/src/rustls.h b/src/rustls.h index b42c7c9b..738a3fed 100644 --- a/src/rustls.h +++ b/src/rustls.h @@ -1508,6 +1508,13 @@ bool rustls_connection_wants_read(const struct rustls_connection *conn); bool rustls_connection_wants_write(const struct rustls_connection *conn); /** + * Returns true if the connection is currently performing the TLS handshake. + * + * Note: This may return `false` while there are still handshake packets waiting + * to be extracted and transmitted with `rustls_connection_write_tls()`. + * + * See the rustls documentation for more information. + * * */ bool rustls_connection_is_handshaking(const struct rustls_connection *conn);