Do not require messages without INTERFACE to be dispatched
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 16 Sep 2013 13:16:13 +0000 (14:16 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 27 Nov 2013 15:35:42 +0000 (15:35 +0000)
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>
doc/dbus-specification.xml

index 125001a..865a8bf 100644 (file)
         <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