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

Appearance settings

Commit d7cd4be

Browse filesBrowse files
authored
make http-server less verbose in debug mode (esp8266#8850)
* make http-server less verbose in debug mode
1 parent 9a3d55c commit d7cd4be
Copy full SHA for d7cd4be

File tree

Expand file treeCollapse file tree

1 file changed

+29
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+29
-6
lines changed

‎libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h

Copy file name to clipboardExpand all lines: libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h
+29-6Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,35 @@ void ESP8266WebServerTemplate<ServerType>::handleClient() {
296296
bool keepCurrentClient = false;
297297
bool callYield = false;
298298

299-
DBGWS("http-server loop: conn=%d avail=%d status=%s\n",
300-
_currentClient.connected(), _currentClient.available(),
301-
_currentStatus==HC_NONE?"none":
302-
_currentStatus==HC_WAIT_READ?"wait-read":
303-
_currentStatus==HC_WAIT_CLOSE?"wait-close":
304-
"??");
299+
#ifdef DEBUG_ESP_HTTP_SERVER
300+
301+
struct compare_s
302+
{
303+
uint8_t connected;
304+
int available;
305+
HTTPClientStatus status;
306+
bool operator != (const compare_s& o)
307+
{
308+
return o.connected != connected
309+
|| o.available != available
310+
|| o.status != status;
311+
}
312+
};
313+
static compare_s last { false, 0, HC_NONE };
314+
compare_s now { _currentClient.connected(), _currentClient.available(), _currentStatus };
315+
316+
if (last != now)
317+
{
318+
DBGWS("http-server loop: conn=%d avail=%d status=%s\n",
319+
_currentClient.connected(), _currentClient.available(),
320+
_currentStatus==HC_NONE?"none":
321+
_currentStatus==HC_WAIT_READ?"wait-read":
322+
_currentStatus==HC_WAIT_CLOSE?"wait-close":
323+
"??");
324+
last = now;
325+
}
326+
327+
#endif // DEBUG_ESP_HTTP_SERVER
305328

306329
if (_currentClient.connected() || _currentClient.available()) {
307330
if (_currentClient.available() && _keepAlive) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.