8000 Fix WiFiClientSecure::available() blocking on dropped connections by johnm545 · Pull Request #6449 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Fix WiFiClientSecure::available() blocking on dropped connections #6449

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

Merged
merged 13 commits into from
Sep 17, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add timeout to _run_until loop
fixes #6464
  • Loading branch information
johnm545 committed Aug 31, 2019
commit 2cc92dab629b330fa1a5fab6c6dff20b59a1ff66
7 changes: 7 additions & 0 deletions libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,16 @@ int WiFiClientSecure::_run_until(unsigned target, bool blocking) {
DEBUG_BSSL("_run_until: Not connected\n");
return -1;
}

unsigned long startMillis = millis();
for (int no_work = 0; blocking || no_work < 2;) {
optimistic_yield(100);

if (millis() - startMillis > 30000) {
DEBUG_BSSL("_run_until: Timeout\n");
return -1;
}

int state;
state = br_ssl_engine_current_state(_eng);
if (state & BR_SSL_CLOSED) {
Expand Down
0