mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-31 17:01:58 +00:00
protocols/mdns: Removed obsolete lazy static use from mdns (#2977)
Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@@ -8,8 +8,11 @@
|
||||
|
||||
- Fix a bug that could cause a delay of ~10s until peers would get discovered when using the tokio runtime. See [PR 2939].
|
||||
|
||||
- Removed the `lazy_static` dependency. See [PR 2977].
|
||||
|
||||
[PR 2918]: https://github.com/libp2p/rust-libp2p/pull/2918
|
||||
[PR 2939]: https://github.com/libp2p/rust-libp2p/pull/2939
|
||||
[PR 2977]: https://github.com/libp2p/rust-libp2p/pull/2977
|
||||
|
||||
# 0.40.0
|
||||
|
||||
|
@@ -15,7 +15,6 @@ data-encoding = "2.3.2"
|
||||
dns-parser = "0.8.0"
|
||||
futures = "0.3.13"
|
||||
if-watch = "1.1.1"
|
||||
lazy_static = "1.4.0"
|
||||
libp2p-core = { version = "0.37.0", path = "../../core" }
|
||||
libp2p-swarm = { version = "0.40.0", path = "../../swarm" }
|
||||
log = "0.4.14"
|
||||
|
@@ -120,8 +120,8 @@ where
|
||||
config.query_interval + Duration::from_millis(jitter)
|
||||
};
|
||||
let multicast_addr = match addr {
|
||||
IpAddr::V4(_) => IpAddr::V4(*crate::IPV4_MDNS_MULTICAST_ADDRESS),
|
||||
IpAddr::V6(_) => IpAddr::V6(*crate::IPV6_MDNS_MULTICAST_ADDRESS),
|
||||
IpAddr::V4(_) => IpAddr::V4(crate::IPV4_MDNS_MULTICAST_ADDRESS),
|
||||
IpAddr::V6(_) => IpAddr::V6(crate::IPV6_MDNS_MULTICAST_ADDRESS),
|
||||
};
|
||||
Ok(Self {
|
||||
addr,
|
||||
|
@@ -30,7 +30,6 @@
|
||||
//! implements the `NetworkBehaviour` trait. This struct will automatically discover other
|
||||
//! libp2p nodes on the local network.
|
||||
//!
|
||||
use lazy_static::lazy_static;
|
||||
use std::net::{Ipv4Addr, Ipv6Addr};
|
||||
use std::time::Duration;
|
||||
|
||||
@@ -48,11 +47,8 @@ const SERVICE_NAME: &[u8] = b"_p2p._udp.local";
|
||||
/// The meta query for looking up the `SERVICE_NAME`.
|
||||
const META_QUERY_SERVICE: &[u8] = b"_services._dns-sd._udp.local";
|
||||
|
||||
lazy_static! {
|
||||
pub static ref IPV4_MDNS_MULTICAST_ADDRESS: Ipv4Addr = Ipv4Addr::new(224, 0, 0, 251);
|
||||
pub static ref IPV6_MDNS_MULTICAST_ADDRESS: Ipv6Addr =
|
||||
Ipv6Addr::new(0xFF02, 0, 0, 0, 0, 0, 0, 0xFB);
|
||||
}
|
||||
pub const IPV4_MDNS_MULTICAST_ADDRESS: Ipv4Addr = Ipv4Addr::new(224, 0, 0, 251);
|
||||
pub const IPV6_MDNS_MULTICAST_ADDRESS: Ipv6Addr = Ipv6Addr::new(0xFF02, 0, 0, 0, 0, 0, 0, 0xFB);
|
||||
|
||||
/// Configuration for mDNS.
|
||||
#[derive(Debug, Clone)]
|
||||
|
Reference in New Issue
Block a user