Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bugfix for stuck in write method of WiFiClient and WiFiClientSecure until the remote peer closed connection #6104

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 2 commits into from
May 16, 2019
Merged
Changes from all 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
12 changes: 6 additions & 6 deletions libraries/ESP8266WiFi/src/include/ClientContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class ClientContext
size_t _write_from_source(DataSource* ds)
{
assert(_datasource == nullptr);
assert(_send_waiting == 0);
assert(!_send_waiting);
_datasource = ds;
_written = 0;
_op_start_time = millis();
Expand All @@ -455,10 +455,10 @@ class ClientContext
break;
}

++_send_waiting;
_send_waiting = true;
esp_yield();
} while(true);
_send_waiting = 0;
_send_waiting = false;

if (_sync)
wait_until_sent();
Expand Down Expand Up @@ -525,8 +525,8 @@ class ClientContext

void _write_some_from_cb()
{
if (_send_waiting == 1) {
_send_waiting--;
if (_send_waiting) {
_send_waiting = false;
esp_schedule();
}
}
Expand Down Expand Up @@ -650,7 +650,7 @@ class ClientContext
size_t _written = 0;
uint32_t _timeout_ms = 5000;
uint32_t _op_start_time = 0;
uint8_t _send_waiting = 0;
bool _send_waiting = false;
uint8_t _connect_pending = 0;

int8_t _refcnt;
Expand Down