OSDN Git Service

core: Fix incorrect update of dev->svc_refreshed
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 12 Jul 2013 10:18:14 +0000 (13:18 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 12 Jul 2013 10:18:14 +0000 (13:18 +0300)
src/device.c

index 18d0d46..bd513ec 100644 (file)
@@ -1440,10 +1440,18 @@ static void device_svc_resolved(struct btd_device *dev, int err)
        DBusMessage *reply;
        struct browse_req *req = dev->browse;
 
+       DBG("%s err %d", dev->path, err);
+
        dev->svc_resolved = true;
-       dev->svc_refreshed = true;
        dev->browse = NULL;
 
+       /* Disconnection notification can happen before this function
+        * gets called, so don't set svc_refreshed for a disconnected
+        * device.
+        */
+       if (dev->connected)
+               dev->svc_refreshed = true;
+
        g_slist_free_full(dev->eir_uuids, g_free);
        dev->eir_uuids = NULL;