summaryrefslogtreecommitdiffstats
path: root/src/device.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-09-05 23:31:31 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2008-09-05 23:31:31 +0300
commit8b2e688eaf5b71006c72cf91a8e4df3c0c41c306 (patch)
tree9dfb9813144bf72601851c953b664d522db209ba /src/device.c
parent5c56174577f601c74807ba232f31773dbe2db9b1 (diff)
Check for duplicate record handles and not UUIDs
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/device.c b/src/device.c
index 3476ec06..65b68e2f 100644
--- a/src/device.c
+++ b/src/device.c
@@ -767,6 +767,14 @@ static void services_changed(struct browse_req *req)
g_free(uuids);
}
+static int rec_cmp(const void *a, const void *b)
+{
+ const sdp_record_t *r1 = a;
+ const sdp_record_t *r2 = b;
+
+ return r1->handle - r2->handle;
+}
+
static void update_services(struct browse_req *req, sdp_list_t *recs)
{
struct btd_device *device = req->device;
@@ -794,8 +802,7 @@ static void update_services(struct browse_req *req, sdp_list_t *recs)
continue;
/* Check for duplicates */
- if (g_slist_find_custom(req->uuids_added, uuid_str,
- (GCompareFunc) strcmp))
+ if (sdp_list_find(req->records, rec, rec_cmp))
continue;
store_record(src, dst, rec);