mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-24 10:10:47 +01:00
2005-08-22 Dan Williams <dcbw@redhat.com>
Noticed by Bill Moss <bmoss@clemson.edu> * src/NetworkManagerDevice.c - (nm_device_wireless_scan): fix scan timeout, we were waiting way too long for scans to complete git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@897 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
53e56d216c
commit
6bad6d6452
2 changed files with 12 additions and 3 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2005-08-22 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Noticed by Bill Moss <bmoss@clemson.edu>
|
||||
* src/NetworkManagerDevice.c
|
||||
- (nm_device_wireless_scan): fix scan timeout, we were
|
||||
waiting way too long for scans to complete
|
||||
|
||||
2005-08-22 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Patch from j@bootlab.org:
|
||||
|
|
|
|||
|
|
@ -4001,7 +4001,10 @@ static gboolean nm_device_wireless_scan (gpointer user_data)
|
|||
NMNetworkMode orig_mode = NETWORK_MODE_INFRA;
|
||||
double orig_freq = 0;
|
||||
int orig_rate = 0;
|
||||
const int max_wait = G_USEC_PER_SEC * nm_device_get_association_pause_value (dev) /2;
|
||||
const int interval = 20;
|
||||
const int assoc_pause = nm_device_get_association_pause_value (dev);
|
||||
const int delay = (G_USEC_PER_SEC * assoc_pause) / interval;
|
||||
const int max_tries = assoc_pause * interval;
|
||||
nm_completion_args args;
|
||||
|
||||
orig_mode = nm_device_get_mode (dev);
|
||||
|
|
@ -4023,8 +4026,7 @@ static gboolean nm_device_wireless_scan (gpointer user_data)
|
|||
args[1] = &err;
|
||||
args[2] = sk;
|
||||
args[3] = scan_results;
|
||||
nm_wait_for_completion(max_wait, max_wait/20,
|
||||
nm_completion_scan_has_results, NULL, args);
|
||||
nm_wait_for_completion (max_tries, delay, nm_completion_scan_has_results, NULL, args);
|
||||
|
||||
nm_device_set_mode (dev, orig_mode);
|
||||
/* Only set frequency if ad-hoc mode */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue