linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] core: Only page device once per connect attempt
@ 2013-06-12 12:13 Luiz Augusto von Dentz
  2013-06-13  9:20 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2013-06-12 12:13 UTC (permalink / raw)
  To: linux-bluetooth

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

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-13  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-12 12:13 [PATCH BlueZ] core: Only page device once per connect attempt Luiz Augusto von Dentz
2013-06-13  9:20 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).