drop connection field in service_record_item_t

This commit is contained in:
Matthias Ringwald 2015-11-14 23:29:44 +01:00
parent 00cae490be
commit 32a66b8deb
2 changed files with 4 additions and 10 deletions

View File

@ -200,9 +200,7 @@ uint32_t sdp_register_service_internal(void *connection, uint8_t * record){
if (!newRecordItem) {
return 0;
}
// link new service item to client connection
newRecordItem->connection = connection;
// set new handle
newRecordItem->service_record_handle = record_handle;
@ -237,12 +235,11 @@ uint32_t sdp_register_service_internal(void *connection, uint8_t * record){
//
void sdp_unregister_service_internal(void *connection, uint32_t service_record_handle){
service_record_item_t * record_item = sdp_get_record_for_handle(service_record_handle);
if (record_item && record_item->connection == connection) {
linked_list_remove(&sdp_service_records, (linked_item_t *) record_item);
if (!record_item) return;
linked_list_remove(&sdp_service_records, (linked_item_t *) record_item);
#ifndef EMBEDDED
free(record_item);
free(record_item);
#endif
}
}
// PDU

View File

@ -63,9 +63,6 @@ typedef struct {
// linked list - assert: first field
linked_item_t item;
// client connection
void * connection;
// data is contained in same memory
uint32_t service_record_handle;
uint8_t service_record[1]; // waste 1 byte to allow compilation with older compilers