Bug 57016 - Make wocky_stanza_get_type_info() check namespaces
Summary: Make wocky_stanza_get_type_info() check namespaces
Status: RESOLVED FIXED
Alias: None
Product: Wocky
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://cgit.collabora.com/git/user/wj...
Whiteboard: r+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-11-12 14:28 UTC by Will Thompson
Modified: 2012-11-14 18:21 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Will Thompson 2012-11-12 14:28:27 UTC
Previously, wocky_stanza_get_type_info() did not check the namespace of the stanza's top node. So it claimed that this:

  <challenge xmlns='l:o:l'/>

has type WOCKY_STANZA_TYPE_CHALLENGE, which is not the case: it should look like this:

  <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>

Ditto all other stanza types. As it happens, there are no name collisions so it works out fine.

Here's a branch which fixes this. It also adds a new property to WockyXmppReader which lets you specify a default namespace when it's in non-streaming mode. This makes life easier for Gabble's console plugin, as seen in the corresponding branch to update Gabble: <http://cgit.collabora.com/git/user/wjt/telepathy-gabble/log/?h=console-stanza-namespace>
Comment 1 Simon McVittie 2012-11-13 11:33:04 UTC
This comment in the diff context is no longer entirely true:

# Wocky fills in xmlns='' for us if we don't specify a namespace... great.
# So this means <message/> gets sent as <message xmlns=''/> and the server
# kicks us off.

All looks good though - ship it, and fix that comment if you're feeling virtuous.

> In the course of fixing this, I found that telling the console to send
> this: <message> <body> hai </body> </message>
> would send this: <message xmlns='jabber:client'> <body xmlns=''>

... which we presumably never noticed, because it worked fine in practice on typical XMPP clients. Namespaces? We've heard of them (where "we" means "XMPP implementors in general")
Comment 2 Will Thompson 2012-11-14 18:21:28 UTC
(In reply to comment #1)
> This comment in the diff context is no longer entirely true:
> 
> # Wocky fills in xmlns='' for us if we don't specify a namespace... great.
> # So this means <message/> gets sent as <message xmlns=''/> and the server
> # kicks us off.
> 
> All looks good though - ship it, and fix that comment if you're feeling
> virtuous.
> 
> > In the course of fixing this, I found that telling the console to send
> > this: <message> <body> hai </body> </message>
> > would send this: <message xmlns='jabber:client'> <body xmlns=''>
> 
> ... which we presumably never noticed, because it worked fine in practice on
> typical XMPP clients. Namespaces? We've heard of them (where "we" means
> "XMPP implementors in general")

Yeah. Gabble doesn't care, for instance. (Also, I find the console most useful for sending IQs, whose bodies always have an explicit namespace, so the issue of recursively fixing up the ns never came up!)

Merged to Wocky and Gabble master:

  http://cgit.freedesktop.org/wocky/log/?id=31f33f4ba66bcdddda84b419cf4960073d071290
  http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=1d6c3044f13488e5457a31be631dec8e12068b6b


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.