Remove direct yamux dependency. (#4968)

libp2p-0.16 allows configuring yamux through libp2p-yamux, so the
direct dependency is no longer needed.

While at it we also update to the latest versions of yamux and
nohash-hasher, though the code changes do not depend on it.
This commit is contained in:
Toralf Wittner
2020-02-18 15:08:25 +01:00
committed by GitHub
parent 91024a1739
commit af493e46eb
3 changed files with 13 additions and 18 deletions
+4 -5
View File
@@ -3721,9 +3721,9 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
[[package]] [[package]]
name = "nohash-hasher" name = "nohash-hasher"
version = "0.1.3" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "721a2bf1c26159ebf17e0a980bc4ce61f4b2fec5ec3b42d42fddd7a84a9e538f" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
[[package]] [[package]]
name = "nom" name = "nom"
@@ -6204,7 +6204,6 @@ dependencies = [
"unsigned-varint", "unsigned-varint",
"void", "void",
"wasm-timer", "wasm-timer",
"yamux",
"zeroize 1.1.0", "zeroize 1.1.0",
] ]
@@ -9127,9 +9126,9 @@ checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57"
[[package]] [[package]]
name = "yamux" name = "yamux"
version = "0.4.2" version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "902f4cee32c401c211b6b69f4a3f6f4cf3515644db5bd822cf685a7dbd6201f9" checksum = "d73295bc9d9acf89dd9336b3b5f5b57731ee72b587857dd4312721a0196b48e5"
dependencies = [ dependencies = [
"bytes 0.5.4", "bytes 0.5.4",
"futures 0.3.4", "futures 0.3.4",
+1 -2
View File
@@ -27,7 +27,7 @@ linked-hash-map = "0.5.2"
linked_hash_set = "0.1.3" linked_hash_set = "0.1.3"
log = "0.4.8" log = "0.4.8"
lru = "0.4.0" lru = "0.4.0"
nohash-hasher = "0.1.3" nohash-hasher = "0.2.0"
parking_lot = "0.10.0" parking_lot = "0.10.0"
prost = "0.6.1" prost = "0.6.1"
rand = "0.7.2" rand = "0.7.2"
@@ -54,7 +54,6 @@ thiserror = "1"
unsigned-varint = { version = "0.3.0", features = ["futures-codec"] } unsigned-varint = { version = "0.3.0", features = ["futures-codec"] }
void = "1.0.2" void = "1.0.2"
zeroize = "1.0.0" zeroize = "1.0.0"
yamux = "0.4.2"
[dev-dependencies] [dev-dependencies]
async-std = "1.5" async-std = "1.5"
+8 -11
View File
@@ -57,17 +57,14 @@ pub fn build_transport(
mplex_config.max_buffer_len_behaviour(mplex::MaxBufferBehaviour::Block); mplex_config.max_buffer_len_behaviour(mplex::MaxBufferBehaviour::Block);
mplex_config.max_buffer_len(usize::MAX); mplex_config.max_buffer_len(usize::MAX);
let yamux_config = { let mut yamux_config = libp2p::yamux::Config::default();
let mut c = yamux::Config::default(); yamux_config.set_lazy_open(true); // Only set SYN flag on first data frame sent to the remote.
// Only set SYN flag on first data frame sent to the remote.
c.set_lazy_open(true); if use_yamux_flow_control {
if use_yamux_flow_control { // Enable proper flow-control: window updates are only sent when
// Enable proper flow-control: window updates are only sent when // buffered data has been consumed.
// buffered data has been consumed. yamux_config.set_window_update_mode(libp2p::yamux::WindowUpdateMode::OnRead);
c.set_window_update_mode(yamux::WindowUpdateMode::OnRead); }
}
libp2p::yamux::Config::new(c)
};
// Build the base layer of the transport. // Build the base layer of the transport.
let transport = if let Some(t) = wasm_external_transport { let transport = if let Some(t) = wasm_external_transport {