Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WebServer: Use client() instead of _currentClient #11945

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

Draft
hurricanefrog wants to merge 1 commit into espressif:master
base: master
Choose a base branch
Loading
from hurricanefrog:issue/11944-derivable-webserver
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
View file Open in desktop
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
View file Open in desktop
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

AltStyle によって変換されたページ (->オリジナル) /