Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OF-1087: Default namespace handling in BOSH. #539

Merged
merged 3 commits into from Feb 15, 2016

Conversation

guusdk
Copy link
Member

@guusdk guusdk commented Feb 15, 2016

No description provided.

A change introduced in Openfire 3.10.3 (OF-938) changed how the BOSH
implementation would add default namespace definitions where applicable.
This new implementation depends on a space from being present in the
outer stanza. The 'fin' element that's transmitted here is wrapped in
a message stanza without any attributes ( <message><fin ... ) which
caused the namespace to be injected in the fin element (where the first
space was).

This commit adds a 'to' attribute to the wrapping message stanza, to
allow for users to work around the problem without having to update
Openfire itself.

The BOSH implementation will be adjusted to account for this in another
commit.
The original code depends on a whitespace to be present within the limits
of the element. This is not safe (eg: <message><foo/></message> fails).
Instead, the closing characters ( > or /> ) of the first element should
be used, as that's guaranteed to be present.
In dom4j, the default namespace of an element cannot be set by adding
a namespace that has an empty-string prefix. Although the string
representation of the element will be correct, that namespace is not
being recognized as the default namespace of the element (instead, it
is a namespace like any other prefixed namespace, to be used in child
elements).
@sco0ter
Copy link
Contributor

sco0ter commented Feb 15, 2016

I really dislike(d) the old and new XML string manipulation. It's fragile and ugly (as can be now be seen with these fixes). Isn't there a clever way to do that in a clean way by working with dom4j elements?

The same logic applied to the BOSH implementation should also be fixed in the WebSocket implementation.

I also think there are more occurrences of addNamespace, which might cause trouble then.

dwd added a commit that referenced this pull request Feb 15, 2016
OF-1087: Default namespace handling in BOSH.
@dwd dwd merged commit 4539428 into igniterealtime:master Feb 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants