Do not require messages without INTERFACE to be dispatched

Previously, if we have interfaces:

    interface com.example.foo:
        method Ambiguous()
    interface com.example.bar:
        method Ambiguous()
        method Unambiguous()

implementations were required to deliver a message with no INTERFACE
and METHOD=Unambiguous to "bar". A message with no INTERFACE and
METHOD=Ambiguous could either be delivered to "foo", delivered to "bar"
or treated as an error.

Relax this to allow an error for the unambiguous case, too, and
strongly recommend specifying the interface (which is best-practice).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68597
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
Vaguely-acked-by: Thiago Macieira, David Zeuthen
[and desrt objected that it didn't go far enough]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
Simon McVittie 2013-09-16 14:16:13 +01:00
parent 969f3918dc
commit 0fa46f68b8

View file

@ -1688,12 +1688,16 @@
<para>
A method call message is required to have a <literal>MEMBER</literal> header field
indicating the name of the method. Optionally, the message has an
<literal>INTERFACE</literal> field giving the interface the method is a part of. In the
absence of an <literal>INTERFACE</literal> field, if two interfaces on the same object have
a method with the same name, it is undefined which of the two methods
will be invoked. Implementations may also choose to return an error in
this ambiguous case. However, if a method name is unique
implementations must not require an interface field.
<literal>INTERFACE</literal> field giving the interface the method is a part of.
Including the <literal>INTERFACE</literal> in all method call
messages is strongly recommended.
</para>
<para>
In the absence of an <literal>INTERFACE</literal> field, if two
or more interfaces on the same object have a method with the same
name, it is undefined which of those methods will be invoked.
Implementations may choose to either return an error, or deliver the
message as though it had an arbitrary one of those interfaces.
</para>
<para>
Method call messages also include a <literal>PATH</literal> field