Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mdns taking a long time to discover peers. #2053

Merged
merged 3 commits into from
Apr 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions protocols/mdns/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use lazy_static::lazy_static;
use libp2p_core::{
address_translation, connection::ConnectionId, multiaddr::Protocol, Multiaddr, PeerId,
};
use libp2p_core::connection::ListenerId;
use libp2p_swarm::{
protocols_handler::DummyProtocolsHandler, NetworkBehaviour, NetworkBehaviourAction,
PollParameters, ProtocolsHandler,
Expand Down Expand Up @@ -269,6 +270,10 @@ impl NetworkBehaviour for Mdns {
void::unreachable(ev)
}

fn inject_new_listen_addr(&mut self, _id: ListenerId, _addr: &Multiaddr) {
self.send_buffer.push_back(build_query());
}

fn poll(
&mut self,
cx: &mut Context<'_>,
Expand Down