Skip to content
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

rename ClientContext::wait_until_sent() to wait_until_acked() #7896

Merged
merged 4 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/WiFiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ bool WiFiClient::flush(unsigned int maxWaitMs)

if (maxWaitMs == 0)
maxWaitMs = WIFICLIENT_MAX_FLUSH_WAIT_MS;
return _client->wait_until_sent(maxWaitMs);
return _client->wait_until_acked(maxWaitMs);
}

bool WiFiClient::stop(unsigned int maxWaitMs)
Expand Down
6 changes: 4 additions & 2 deletions libraries/ESP8266WiFi/src/include/ClientContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class ClientContext
_rx_buf_offset = 0;
}

bool wait_until_sent(int max_wait_ms = WIFICLIENT_MAX_FLUSH_WAIT_MS)
bool wait_until_acked(int max_wait_ms = WIFICLIENT_MAX_FLUSH_WAIT_MS)
{
// https://github.com/esp8266/Arduino/pull/3967#pullrequestreview-83451496
// option 1 done
Expand Down Expand Up @@ -352,6 +352,8 @@ class ClientContext
delay(0); // from sys or os context

if ((state() != ESTABLISHED) || (sndbuf == TCP_SND_BUF)) {
// peer has closed or all bytes are sent and acked
// ((TCP_SND_BUF-sndbuf) is the amount of un-acked bytes)
break;
}
}
Expand Down Expand Up @@ -508,7 +510,7 @@ class ClientContext
} while(true);

if (_sync)
wait_until_sent();
wait_until_acked();

return _written;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/host/common/include/ClientContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class ClientContext
mockverbose("TODO: ClientContext::discard_received()\n");
}

bool wait_until_sent(int max_wait_ms = WIFICLIENT_MAX_FLUSH_WAIT_MS)
bool wait_until_acked(int max_wait_ms = WIFICLIENT_MAX_FLUSH_WAIT_MS)
{
(void)max_wait_ms;
return true;
Expand Down