From 8b2e688eaf5b71006c72cf91a8e4df3c0c41c306 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 5 Sep 2008 23:31:31 +0300 Subject: Check for duplicate record handles and not UUIDs --- src/device.c | 11 +++++++++-- 1 file 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); -- cgit