Update to libp2p-0.36 (#8420)

* Update to libp2p-0.36

* Some more Cargo.lock updates.
This commit is contained in:
Roman Borschel
2021-03-24 19:29:35 +01:00
committed by GitHub
parent 9a72134188
commit e1570b9ab4
15 changed files with 246 additions and 75 deletions
+2 -2
View File
@@ -61,7 +61,7 @@ use libp2p::kad::handler::KademliaHandlerProto;
use libp2p::kad::QueryId;
use libp2p::kad::record::{self, store::{MemoryStore, RecordStore}};
#[cfg(not(target_os = "unknown"))]
use libp2p::mdns::{Mdns, MdnsEvent};
use libp2p::mdns::{Mdns, MdnsConfig, MdnsEvent};
use libp2p::multiaddr::Protocol;
use log::{debug, info, trace, warn};
use std::{cmp, collections::{HashMap, HashSet, VecDeque}, io, num::NonZeroUsize, time::Duration};
@@ -220,7 +220,7 @@ impl DiscoveryConfig {
discovery_only_if_under_num,
#[cfg(not(target_os = "unknown"))]
mdns: if enable_mdns {
MdnsWrapper::Instantiating(Mdns::new().boxed())
MdnsWrapper::Instantiating(Mdns::new(MdnsConfig::default()).boxed())
} else {
MdnsWrapper::Disabled
},
+3 -2
View File
@@ -63,10 +63,11 @@ pub fn build_transport(
let desktop_trans = tcp::TcpConfig::new().nodelay(true);
let desktop_trans = websocket::WsConfig::new(desktop_trans.clone())
.or_transport(desktop_trans);
OptionalTransport::some(if let Ok(dns) = dns::DnsConfig::new(desktop_trans.clone()) {
let dns_init = futures::executor::block_on(dns::DnsConfig::system(desktop_trans.clone()));
OptionalTransport::some(if let Ok(dns) = dns_init {
EitherTransport::Left(dns)
} else {
EitherTransport::Right(desktop_trans.map_err(dns::DnsErr::Underlying))
EitherTransport::Right(desktop_trans.map_err(dns::DnsErr::Transport))
})
} else {
OptionalTransport::none()