Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update client.rs
  • Loading branch information
hellower authored Aug 28, 2023
commit 9d5f968c812f37241fbe0beb3f0573e84e7f953f
10 changes: 9 additions & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,15 @@ pub async fn client_entrypoint(
log_client_connections: bool,
) -> Result<(), Error> {
// Figure out if the client wants TLS or not.
let addr = stream.peer_addr().unwrap();
let addr = match stream.peer_addr() {
Ok(addr) => addr,
Err(err) => {
return Err(Error::SocketError(format!(
"Failed to get peer address: {:?}",
err
)));
}
};

match get_startup::<TcpStream>(&mut stream).await {
// Client requested a TLS connection.
Expand Down