diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-07-11 02:58:49 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-07-11 02:58:49 +0000 |
commit | 50ef5513db1ddcfa1e0bf704fe79cc8e30964cd2 (patch) | |
tree | d13d71fdba96b02cda7a4b5c8cd99d3fd45c1504 /sdpd | |
parent | 13c0e26a0213f67f5bb9bd6915fddee9a7ca3b49 (diff) |
Fix SDP record registration with specific record handles
Diffstat (limited to 'sdpd')
-rw-r--r-- | sdpd/service.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sdpd/service.c b/sdpd/service.c index a1072cd6..002efc85 100644 --- a/sdpd/service.c +++ b/sdpd/service.c @@ -540,8 +540,10 @@ int service_register_req(sdp_req_t *req, sdp_buf_t *rsp) } } else { if (sdp_record_find(rec->handle)) { - sdp_record_free(rec); - goto invalid; + /* extract_pdu_server will add the record handle + * if it is missing. So instead of failing, skip + * the record adding to avoid duplication. */ + goto success; } } @@ -552,10 +554,9 @@ int service_register_req(sdp_req_t *req, sdp_buf_t *rsp) handle = sdp_data_alloc(SDP_UINT32, &rec->handle); sdp_attr_replace(rec, SDP_ATTR_RECORD_HANDLE, handle); - /* - * if the browse group descriptor is NULL, - * ensure that the record belongs to the ROOT group - */ +success: + /* if the browse group descriptor is NULL, + * ensure that the record belongs to the ROOT group */ if (sdp_data_get(rec, SDP_ATTR_BROWSE_GRP_LIST) == NULL) { uuid_t uuid; sdp_uuid16_create(&uuid, PUBLIC_BROWSE_GROUP); |