From 0232b47e02ed4f1eab18e89419e72b7080cad0be Mon Sep 17 00:00:00 2001 From: edwinwu Date: Thu, 26 Aug 2021 08:46:47 -0700 Subject: [PATCH] ios: nearbyConnections: Fixes the issue that can't Advertise and Discover for WifiLan. - The local WifilanSocket and WifilanService is local variable which will be invalid if out of scope. Move them to the member and let the WifiLanMedium control the life scope. PiperOrigin-RevId: 393133266 --- cpp/core/internal/p2p_cluster_pcp_handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/core/internal/p2p_cluster_pcp_handler.cc b/cpp/core/internal/p2p_cluster_pcp_handler.cc index 10823b06..aa709b0a 100644 --- a/cpp/core/internal/p2p_cluster_pcp_handler.cc +++ b/cpp/core/internal/p2p_cluster_pcp_handler.cc @@ -553,7 +553,7 @@ bool P2pClusterPcpHandler::IsRecognizedWifiLanEndpoint( } ByteArray expected_service_id_hash = - GenerateHash(service_id, BluetoothDeviceName::kServiceIdHashLength); + GenerateHash(service_id, WifiLanServiceInfo::kServiceIdHashLength); if (service_info.GetServiceIdHash() != expected_service_id_hash) { NEARBY_LOGS(INFO)