After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 128358 - Unknown iq's are silently ignored
Unknown iq's are silently ignored
Status: RESOLVED FIXED
Product: gossip
Classification: Deprecated
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Gossip Maintainers
Gossip Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-12-02 14:19 UTC by Ralph Meijer
Modified: 2005-07-11 16:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ralph Meijer 2003-12-02 14:19:28 UTC
When gossip receives iq's with a child that it doesn't recognise, it
silently drops them. Instead gossip should always reply to iq's. In this
case return an iq of type error to let the other party know that it doesn't
support the feature.
Comment 1 Lucas Nussbaum 2004-11-16 20:23:17 UTC
More precisely, XMPP IM says :
2.4.  Extended Namespaces
[...]
   Support for any given extended namespace is OPTIONAL on the part of
   any implementation (aside from the extended namespaces defined
   herein).  If an entity does not understand such a namespace, the
   entity's expected behavior depends on whether the entity is (1) the
   recipient or (2) an entity that is routing the stanza to the
   recipient:

   Recipient: If a recipient receives a stanza that contains a child
      element it does not understand, it SHOULD ignore that specific XML
      data, i.e., it SHOULD not process it or present it to a user or
      associated application (if any).  In particular:

      *  If an entity receives a message or presence stanza that
         contains XML data qualified by a namespace it does not
         understand, the portion of the stanza that is in the unknown
         namespace SHOULD be ignored.

      *  If an entity receives a message stanza whose only child element
         is qualified by a namespace it does not understand, it MUST
         ignore the entire stanza.

      *  If an entity receives an IQ stanza of type "get" or "set"
         containing a child element qualified by a namespace it does not
         understand, the entity SHOULD return an IQ stanza of type
         "error" with an error condition of <service-unavailable/>.
Comment 2 Martyn Russell 2005-07-09 13:44:04 UTC
I think I am reading the spec right, but now if the jabber:iq:something
namespace is unrecognised, it will return:

<iq type="error" to="someone@jabber.org" id="msg_16">  
  <query xmlns="jabber:iq:last"></query>
  <error type="cancel">  
    <service-unavailable
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></service-unavailable>
  </error>
</iq>

Correct me if this is wrong.
Comment 3 Ralph Meijer 2005-07-09 20:09:58 UTC
For completeness, an <iq type="get"/> or <iq type="set"/> can only have one
child element. If the namespace of that element is unknown, than you must return
the service-unavailable error. I would recommend that you also send along the
legacy error code 503. I don't know why you don't use empty elements, but a
resulting packet would look like:

  <iq type="error" to="client@example.org/resource" id="msg_16">
    <query xmlns="jabber:iq:last"/>
    <error type="cancel" code="503">
      <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
    </error>
  </iq>

Note that it is forbidden to return anything when receiving result or error type
iq's, even if the namespace is unknown.
Comment 4 Martyn Russell 2005-07-11 16:25:57 UTC
OK, I will add the 503 code in for legacy support.

As for the empty elements, this is down to Loudmouth.

Currently this is ONLY sent in response to a GET or SET IQ as per the spec ;)