diff --git a/Cargo.lock b/Cargo.lock index d6034aae..050aaa93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -613,9 +613,9 @@ dependencies = [ [[package]] name = "cypheraddr" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a05c461a9b86ba80542a5204924fd3cae3f47be011e00b1bbef9d71d95b3bb" +checksum = "e64c60d980ec55006d2a1229923a5fa73046de824455569cccb6cb2e4a64ae31" dependencies = [ "amplify", "base32", @@ -637,9 +637,9 @@ dependencies = [ [[package]] name = "cyphernet" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c78f33bc1f1423741a6939ce6da2b6af2e7be4ff43e8878cf4bac1284028e93" +checksum = "2f8be7cc6e24cfea2c126bddaaddfd3c3054865b4cd52882eae9dfea6ee8aac1" dependencies = [ "cypheraddr", "cyphergraphy", @@ -1901,9 +1901,9 @@ dependencies = [ [[package]] name = "netservices" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8216a05f756d0c7c02743812f6db7f5dccb7cfe9f2b2612f4aaf85c7eb641a" +checksum = "ee13a6ce51c79cf719cea8a3f0d3584098e529c726634bc1197cbbb6967b7de2" dependencies = [ "amplify", "cyphernet", @@ -3103,9 +3103,9 @@ dependencies = [ [[package]] name = "socks5-client" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4091196d57cf9436ebecbec4c572b2be61373a7aaa632a3e93a5cb8555ec1b79" +checksum = "c0c27f4545b26cb6e14990e7477c38a8b493b2e8738166fa2a1f5f174ef3fa5f" dependencies = [ "amplify", "cypheraddr", diff --git a/radicle-crypto/Cargo.toml b/radicle-crypto/Cargo.toml index c3f404af..edd3f60a 100644 --- a/radicle-crypto/Cargo.toml +++ b/radicle-crypto/Cargo.toml @@ -17,7 +17,7 @@ ssh = ["radicle-ssh", "ssh-key"] [dependencies] amplify = { version = "4.0.0" } -cyphernet = { version = "0.3.0", optional = true, features = ["ed25519"] } +cyphernet = { version = "0.4.1", optional = true, features = ["ed25519"] } fastrand = { version = "2.0.0", default-features = false, optional = true } multibase = { version = "0.9.1" } ec25519 = { version = "0.1.0", features = [] } diff --git a/radicle-node/Cargo.toml b/radicle-node/Cargo.toml index f8b06c55..4a5da1d7 100644 --- a/radicle-node/Cargo.toml +++ b/radicle-node/Cargo.toml @@ -17,14 +17,14 @@ byteorder = { version = "1" } chrono = { version = "0.4.0", default-features = false, features = ["clock"] } colored = { version = "1.9.0" } crossbeam-channel = { version = "0.5.6" } -cyphernet = { version = "0.3.0", features = ["tor", "dns", "ed25519", "p2p-ed25519"] } +cyphernet = { version = "0.4.1", features = ["tor", "dns", "ed25519", "p2p-ed25519"] } fastrand = { version = "2.0.0" } io-reactor = { version = "0.2.1", features = ["popol"] } lexopt = { version = "0.2.1" } libc = { version = "0.2.137" } log = { version = "0.4.17", features = ["std"] } localtime = { version = "1.2.0" } -netservices = { version = "0.3.0", features = ["io-reactor", "socket2"] } +netservices = { version = "0.4.0", features = ["io-reactor", "socket2"] } nonempty = { version = "0.8.1", features = ["serialize"] } once_cell = { version = "1.13" } qcheck = { version = "1", default-features = false, optional = true } diff --git a/radicle-node/src/wire/protocol.rs b/radicle-node/src/wire/protocol.rs index d64ade61..7e45ab00 100644 --- a/radicle-node/src/wire/protocol.rs +++ b/radicle-node/src/wire/protocol.rs @@ -47,6 +47,9 @@ pub const NOISE_XK: HandshakePattern = HandshakePattern { /// workers waiting for data from remotes as well. pub const DEFAULT_CHANNEL_TIMEOUT: time::Duration = time::Duration::from_secs(9); +/// Default time to wait until a network connection is considered inactive. +pub const DEFAULT_CONNECTION_TIMEOUT: time::Duration = time::Duration::from_secs(30); + /// Control message used internally between workers, users, and the service. #[allow(clippy::large_enum_variant)] #[derive(Debug)] @@ -885,9 +888,12 @@ pub fn dial>( force_proxy: bool, ) -> io::Result> { let connection = if force_proxy { - net::TcpStream::connect_nonblocking(proxy_addr)? + net::TcpStream::connect_nonblocking(proxy_addr, DEFAULT_CONNECTION_TIMEOUT)? } else { - net::TcpStream::connect_nonblocking(remote_addr.connection_addr(proxy_addr))? + net::TcpStream::connect_nonblocking( + remote_addr.connection_addr(proxy_addr), + DEFAULT_CONNECTION_TIMEOUT, + )? }; Ok(session::( remote_addr, diff --git a/radicle/Cargo.toml b/radicle/Cargo.toml index c5833138..32514283 100644 --- a/radicle/Cargo.toml +++ b/radicle/Cargo.toml @@ -15,7 +15,7 @@ test = ["qcheck", "radicle-crypto/test"] [dependencies] amplify = { version = "4.0.0", default-features = false, features = ["std"] } crossbeam-channel = { version = "0.5.6" } -cyphernet = { version = "0.3.0", features = ["tor", "dns", "p2p-ed25519"] } +cyphernet = { version = "0.4.1", features = ["tor", "dns", "p2p-ed25519"] } fastrand = { version = "2.0.0" } multibase = { version = "0.9.1" } localtime = { version = "1.2.0", features = ["serde"] }