Re: [PATCH v0 1/4] adapter: Replace device authorizing flag
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2012-09-20 12:20:24
Hi Mikel, On Tue, Sep 11, 2012 at 4:55 PM, Mikel Astiz [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Mikel Astiz <redacted> Refactor code to drop the device authorizing flag by replacing it with a private authorization pointer in btd_adapter. After all, no more than one authorization can be ongoing, so the code is easier to follow if this is made explicit. --- src/adapter.c | 48 ++++++++++++++++++++++++++++++++---------------- src/device.c | 11 ----------- src/device.h | 2 -- 3 files changed, 32 insertions(+), 29 deletions(-)diff --git a/src/adapter.c b/src/adapter.c index 4b675e8..14c5322 100644 --- a/src/adapter.c +++ b/src/adapter.c@@ -128,7 +128,8 @@ struct btd_adapter { GSList *found_devices; GSList *oor_devices; /* out of range device list */ struct agent *agent; /* For the new API */ - guint auth_idle_id; /* Ongoing authorization */ + guint auth_idle_id; /* Ongoing authorization (trusted) */ + struct service_auth *auth; /* Ongoing authorization */
You should probably store the id directly inside struct service_auth as they depend on each other then when you free auth you also remove the id if not set to 0. -- Luiz Augusto von Dentz