linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 4/4] gdbus/client: Always call ready callback
Date: Tue,  5 Jan 2016 14:54:38 -0300	[thread overview]
Message-ID: <1452016478-17221-4-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1452016478-17221-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Call ready callback regardless of the reply to GetManagedObjects
since otherwise the user code will be left waiting forever when in fact
no proxy will be created.
---
 gdbus/client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdbus/client.c b/gdbus/client.c
index 48711ae..068e778 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -1073,9 +1073,6 @@ static void parse_managed_objects(GDBusClient *client, DBusMessage *msg)
 
 		dbus_message_iter_next(&dict);
 	}
-
-	if (client->ready)
-		client->ready(client, client->ready_data);
 }
 
 static void get_managed_objects_reply(DBusPendingCall *call, void *user_data)
@@ -1096,6 +1093,9 @@ static void get_managed_objects_reply(DBusPendingCall *call, void *user_data)
 	parse_managed_objects(client, reply);
 
 done:
+	if (client->ready)
+		client->ready(client, client->ready_data);
+
 	dbus_message_unref(reply);
 
 	dbus_pending_call_unref(client->get_objects_call);
-- 
2.4.3


  parent reply	other threads:[~2016-01-05 17:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 17:54 [PATCH BlueZ 1/4] doc/gatt-api: Make proper use of ObjectManager Luiz Augusto von Dentz
2016-01-05 17:54 ` [PATCH BlueZ 2/4] core/gatt-database: Implement Application API Luiz Augusto von Dentz
2016-01-05 17:54 ` [PATCH BlueZ 3/4] test/example-gatt-server: Make use of RegisterApplication Luiz Augusto von Dentz
2016-01-05 17:54 ` Luiz Augusto von Dentz [this message]
2016-01-11 14:39 ` [PATCH BlueZ 1/4] doc/gatt-api: Make proper use of ObjectManager Luiz Augusto von Dentz

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=1452016478-17221-4-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).