mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-migration, vmm: Remove unsafe code when setting socket options
The introduced `TcpStream` accessor allows setting socket options on the `TcpStream` without going through the file descriptor and unsafe methods. On-behalf-of: SAP julian.schindel@sap.com Signed-off-by: Julian Schindel <julian.schindel@cyberus-technology.de>
This commit is contained in:
committed by
Rob Bradford
parent
53ee9ebb77
commit
ec68508a2a
@@ -216,6 +216,14 @@ impl TlsStream {
|
||||
/// from growing without bound.
|
||||
const BUF_SIZE: usize = 64 /* KiB */ << 10;
|
||||
|
||||
/// Returns a reference to the underlying [`TcpStream`].
|
||||
pub fn tcp_stream(&self) -> &TcpStream {
|
||||
match &self.stream {
|
||||
TlsStreamParticipant::Client(stream) => stream.get_ref(),
|
||||
TlsStreamParticipant::Server(stream) => stream.get_ref(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a client [`TlsStream`].
|
||||
///
|
||||
/// The client verifies the server certificate against `ca-cert.pem` and the
|
||||
|
||||
Reference in New Issue
Block a user