[Bug 30296] Add Conn.I.Addressing support to Gabble

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Nov 17 16:48:57 CET 2011


https://bugs.freedesktop.org/show_bug.cgi?id=30296

--- Comment #21 from Andre Moreira Magalhaes <andrunko at gmail.com> 2011-11-17 07:48:57 PST ---
(In reply to comment #20)
> + escaped_node = g_uri_escape_string (node, NULL, TRUE);
> + if (escaped_node == NULL)
> + {
> + g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
> + "'%s' is not a valid JID", jid);
> 
> How could this possibly fail, given that node is already non-NULL? Likewise for
> the other two g_uri_escape_string calls.
Done

> + if (!gabble_decode_jid (jid, &tmp_node, &tmp_domain, &tmp_resource))
> + {
> + g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
> + "'%s' is not a valid XMPP URI", uri);
> + goto OUT;
> + }
> 
> You probably want wocky_decode_jid instead of gabble_decode_jid (it's a trivial
> wrapper).
Done. Will also setup a trivia branch on top of master removing
gabble_decode_jid.

> This is relying on the fact that wocky_decode_jid will allow "%" in all three
> components, I think? Not all valid escaped-JIDs are valid JIDs. I think it'd be
> enough to open this as a bug and move on, though.
> 
> I can't help feeling that gabble_parse_xmpp_uri() should validate the node,
> domain and resource individually - at the moment it does a *lot* of JID ->
> tuple -> JID -> tuple round-trips - but to do that properly, we'd need Wocky to
> expose wocky_validate_jid_node(), wocky_validate_jid_domain(), and a new
> wocky_validate_jid_domain() (at the moment the first two are static and the
> third is just "is a non-empty string").
Indeed. Let's open a bug for this. Want some comments in the code?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.



More information about the telepathy-bugs mailing list