1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

fixes for WiFiClient::write(Stream) (#7987)

fixes for WiFiClient::write(Stream) and Stream transfers
- remove deprecated WiFiClient::write(Stream,size)
- fix and deprecate WiFiClient::write(Stream) to use Stream::sendAll instead of ::sendAvailable
- update ESP8266WebServer::streamFile to use file.sendAll(client) instead of client.write(file)
- remove stream dependence in ClientContext
- Stream::send(): honor timeout in all case, avoid short transfer when output is temporarily full
- example WiFiEcho: show sendAll and sendAvailable
This commit is contained in:
david gauchard
2021-04-27 16:02:19 +02:00
committed by GitHub
parent 457692101a
commit f4178e58dc
7 changed files with 46 additions and 91 deletions

View File

@ -226,7 +226,7 @@ public:
size_t contentLength = 0;
_streamFileCore(file.size(), file.name(), contentType);
if (requestMethod == HTTP_GET) {
contentLength = _currentClient.write(file);
contentLength = file.sendAll(_currentClient);
}
return contentLength;
}