Changeset 7554702 for protocols/jabber


Ignore:
Timestamp:
2015-11-25T15:56:09Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
42a418e
Parents:
5b01e1a
Message:

jabber: Reply unknown IQs with service-unavailable instead

It was sending 'feature-not-implemented' for <query> with unknown xmlns
(which makes sense, but the RFC says that's wrong. idk.) and nothing at
all for IQs that don't have query/ping/time elements or an xmlns
attribute. Both get service-unavailable now.

Addresses the rest of trac ticket 533:

https://bugs.bitlbee.org/bitlbee/ticket/533

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r5b01e1a r7554702  
    5353                      (c = xt_find_node(node->children, "time"))) ||
    5454                    !(s = xt_find_attr(c, "xmlns"))) {
    55                         /* Sigh. Who decided to suddenly invent new elements
    56                            instead of just sticking with <query/>? */
    57                         return XT_HANDLED;
     55
     56                        reply = jabber_make_error_packet(node, "service-unavailable", "cancel", NULL);
     57                        st = jabber_write_packet(ic, reply);
     58                        xt_free_node(reply);
     59                        return st;
    5860                }
    5961
     
    136138                } else {
    137139                        xt_free_node(reply);
    138                         reply = jabber_make_error_packet(node, "feature-not-implemented", "cancel", NULL);
     140                        reply = jabber_make_error_packet(node, "service-unavailable", "cancel", NULL);
    139141                        pack = 0;
    140142                }
Note: See TracChangeset for help on using the changeset viewer.