Skip to content

Commit

Permalink
connection: more docs for rustls_connection_is_handshaking
Browse files Browse the repository at this point in the history
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()`).
  • Loading branch information
cpu committed May 29, 2024
1 parent 8a137f8 commit a3d604c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
/// <https://docs.rs/rustls/latest/rustls/struct.CommonState.html#method.is_handshaking>
#[no_mangle]
pub extern "C" fn rustls_connection_is_handshaking(conn: *const rustls_connection) -> bool {
Expand Down
7 changes: 7 additions & 0 deletions src/rustls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <https://docs.rs/rustls/latest/rustls/struct.CommonState.html#method.is_handshaking>
*/
bool rustls_connection_is_handshaking(const struct rustls_connection *conn);
Expand Down

0 comments on commit a3d604c

Please sign in to comment.