OSDN Git Service

core: Only page device once per connect attempt
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 12 Jun 2013 12:13:36 +0000 (15:13 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 13 Jun 2013 09:19:17 +0000 (12:19 +0300)
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

index 5cb5460..0f75c60 100644 (file)
@@ -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;