1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

Web server: disconnect at the end of callback, not after sendContent (#304)

This commit is contained in:
Ivan Grokhotkov 2015-05-22 16:19:08 +03:00
parent e562124eaf
commit 21d50e104c

View File

@ -172,10 +172,6 @@ void ESP8266WebServer::sendContent(String content) {
break;
}
}
uint16_t maxWait = HTTP_MAX_CLOSE_WAIT;
while(_currentClient.connected() && maxWait--) {
delay(1);
}
}
String ESP8266WebServer::arg(const char* name) {
@ -245,6 +241,10 @@ void ESP8266WebServer::_handleRequest() {
}
}
uint16_t maxWait = HTTP_MAX_CLOSE_WAIT;
while(_currentClient.connected() && maxWait--) {
delay(1);
}
_currentClient = WiFiClient();
_currentUri = String();
}