Skip to content

Remove deadlock when server is not acking our data #6107

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 7 commits into from
May 19, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
4 changes: 4 additions & 0 deletions libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ void WiFiClientSecure::_freeSSL() {
_recvapp_len = 0;
// This connection is toast
_handshake_done = false;
_timeout = 15000;
}

bool WiFiClientSecure::_clientConnected() {
Expand Down Expand Up @@ -1009,6 +1010,9 @@ bool WiFiClientSecure::_connectSSL(const char* hostName) {
_x509_insecure = nullptr;
_x509_knownkey = nullptr;

// reduce timeout after successful handshake to fail fast if server stop accepting our data for whathever reason
if (ret) _timeout = 5000;

return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/include/ClientContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class ClientContext
}

_send_waiting = true;
esp_yield();
delay(_timeout_ms);
} while(true);
_send_waiting = false;

Expand Down