[PATCH BlueZ] core: Only page device once per connect attempt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

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 5cb5460..0f75c60 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;
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux