fix: custom client, options, option2bool() (#8302)

* fix: custom client, options, option2bool()

Signed-off-by: fufesou <linlong1266@gmail.com>

* format

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-06-10 00:11:59 +08:00
committed by GitHub
parent 78d7bfac01
commit 32ab56f864
8 changed files with 45 additions and 7 deletions

View File

@@ -34,7 +34,11 @@ 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" && Config::get_option("enable-lan-discovery").is_empty()
if p.cmd == "ping"
&& config::option2bool(
"enable-lan-discovery",
&Config::get_option("enable-lan-discovery"),
)
{
if let Some(self_addr) = get_ipaddr_by_peer(&addr) {
let mut msg_out = Message::new();