-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 binary and chunked HTTP downloads. Add diffs from @anod221. #2985
Fix binary and chunked HTTP downloads. Add diffs from @anod221. #2985
Conversation
Checking the sources that @anod221 gave I created these diffs. They look ok but I did not have a chance to test them yet.
Hi!
A large response still causes a panic though if I omit the range:
but my understanding is that it was more or less expected anyway, and nothing prevents us from downloading large images 1kB at a time using range requests. |
@wtarreau thats great news, Thaks for testing this. In your example ending up in a PANIC I suspect that the PANIC is either from accessing headers or data parameters to the callback which will be nil in case of an error. Do you have a chance to also check the chunked transfer part? |
On Sat, Apr 25, 2020 at 12:29:59PM -0700, Gregor Hartmann wrote:
I was pretty sure I wrote the message I am writing now before. Don't know why
it is shown here.
It has happened to me from time to time to lose comments when posting,
most likely due to errors when sending.
Do you have a chance to also check the chunked transfer part?
Ah I feel ashamed, that's mainly what I wanted to test and simply forgot!
I'll do it.
Willy
|
@wtarreau any news? |
Hi Marcel. Seems like it's the second time I have to tell you I feel ashamed. I knew I had something to do last week-end and didn't remember what, given how long my todo list was and that I forgot to note it :-/ Now I've written it on my todo-list hoping I'll do it this week-end. Sorry again :-/ |
No worries. Don't be too hard on yourself. There are many other developers in our community - including yours truly - who could have tested this as well. |
Hi Marcel, so the test is conclusive, it works. I also verified that prepending zeroes in front of the chunk sizes worked as expected:
I had met an issue with panics when the server is not listening that caused me some gray hair, until I figured that it was my "print(#data)" which used to trigger the panic when data is nil, so everything's OK here in fact :-) Thus for me the patch is both valid and useful, it will be very welcome! |
Thanks Willy! |
Original sources by @anod221
Original sources by @anod221
Fixes #2405.
dev
branch rather than formaster
.Checking the sources that @anod221 gave I created these diffs.
They look ok but I did not have a chance to test them yet.
They also fix an issue with chunked encoding replies which I also have not tested yet.