-
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
Bugfix/esp8266 http client #6457
Conversation
…ponded with '204 no data' and destroy client in ::disconnect(false) even if NOT connected
Last commit fixes style check Travis build error. Other Travis failed tests are not caused by my PR |
@d-a-v Have you got any idea why the Travis build is failing? |
Arduino IDE nightly just changed, breaking our builds. We're looking into it. |
@earlephilhower Thnx for your reaction Earle! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mklittlefs.exe is back in the PR, somehow.
@earlephilhower I do not know where it comes from, but I will try to get it out. Could you have a look at this question:
|
@earlephilhower please help with git: now I got rid of mklittlefs but got lwip2/builder instead... |
You're in git hell, I think. I'd roil back commits to before you did a push containing lwip and try again. git reset --hard 85d836b # Go back to GH merge a while back |
Close because of git problems. Created a new PR #6476 |
* Because of git problems, start from a new fork and create a new PR. This was PR #6457 * Style update to pass Travis * Update ReuseConnectionV2.ino * fix + enforce testing http code per @earlephilhower review * Close connection before ::connecting on HTTP/1.0 HTTPClient never actually closes the TCP connection on its own. It will leave the TCP connection open unless you explicitly do a getString which makes a StreamString and stuffs it with the HTTP server response, at which point the HTTP server itself will close the connection. If you check the HTTP error code and find failure, unless you do a getString and throw it away, it won't disconnect. Even in HTTP/1.0 or in cases when you haven't enabled _reuse. Change the logic in ::connect to only reuse the connection when it is specifically allowed. Otherwise, fall back to re-connection. * Adjust example per request Do single URL get in each loop, avoid infinite for loop at end. * Fix astyle * Clean up final pass notice * Fix example syntax error Editing code in a web textbox without running it is a painful process. Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
See PR #6176, this PR was merged while there was still an issue to solve.
With this PR:
This behavior of this example is tested with both a WiFiClient and a (BearSSL) WiFiClientSecure. The lost connection was simulated with switching off the router and switching it on again, and with stopping my HTTP(S) server and restarting it. In the first case a connection refused was reported, in the second case a connection lost. Switching the router back on or restarting the server caused the program to resume showing the ::GET() payload as expected.