From bc49a387b62b6e71f1383a421b508722fb52e42f Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 12 Jun 2013 15:13:36 +0300 Subject: [PATCH] core: Only page device once per connect attempt In case of EHOSTDOWN/page timeout the code should not proceed with the next profile as it is very likely it will fail again, moreover the page timeout is configurable and should be enough for getting a response from the remote device in a reasonable time. --- src/device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/device.c b/src/device.c index 5cb54605b..0f75c6055 100644 --- a/src/device.c +++ b/src/device.c @@ -1164,6 +1164,9 @@ static void device_profile_connected(struct btd_device *dev, if (dev->pending == NULL) return; + if (!dev->connected && err == -EHOSTDOWN) + goto done; + pending = dev->pending->data; l = find_service_with_profile(dev->pending, profile); if (l != NULL) @@ -1179,6 +1182,7 @@ static void device_profile_connected(struct btd_device *dev, if (connect_next(dev) == 0) return; +done: if (!dev->connect) return; -- 2.47.3