summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 15:02:52 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 15:02:52 +0000
commit3ae5bab014f04b9e19c43f2e955c16d340df6fa6 (patch)
tree75b0368bc6470b594d4ff65a69029d328c264b53
parent4bb36ed2213e8c329077d8a7ee0799b3a3e0ece1 (diff)
downloadchromium_src-3ae5bab014f04b9e19c43f2e955c16d340df6fa6.zip
chromium_src-3ae5bab014f04b9e19c43f2e955c16d340df6fa6.tar.gz
chromium_src-3ae5bab014f04b9e19c43f2e955c16d340df6fa6.tar.bz2
Possible fix / workaround for geolocation wifi hanging bug
Also pre-emptively fixes a reported issue with NULL bss list being returned from WlanGetNetworkBssList BUG=39300 TEST=run browser on desktop with dodgy wifi adapter.... Review URL: http://codereview.chromium.org/1256005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42613 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/geolocation/wifi_data_provider_win.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/chrome/browser/geolocation/wifi_data_provider_win.cc b/chrome/browser/geolocation/wifi_data_provider_win.cc
index d5f053e..05a4306 100644
--- a/chrome/browser/geolocation/wifi_data_provider_win.cc
+++ b/chrome/browser/geolocation/wifi_data_provider_win.cc
@@ -263,6 +263,17 @@ bool WindowsWlanApi::GetAccessPointData(
// Go through the list of interfaces and get the data for each.
for (int i = 0; i < static_cast<int>(interface_list->dwNumberOfItems); ++i) {
+ // Skip any interface that is midway through association; the
+ // WlanGetNetworkBssList function call is known to hang indefinitely
+ // when it's in this state. http://crbug.com/39300
+ if (interface_list->InterfaceInfo[i].isState ==
+ wlan_interface_state_associating) {
+ LOG(INFO) << "Skipping wifi scan on adapter " << i << " ("
+ << interface_list->InterfaceInfo[i].strInterfaceDescription
+ << ") in 'associating' state. Repeated occurrences indicates "
+ << "a non-responding adapter.";
+ continue;
+ }
GetInterfaceDataWLAN(wlan_handle,
interface_list->InterfaceInfo[i].InterfaceGuid,
data);
@@ -283,11 +294,11 @@ bool WindowsWlanApi::GetAccessPointData(
// number of access points found, or -1 on error.
int WindowsWlanApi::GetInterfaceDataWLAN(
const HANDLE wlan_handle,
- const GUID &interface_id,
- WifiData::AccessPointDataSet *data) {
+ const GUID& interface_id,
+ WifiData::AccessPointDataSet* data) {
DCHECK(data);
// WlanGetNetworkBssList allocates bss_list.
- WLAN_BSS_LIST *bss_list;
+ WLAN_BSS_LIST* bss_list = NULL;
if ((*WlanGetNetworkBssList_function_)(wlan_handle,
&interface_id,
NULL, // Use all SSIDs.
@@ -297,6 +308,11 @@ int WindowsWlanApi::GetInterfaceDataWLAN(
&bss_list) != ERROR_SUCCESS) {
return -1;
}
+ // According to http://www.attnetclient.com/kb/questions.php?questionid=75
+ // WlanGetNetworkBssList can sometimes return success, but leave the bss
+ // list as NULL.
+ if (!bss_list)
+ return -1;
int found = 0;
for (int i = 0; i < static_cast<int>(bss_list->dwNumberOfItems); ++i) {