Skip to content

Commit 0480205

Browse files
committed
Web server: disconnect at the end of callback, not after sendContent (esp8266#304)
1 parent 84c8605 commit 0480205

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hardware/esp8266com/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,6 @@ void ESP8266WebServer::sendContent(String content) {
172172
break;
173173
}
174174
}
175-
uint16_t maxWait = HTTP_MAX_CLOSE_WAIT;
176-
while(_currentClient.connected() && maxWait--) {
177-
delay(1);
178-
}
179175
}
180176

181177
String ESP8266WebServer::arg(const char* name) {
@@ -245,6 +241,10 @@ void ESP8266WebServer::_handleRequest() {
245241
}
246242
}
247243

244+
uint16_t maxWait = HTTP_MAX_CLOSE_WAIT;
245+
while(_currentClient.connected() && maxWait--) {
246+
delay(1);
247+
}
248248
_currentClient = WiFiClient();
249249
_currentUri = String();
250250
}

0 commit comments

Comments
 (0)