Skip to content
Draft
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
8 changes: 4 additions & 4 deletions libraries/WebServer/src/WebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ void WebServer::chunkResponseBegin(const char *contentType) {
}

_chunkedResponseActive = true;
_chunkedClient = _currentClient;
_chunkedClient = client();

_contentLength = CONTENT_LENGTH_UNKNOWN;

Expand All @@ -574,7 +574,7 @@ void WebServer::chunkResponseBegin(const char *contentType) {
_currentClientWrite(header.c_str(), header.length());

_chunkedResponseActive = true;
_chunkedClient = _currentClient;
_chunkedClient = client();
}

void WebServer::chunkWrite(const char *data, size_t length) {
Expand Down Expand Up @@ -734,7 +734,7 @@ void WebServer::sendContent(const char *content, size_t contentLength) {
}
_currentClientWrite(content, contentLength);
if (_chunked) {
_currentClient.write(footer, 2);
client().write(footer, 2);
if (contentLength == 0) {
_chunked = false;
}
Expand All @@ -757,7 +757,7 @@ void WebServer::sendContent_P(PGM_P content, size_t size) {
}
_currentClientWrite_P(content, size);
if (_chunked) {
_currentClient.write(footer, 2);
client().write(footer, 2);
if (size == 0) {
_chunked = false;
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/WebServer/src/WebServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class WebServer {

template<typename T> size_t streamFile(T &file, const String &contentType, const int code = 200) {
_streamFileCore(file.size(), file.name(), contentType, code);
return _currentClient.write(file);
return client().write(file);
}

bool _eTagEnabled = false;
Expand All @@ -251,10 +251,10 @@ class WebServer {

protected:
virtual size_t _currentClientWrite(const char *b, size_t l) {
return _currentClient.write(b, l);
return client().write(b, l);
}
virtual size_t _currentClientWrite_P(PGM_P b, size_t l) {
return _currentClient.write_P(b, l);
return client().write_P(b, l);
}
void _addRequestHandler(RequestHandler *handler);
bool _removeRequestHandler(RequestHandler *handler);
Expand Down
Loading