All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: [PATCH v2 2/3] dbus: Add disconnect watch support
Date: Fri, 13 Feb 2015 08:01:26 -0600	[thread overview]
Message-ID: <54DE03B6.9070309@gmail.com> (raw)
In-Reply-To: <1423816017.4196.26.camel@linux.intel.com>

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

Hi Jukka,

<snip>

 >>> +struct filter_data {
>>> +	struct l_dbus *dbus;
>>> +	l_dbus_message_func_t handle_func;
>>> +	l_dbus_watch_func_t connect_func;
>>> +	l_dbus_watch_func_t disconnect_func;
>>> +	char *name;
>>> +	char *owner;
>>
>> What is the exact difference between name and owner?  I don't see a
>> distinction...
>
> name is something like "org.foobar" and owner is ":1.101"
>
> User registers watch using a name and dbus-daemon sends its
> notifications about NameOwnerChanged signals using the owner format so
> we need to track both formats.

Yes, but you don't actually handle that anywhere.  So I don't see a 
distinction in the current code.  If this is TBD, then simply don't 
include this and mention somewhere that only unique bus names are supported.

<snip>

>>> +	if (arg && data->argument && strcmp(arg, data->argument))
>>> +		goto out;
>>
>> This looks wrong
>
> Please elaborate more?
>

If arg is NULL, the matching continues.  I do not think that is what you 
want, but I've not read the DBus spec lately.  This needs a unit test case.

<snip>

>>> +LIB_EXPORT unsigned int l_dbus_add_service_watch(struct l_dbus *dbus,
>>> +					const char *name,
>>> +					l_dbus_watch_func_t connect_func,
>>> +					l_dbus_watch_func_t disconnect_func,
>>> +					void *user_data,
>>> +					l_dbus_destroy_func_t destroy)
>>> +{
>>> +	struct filter_data *data;
>>> +
>>> +	if (!name)
>>> +		return 0;
>>> +
>>> +	if (connect_func)
>>> +		return -EOPNOTSUPP;
>>
>> Why? You seem to be handling that just fine?
>
> No, connect watch needs more work as more code needs to be done. I only
> needed the disconnect watch for my app so in order to speed things up,
> left the connect to be done later when such need arises. The connect
> pointer is in the API so that we do not need to change the API later.
>

Okay.  But this is still wrong.  The return value is an unsigned int. 
You're returning a negative errno.

Might want to make this into an internal private function for now.

Regards,
-Denis

  reply	other threads:[~2015-02-13 14:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12 11:48 [PATCH v2 0/3] Add DBus disconnect watch support Jukka Rissanen
2015-02-12 11:48 ` [PATCH v2 1/3] dbus: Add AddMatch and RemoveMatch support Jukka Rissanen
2015-02-13  3:00   ` Denis Kenzior
2015-02-12 11:48 ` [PATCH v2 2/3] dbus: Add disconnect watch support Jukka Rissanen
2015-02-13  3:25   ` Denis Kenzior
2015-02-13  8:26     ` Jukka Rissanen
2015-02-13 14:01       ` Denis Kenzior [this message]
2015-02-13 14:23         ` Jukka Rissanen
2015-02-13 15:05           ` Denis Kenzior
2015-02-16 10:22             ` Jukka Rissanen
2015-02-12 11:48 ` [PATCH v2 3/3] unit: dbus: Add test for disconnect watch API Jukka Rissanen
2015-02-13  3:36   ` Denis Kenzior
2015-02-13  8:40     ` Jukka Rissanen
2015-02-13 14:10       ` Denis Kenzior
2015-02-13 14:29         ` Jukka Rissanen
2015-02-13 15:09           ` Denis Kenzior
2015-02-16 10:53             ` Jukka Rissanen
2015-02-16 15:58               ` Denis Kenzior

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=54DE03B6.9070309@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ell@lists.01.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 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.