All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gdbus: Fix not calling disconnect function
@ 2015-02-23 18:33 Szymon Janc
  2015-02-24 13:14 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2015-02-23 18:33 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

If daemon gets disconnected from D-Bus sender is NULL. Watches that
was explicitly added with NULL sender (ie disconnected_signal in
g_dbus_set_disconnect_function) should be called anyway.
---
 gdbus/watch.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gdbus/watch.c b/gdbus/watch.c
index 0d0054c..b60f650 100644
--- a/gdbus/watch.c
+++ b/gdbus/watch.c
@@ -523,9 +523,7 @@ static DBusHandlerResult message_filter(DBusConnection *connection,
 	member = dbus_message_get_member(message);
 	dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg, DBUS_TYPE_INVALID);
 
-	/* Sender is always the owner */
-	if (sender == NULL)
-		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+	/* If sender != NULL it is always the owner */
 
 	for (current = listeners; current != NULL; current = current->next) {
 		data = current->data;
@@ -533,6 +531,9 @@ static DBusHandlerResult message_filter(DBusConnection *connection,
 		if (connection != data->connection)
 			continue;
 
+		if (!sender && data->owner)
+			continue;
+
 		if (data->owner && g_str_equal(sender, data->owner) == FALSE)
 			continue;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gdbus: Fix not calling disconnect function
  2015-02-23 18:33 [PATCH] gdbus: Fix not calling disconnect function Szymon Janc
@ 2015-02-24 13:14 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2015-02-24 13:14 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Mon, Feb 23, 2015 at 8:33 PM, Szymon Janc <szymon.janc@tieto.com> wrote:
> If daemon gets disconnected from D-Bus sender is NULL. Watches that
> was explicitly added with NULL sender (ie disconnected_signal in
> g_dbus_set_disconnect_function) should be called anyway.
> ---
>  gdbus/watch.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/gdbus/watch.c b/gdbus/watch.c
> index 0d0054c..b60f650 100644
> --- a/gdbus/watch.c
> +++ b/gdbus/watch.c
> @@ -523,9 +523,7 @@ static DBusHandlerResult message_filter(DBusConnection *connection,
>         member = dbus_message_get_member(message);
>         dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg, DBUS_TYPE_INVALID);
>
> -       /* Sender is always the owner */
> -       if (sender == NULL)
> -               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
> +       /* If sender != NULL it is always the owner */
>
>         for (current = listeners; current != NULL; current = current->next) {
>                 data = current->data;
> @@ -533,6 +531,9 @@ static DBusHandlerResult message_filter(DBusConnection *connection,
>                 if (connection != data->connection)
>                         continue;
>
> +               if (!sender && data->owner)
> +                       continue;
> +
>                 if (data->owner && g_str_equal(sender, data->owner) == FALSE)
>                         continue;
>
> --
> 1.9.3

Applied, thanks.


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-24 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-23 18:33 [PATCH] gdbus: Fix not calling disconnect function Szymon Janc
2015-02-24 13:14 ` Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.