-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
streamFile does only send first 64 bytes #7982
Comments
That is a bug from me when converting
return stream.sendAll(this); I successfully tested this fix with a random local snippet I have with which I could reproduce the bug you found. |
@d-a-v I asked @clumsy-stefan to test it, who deserves all the credits for finding the commit causing this. |
I can confirm a ESPEasy build with latest GIT commit from esp8266 core and above mentioned line changed makes it work again! |
So the biggest delay in fixing/testing it was sleeping time? ;) |
By the way, even though it is a fix for this problem, I am not 100% sure it is the correct fix. Arduino/libraries/ESP8266WiFi/src/WiFiClient.cpp Lines 226 to 238 in 209e467
This is a stream write, so it does not make sense to write all in there. |
This is what core v2.7.4 does.
This is what
That's possible.
This kind of loop have been replaced in the core by the API There are several possibilities
I think ii. a. is the best bet. edit: ii. a. + deprecation of |
Just now the problem occurred again. If downloading a larger file (more than about 900 Bytes) it stops at 880Bytes. |
@clumsy-stefan I must thank you for testing and reporting. I could reproduce and fix in #7987 . Can you retry with #7987 which has just been updated ? |
Did a new version and some quick checks with #7987 included. So far it seems to work (with ESPEasy). I can download all files again correctly (tested up to 65kB) Thanks again for the quick fix, really appreciated!! |
Basic Infos
Platform
Problem Description
Starting from this commit, the
streamFile
in ESP8266WebServer does only send the first 64 bytes.See also the findings reported here: letscontrolit/ESPEasy#3561 (comment)
It is sent in my code in this part:
https://github.com/letscontrolit/ESPEasy/blob/e4bd63aff4be231f957b9c910fcc17343e8e91f8/src/src/WebServer/LoadFromFS.cpp#L63-L85
Which does resemble quite a bit how it is described in the examples like this one:
Arduino/libraries/ESP8266WebServer/examples/Graph/Graph.ino
Line 125 in da6ec83
Am I missing something here?
Should I include extra headers, or loop over it to serve what is left?
The text was updated successfully, but these errors were encountered: