C convenience lib (was Re: Is dbus_pending_call_set_notify() thread safe?)
Havoc Pennington
hp at redhat.com
Fri Aug 3 08:55:20 PDT 2007
Hi,
Thiago Macieira wrote:
> 1) does it handle properly the introspections for objects with sub-nodes
> only (no interfaces)? I.e., object paths that were created only because
> they have children objects, like /org for /org/freedesktop/DBus.
If you register a "fallback handler" for a whole subtree you would
normally implement Introspect() on that subtree also, since libdbus
doesn't know what's "inside" it.
> 2) how does it insert the sub-nodes XML entries for existing objects? That
> is, suppose I register /foo and /foo/bar. If I get the introspection call
> for /foo, does libdbus-1 insert the <node name="bar"/> into my XML data?
The only thing libdbus does is that if all app handlers return
NOT_YET_HANDLED for an Introspect(), it has a default Introspect()
implementation that just lists the registered child nodes. This default
implementation is used for nodes that nobody owns, for example usually "/"
If you handle Introspect() at all, you have to handle it entirely by
listing the child nodes and including them in your xml, with
dbus_connection_list_registered()
> 3) does dbus_bus_add_match causes a reference count to go up somewhere?
> (preferrably, in the daemon)
Right, if you add the same match 3 times you must remove it 3 times
before it goes away.
>> I do think it's a bug if it's impossible to coordinate multiple object
>> system mappings on one connection using the available APIs, though if we
>> deprecated shared connections it is obviously not a very important bug.
>
> I can't consider it a bug if the solution that libdbus-1 provides -- even
> if there's nothing wrong with it -- doesn't fit my needs. See below.
To be clear I'm not saying it's a bug in QtDBus - I think it's fine if
you want to simply claim the shared connection or ignore it. (Both have
the effect of meaning the shared connection isn't usable.)
However since the connection is in fact shared in some code I've
written, etc. and I think it's nice if it is shareable, I think it's a
bug in libdbus if there are fundamental reasons it is not shareable.
<snipping out reasons why QtDBus owns the whole connection>
Thanks for the writeup of that, it's useful info for me.
Havoc
More information about the dbus
mailing list