linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] advertising: reply in RegisterAdvertisement on success
@ 2019-08-06 13:47 Rafał Miłecki
  0 siblings, 0 replies; only message in thread
From: Rafał Miłecki @ 2019-08-06 13:47 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

RegisterAdvertisement method handler sends a reply message on all kind
of errors. It makes waiting for a reply and checking it very useful on
the caller side. There are errors like InvalidArguments, AlreadyExists,
etc. defined.

A missing reply on RegisterAdvertisement success was causing
dbus_pending_call_block() to block caller and was resulting in the
org.freedesktop.DBus.Error.NoReply after a timeout.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
Hi,

I'm writing my first BlueZ app using C language and I run into this
timeout + org.freedesktop.DBus.Error.NoReply problem. I found this fix
and tested it successfully.

I can see that many methods handler do the same, e.g.:
UnregisterAdvertisement, RegisterProfile and UnregisterApplication.

Let me know if you see any problem with this patch/fix.
---
 src/advertising.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/advertising.c b/src/advertising.c
index 3ed13766c..43591ae42 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1190,7 +1190,7 @@ static DBusMessage *register_advertisement(DBusConnection *conn,
 
 	queue_push_tail(manager->clients, client);
 
-	return NULL;
+	return dbus_message_new_method_return(msg);
 }
 
 static DBusMessage *unregister_advertisement(DBusConnection *conn,
-- 
2.21.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-06 13:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 13:47 [PATCH] advertising: reply in RegisterAdvertisement on success Rafał Miłecki

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).