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

XML::Stream::ParseStream doesn't buffer partial tags #15

Open
topaz opened this issue Oct 7, 2015 · 2 comments
Open

XML::Stream::ParseStream doesn't buffer partial tags #15

topaz opened this issue Oct 7, 2015 · 2 comments

Comments

@topaz
Copy link

topaz commented Oct 7, 2015

The documentation for this function claims:

# ParseStream - takes the incoming stream and makes sure that only full
#               XML tags gets passed to the parser.  If a full tag has not
#               read yet, then the Stream saves the incomplete part and
#               sends the rest to the parser.

However, it doesn't seem to have any of the described capability, even though the calling code (like in XML::Stream::OpenStream) seems to assume it works as described by blindly passing in data from the network.

A recent version of the Openfire server passes partial XML fragments over the network, at least when restarting a session after TLS and auth. XML::Stream::ParseStream receives "<" in one invocation, followed by "?xml ....." and the rest of the document in another invocation, confusing the parser.

So, XML::Stream::ParseStream needs to buffer partial XML documents until they're ready to be parsed, as described in its documentation.

@dmansfield
Copy link

This was fixed a while back in an as-yet unmerged pull request (#11). I'm going to rebase that one now as there have been changes upstream. Hopefully this will get merged into an upcoming release.

@dmansfield
Copy link

The new pull request is #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants