Skip to content

Commit

Permalink
[#52] fix(server): do not crash during unsuccessful handshake (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
M0dEx committed Jun 6, 2024
1 parent c700056 commit 33ad071
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quincy"
version = "0.8.2"
version = "0.8.3"
authors = ["Jakub Kubík <[email protected]>"]
license = "MIT"
description = "QUIC-based VPN"
Expand Down
12 changes: 10 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,20 @@ impl QuincyServer {
tokio::select! {
// New connections
Some(handshake) = endpoint.accept() => {
let client_ip = handshake.remote_address().ip();

debug!(
"Received incoming connection from '{}'",
handshake.remote_address().ip()
client_ip
);

let quic_connection = handshake.await?;
let quic_connection = match handshake.await {
Ok(connection) => connection,
Err(e) => {
warn!("Connection handshake with client '{client_ip}' failed: {e}");
continue;
}
};

let connection = QuincyConnection::new(
quic_connection,
Expand Down

0 comments on commit 33ad071

Please sign in to comment.