diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-05 23:05:30 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-05 23:05:30 +0300 |
commit | 37a7d2aba17bcb47a3e9bfba78ad23a8a3cbe420 (patch) | |
tree | 2ececcc249b560f89d56e4c5b0dce093a3f263d8 | |
parent | 9ab6fa037c8c3e72ad0c789c379d3310eafc225f (diff) |
Check for duplicate records when discovering services
-rw-r--r-- | src/device.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c index 1cf260ec..3476ec06 100644 --- a/src/device.c +++ b/src/device.c @@ -787,13 +787,19 @@ static void update_services(struct browse_req *req, sdp_list_t *recs) if (sdp_get_service_classes(rec, &svcclass) < 0) continue; - store_record(src, dst, rec); /* Extract the first element and skip the remainning */ uuid_str = bt_uuid2string(svcclass->data); if (!uuid_str) continue; + /* Check for duplicates */ + if (g_slist_find_custom(req->uuids_added, uuid_str, + (GCompareFunc) strcmp)) + continue; + + store_record(src, dst, rec); + /* Copy record */ if (sdp_gen_record_pdu(rec, &pdu) == 0) { sdp_record_t *record; |