-
Notifications
You must be signed in to change notification settings - Fork 99
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
HTTP Body io.Reader as parser input results in ErrUnexpectedEndOfDemo #299
Comments
Thanks for raising this, I will probably need to fix something in https://github.com/markus-wa/gobitread 😅 |
ah, for anyone else who finds this (as discussed via gitter): |
sorry this took so long @martig3 , would you be able to try with this branch: #305
I'm not 100% sure it will fix every case but for me I had a similar issue with gzip that went away with the change. |
No problem @markus-wa, thanks for the patch. I tested this with a few of my demo files and it appears to be working in my project branch here. When I have some more time I'll write some tests on my end but it appears to be working consistently enough for me at the moment. |
awesome, thanks - I'll get a release out later this week |
Just released v2.10.0 which should fix it. I'm not 100% sure if this will cover all cases as it's a bit tricky to test - but if anyone is still experiencing issues please let me know and we can re-open this 🙂 |
Describe the bug
Passing an HTTP Body
io.Reader
toNewParser()
then callingParseToEnd()
results in andemo stream ended unexpectedly (ErrUnexpectedEndOfDemo)
errorTo Reproduce
I tested with https://www.dropbox.com/s/7lb1r11olhc6a1b/2021-6-6_pug_de_overpass_60bc5197ffc453a0de48212d.dem?dl=0 but I believe this is reproducible with all demos.
Code:
Expected behavior
Demo gets parsed successfully as it does with
os.Open()
readers. Specifically from the code example, POSTing to/parse-stats
should return a 200 and not panic onp.ParseToEnd()
.Library version
v2.9.0
The text was updated successfully, but these errors were encountered: