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

Fix parsing when element is between buffers #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hanneskuettner
Copy link

This PR fixes an issue where the characters method in the XMLParser is called with element text that is cut in half due to the buffer size of the underlying parser.
We cannot stop looking at the value that we are interested in after we got the first value, but rather until we encounter the end tag for this element.

@faruktoptas
Copy link
Owner

Thank you for your contribution. Can you provide a Rss URL or a sample Xml please? I will create a unit test for this.

@hanneskuettner
Copy link
Author

Sure thing!
Those are just two files. One file with the pubDate right at the 8096 byte buffer size, which fails on the original version, since it cuts the pubDate in half (stop after April).
In the other file all the fields fit in one buffer and are not cut.

test_fails_on_old.txt
test_succeeds_on_old.txt

@faruktoptas
Copy link
Owner

faruktoptas commented Apr 21, 2017

This works but when try to parse this xml:
onediorss.txt
First item title is "". But it works without your modifications.

@hanneskuettner
Copy link
Author

I will look into that.
Can you provide me with more example files that you use for testing?

@faruktoptas
Copy link
Owner

I will add more samples. Now I am working on unit testing. It is almost done.

@faruktoptas
Copy link
Owner

I added unit tests to dev branch. You can go on working.

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

Successfully merging this pull request may close these issues.

2 participants