Commit 6bad6d64 authored by Dan Williams's avatar Dan Williams
Browse files

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
parent 53e56d21
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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment