-
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
REGRESSION in 3.1.0: http download gets stuck after headers, as if not getting data #9035
Comments
I tested on several versions. It broke somewhere between:
|
This might be #8237, can you try and change size_t avl = wificlient.available();
gotbytes = wificlient.readBytes(httpbuf, ((avl>sizeof(httpbuf))?sizeof(httpbuf):avl)); to size_t avl = http.getStream().available();
gotbytes = http.getStream().readBytes(httpbuf, ((avl>sizeof(httpbuf))?sizeof(httpbuf):avl)); |
Right, clone() copies client ctx but does not share it. Have to remove its self-deletion first (see |
Indeed, the workaround works. Also this works:
but only as long as I had actually tried some variation of this (without knowing why, but suspecting that |
You can also try with this
|
I've tried the workaround with But it's 100x time slower to download!! The workaround is backward compatible, but it's still fast on 3.0.2. |
Basic Infos
Platform
Settings in IDE
Problem Description
In 2019 I wrote a sketch that downloads text from a url using HTTPClient. I uploaded it to a few boards and it has been working flawlessly, and still is.
Now I updated Arduino and the ESP8266 core to the latest version, re-compiled my code (I needed to change a call to
HTTPClient::begin()
because of BC-breaking changes in the API) and uploaded it to one of the boards), and now the download systematically gets stuck after downloading the http headers, waiting forever for the next bytes to become available.The hardware is the same, the network is the same, the server I'm downloading from is the same, my code hasn't changed one bit (except again for the
HTTPClient::begin()
call). Literally the only thing that has changed is I switched to the latest version of Arduino IDE, the core and the libraries.Code that used to work (that was well tested and has been working without issue for 4 years on a dozen of devices on different wifi networks) is now broken after the update.
Unfortunately I hadn't updated the libraries in the last 4 years, so I don't know when in the last 4 years the bug appeared.
I'm sorry I don't have the time to create a minimal but full working example, and I cannot share the full code because it's too complex. I'll share the part of the code that does the http download.
MCVE Sketch
Debug Messages
The output from the code above is:
The text was updated successfully, but these errors were encountered: