Skip to content

Commit

Permalink
feat(bindings): add set receive buffering to the rust bindings (#4817)
Browse files Browse the repository at this point in the history
  • Loading branch information
zz85 authored Oct 3, 2024
1 parent ead40c5 commit 6bb195c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bindings/rust/s2n-tls/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,18 @@ impl Connection {
Ok(self)
}

/// Configure the connection to reduce potentially expensive calls to recv.
///
/// Refer to the corresponding C API
/// [s2n_connection_set_recv_buffering](https://aws.github.io/s2n-tls/doxygen/s2n_8h.html)
/// for more information.
pub fn set_receive_buffering(&mut self, enabled: bool) -> Result<&mut Self, Error> {
unsafe {
s2n_connection_set_recv_buffering(self.connection.as_ptr(), enabled).into_result()
}?;
Ok(self)
}

/// wipes and free the in and out buffers associated with a connection.
///
/// This function may be called when a connection is in keep-alive or idle state to
Expand Down

0 comments on commit 6bb195c

Please sign in to comment.