mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-29 05:21:37 +03:00
make http-server less verbose in debug mode (#8850)
* make http-server less verbose in debug mode
This commit is contained in:
@ -296,12 +296,35 @@ void ESP8266WebServerTemplate<ServerType>::handleClient() {
|
|||||||
bool keepCurrentClient = false;
|
bool keepCurrentClient = false;
|
||||||
bool callYield = false;
|
bool callYield = false;
|
||||||
|
|
||||||
DBGWS("http-server loop: conn=%d avail=%d status=%s\n",
|
#ifdef DEBUG_ESP_HTTP_SERVER
|
||||||
_currentClient.connected(), _currentClient.available(),
|
|
||||||
_currentStatus==HC_NONE?"none":
|
struct compare_s
|
||||||
_currentStatus==HC_WAIT_READ?"wait-read":
|
{
|
||||||
_currentStatus==HC_WAIT_CLOSE?"wait-close":
|
uint8_t connected;
|
||||||
"??");
|
int available;
|
||||||
|
HTTPClientStatus status;
|
||||||
|
bool operator != (const compare_s& o)
|
||||||
|
{
|
||||||
|
return o.connected != connected
|
||||||
|
|| o.available != available
|
||||||
|
|| o.status != status;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
static compare_s last { false, 0, HC_NONE };
|
||||||
|
compare_s now { _currentClient.connected(), _currentClient.available(), _currentStatus };
|
||||||
|
|
||||||
|
if (last != now)
|
||||||
|
{
|
||||||
|
DBGWS("http-server loop: conn=%d avail=%d status=%s\n",
|
||||||
|
_currentClient.connected(), _currentClient.available(),
|
||||||
|
_currentStatus==HC_NONE?"none":
|
||||||
|
_currentStatus==HC_WAIT_READ?"wait-read":
|
||||||
|
_currentStatus==HC_WAIT_CLOSE?"wait-close":
|
||||||
|
"??");
|
||||||
|
last = now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // DEBUG_ESP_HTTP_SERVER
|
||||||
|
|
||||||
if (_currentClient.connected() || _currentClient.available()) {
|
if (_currentClient.connected() || _currentClient.available()) {
|
||||||
if (_currentClient.available() && _keepAlive) {
|
if (_currentClient.available() && _keepAlive) {
|
||||||
|
Reference in New Issue
Block a user