summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-08 22:39:58 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-07-08 22:39:58 -0700
commit1d08cedd8acf8fcce4a8201e204c08922299557a (patch)
tree1c48f4d03b34c7787300e3f295b2e041afbdee60
parentf13db1df2feb49cbd379deffba9deecdc4dc0e93 (diff)
downloadconnman-1d08cedd8acf8fcce4a8201e204c08922299557a.tar.gz
connman-1d08cedd8acf8fcce4a8201e204c08922299557a.tar.bz2
connman-1d08cedd8acf8fcce4a8201e204c08922299557a.zip
Don't trigger auto-connect when connection attempt is pending
-rw-r--r--src/service.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c
index 5c4379b4..47ba5074 100644
--- a/src/service.c
+++ b/src/service.c
@@ -435,6 +435,24 @@ static connman_bool_t is_connecting(struct connman_service *service)
return FALSE;
}
+static struct connman_service *find_pending_service(void)
+{
+ struct connman_service *service;
+ GSequenceIter *iter;
+
+ iter = g_sequence_get_begin_iter(service_list);
+
+ while (g_sequence_iter_is_end(iter) == FALSE) {
+ service = g_sequence_get(iter);
+ if (service->pending != NULL)
+ return service;
+
+ iter = g_sequence_iter_next(iter);
+ }
+
+ return NULL;
+}
+
static void __connman_service_auto_connect(void)
{
struct connman_service *service;
@@ -442,6 +460,10 @@ static void __connman_service_auto_connect(void)
DBG("");
+ service = find_pending_service();
+ if (service != NULL)
+ return;
+
iter = g_sequence_get_begin_iter(service_list);
if (g_sequence_iter_is_end(iter) == TRUE)
return;