mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Fixed the potential advertising issue in Wi-Fi LAN
PiperOrigin-RevId: 774961389
This commit is contained in:
committed by
Copybara-Service
parent
0c0a59d8a1
commit
b8246abbe4
@@ -148,7 +148,7 @@ bool WifiLanMdns::StopMdnsService() {
|
||||
LOG(INFO) << "StopMdnsService is called";
|
||||
if (!is_service_started_) {
|
||||
LOG(WARNING) << "The mDNS service is not started.";
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
dns_service_notification_ = std::make_unique<absl::Notification>();
|
||||
|
||||
@@ -211,6 +211,9 @@ bool WifiLanMedium::StopAdvertising(const NsdServiceInfo& nsd_service_info) {
|
||||
if (NearbyFlags::GetInstance().GetBoolFlag(
|
||||
nearby::platform::config_package_nearby::nearby_platform_feature::
|
||||
kEnableBlockingSocket)) {
|
||||
// The service may be running under WinRT when the flag is enabled.
|
||||
dnssd_service_instance_ = nullptr;
|
||||
|
||||
bool result = wifi_lan_mdns_.StopMdnsService();
|
||||
|
||||
if (result) {
|
||||
@@ -223,6 +226,9 @@ bool WifiLanMedium::StopAdvertising(const NsdServiceInfo& nsd_service_info) {
|
||||
medium_status_ &= (~kMediumStatusAdvertising);
|
||||
return false;
|
||||
} else {
|
||||
// The service may be running under Win32 when the flag is disabled.
|
||||
wifi_lan_mdns_.StopMdnsService();
|
||||
|
||||
dnssd_service_instance_ = nullptr;
|
||||
|
||||
LOG(INFO) << "succeeded to stop mDNS advertising for service type ="
|
||||
|
||||
Reference in New Issue
Block a user