public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaikumar Ganesh <jaikumar@google.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Update SDP storage records when a record is deleted.
Date: Thu, 29 Oct 2009 14:04:36 -0700	[thread overview]
Message-ID: <e8892a6a0910291404m5728465ck39353be8f7173361@mail.gmail.com> (raw)
In-Reply-To: <2d5a2c100910291334n6e97013cnc71d658b45496bf0@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

Hi Johan:

On Thu, Oct 29, 2009 at 1:34 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi,
>
> They look so much better now :D

Attached.


>
> --
> Luiz Augusto von Dentz
> Engenheiro de Computação
>

[-- Attachment #2: 0001-Fix-handling-of-SDP-records.patch --]
[-- Type: text/x-diff, Size: 1857 bytes --]

From ab5b4da387bdd1d3461a8a45d05a4c6a13157e6a Mon Sep 17 00:00:00 2001
From: Jaikumar Ganesh <jaikumar@google.com>
Date: Thu, 29 Oct 2009 14:01:36 -0700
Subject: [PATCH] Fix handling of SDP records.

We were deleting the SDP records only if a device was registered for
those UUIDs. With this change, we delete the SDP records even if there
are no drivers registered.
---
 src/device.c |   28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/src/device.c b/src/device.c
index 5585271..69a68db 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1136,8 +1136,6 @@ static void device_remove_drivers(struct btd_device *device, GSList *uuids)
 		next = list->next;
 
 		for (uuid = driver->uuids; *uuid; uuid++) {
-			sdp_record_t *rec;
-
 			if (!g_slist_find_custom(uuids, *uuid,
 					(GCompareFunc) strcasecmp))
 				continue;
@@ -1150,24 +1148,28 @@ static void device_remove_drivers(struct btd_device *device, GSList *uuids)
 								driver_data);
 			g_free(driver_data);
 
-			rec = find_record_in_list(records, *uuid);
-			if (!rec)
-				break;
+			break;
+		}
+	}
 
-			delete_record(srcaddr, dstaddr, rec->handle);
+	for (list = uuids; list; list = list->next) {
+		sdp_record_t *rec;
 
-			records = sdp_list_remove(records, rec);
-			sdp_record_free(rec);
+		device->uuids = g_slist_remove(device->uuids, list->data);
+
+		rec = find_record_in_list(records, list->data);
+		if (!rec)
+			continue;
+
+		delete_record(srcaddr, dstaddr, rec->handle);
+
+		records = sdp_list_remove(records, rec);
+		sdp_record_free(rec);
 
-			break;
-		}
 	}
 
 	if (records)
 		sdp_list_free(records, (sdp_free_func_t) sdp_record_free);
-
-	for (list = uuids; list; list = list->next)
-		device->uuids = g_slist_remove(device->uuids, list->data);
 }
 
 static void services_changed(struct btd_device *device)
-- 
1.6.2.3


  reply	other threads:[~2009-10-29 21:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-22 23:19 [PATCH] Update SDP storage records when a record is deleted Jaikumar Ganesh
2009-10-22 23:58 ` Johan Hedberg
2009-10-23 13:49 ` Luiz Augusto von Dentz
2009-10-23 15:17   ` Jaikumar Ganesh
2009-10-23 17:44     ` Luiz Augusto von Dentz
2009-10-26 15:20       ` Jaikumar Ganesh
2009-10-28 19:00         ` jaikumar Ganesh
2009-10-28 23:34         ` Johan Hedberg
2009-10-28 23:45           ` Jaikumar Ganesh
2009-10-28 23:54             ` Johan Hedberg
2009-10-29  0:02               ` Jaikumar Ganesh
2009-10-29  0:15                 ` Johan Hedberg
2009-10-29 18:42                   ` Jaikumar Ganesh
2009-10-29 20:30                     ` Jaikumar Ganesh
2009-10-29 20:34                       ` Luiz Augusto von Dentz
2009-10-29 21:04                         ` Jaikumar Ganesh [this message]
2009-10-29 21:13                           ` Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8892a6a0910291404m5728465ck39353be8f7173361@mail.gmail.com \
    --to=jaikumar@google.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox