Option LAN Discovery

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-09-24 09:58:57 +08:00
parent 98a84a577b
commit e8143255e9
25 changed files with 374 additions and 326 deletions

View File

@@ -30,7 +30,8 @@ pub(super) fn start_listening() -> ResultType<()> {
if let Ok(msg_in) = Message::parse_from_bytes(&buf[0..len]) {
match msg_in.union {
Some(rendezvous_message::Union::PeerDiscovery(p)) => {
if p.cmd == "ping" {
if p.cmd == "ping" && Config::get_option("enable-lan-discovery").is_empty()
{
if let Some(self_addr) = get_ipaddr_by_peer(&addr) {
let mut msg_out = Message::new();
let peer = PeerDiscovery {