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 authored and GitHub committed 2024-06-10 00:11:59 +08:00
1 parent 78d7bfac01
commit 32ab56f864
8 files changed
+45 -7

No files matched your search

+5 -1
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();