summaryrefslogtreecommitdiff
path: root/plugins/wifi.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-12-18 02:21:42 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-12-18 02:21:42 +0100
commit71187176982da82f48deb8504fc033fb72c78f74 (patch)
tree79b2f5e3ae4516a5861146c90d81353418cc5766 /plugins/wifi.c
parentf883452f576d8f9e51d2b474f5a5d4d33ab093f9 (diff)
downloadconnman-71187176982da82f48deb8504fc033fb72c78f74.tar.gz
connman-71187176982da82f48deb8504fc033fb72c78f74.tar.bz2
connman-71187176982da82f48deb8504fc033fb72c78f74.zip
Fix duplicate wireless scan results
Diffstat (limited to 'plugins/wifi.c')
-rw-r--r--plugins/wifi.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index e38f2bba..f2153527 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -140,7 +140,7 @@ static struct connman_element *find_current_element(struct wifi_data *data,
struct connman_element *element = list->data;
if (connman_element_match_static_property(element,
- "Name", &identifier) == TRUE)
+ "Name", &identifier) == TRUE)
return element;
}
@@ -156,7 +156,7 @@ static struct connman_element *find_pending_element(struct wifi_data *data,
struct connman_element *element = list->data;
if (connman_element_match_static_property(element,
- "Name", &identifier) == TRUE)
+ "Name", &identifier) == TRUE)
return element;
}
@@ -170,11 +170,6 @@ static gboolean inactive_scan(gpointer user_data)
DBG("");
- if (data->cleanup_timer > 0) {
- g_source_remove(data->cleanup_timer);
- data->cleanup_timer = 0;
- }
-
__supplicant_scan(device);
data->inactive_timer = 0;
@@ -290,12 +285,14 @@ static void clear_results(struct connman_element *device)
DBG("pending %d", g_slist_length(data->pending));
DBG("current %d", g_slist_length(data->current));
+ if (data->cleanup_timer > 0) {
+ g_source_remove(data->cleanup_timer);
+ cleanup_pending(data);
+ }
+
data->pending = data->current;
data->current = NULL;
- if (data->cleanup_timer > 0)
- return;
-
data->cleanup_timer = g_timeout_add_seconds(CLEANUP_TIMEOUT,
cleanup_pending, data);
}
@@ -457,7 +454,7 @@ static int wifi_disable(struct connman_element *element)
if (data->cleanup_timer > 0) {
g_source_remove(data->cleanup_timer);
- data->cleanup_timer = 0;
+ cleanup_pending(data);
}
if (data->inactive_timer > 0) {
@@ -467,15 +464,6 @@ static int wifi_disable(struct connman_element *element)
__supplicant_disconnect(element);
- for (list = data->pending; list; list = list->next) {
- struct connman_element *network = list->data;
-
- connman_element_unref(network);
- }
-
- g_slist_free(data->pending);
- data->pending = NULL;
-
for (list = data->current; list; list = list->next) {
struct connman_element *network = list->data;