maintenance mode (http keep-alive)

This commit is contained in:
cyberman54 2021-03-07 19:07:10 +01:00
parent 1061ff2fd2
commit 0f945433f8

View File

@ -120,14 +120,14 @@ void start_boot_menu(void) {
// send start button page // send start button page
server.on("/", HTTP_GET, [&server, &loginMenu]() { server.on("/", HTTP_GET, [&server, &loginMenu]() {
server.sendHeader("Connection", "close"); server.sendHeader("Connection", "keep-alive");
server.send(200, "text/html", loginMenu); server.send(200, "text/html", loginMenu);
}); });
// send upload button page // send upload button page
server.on("/serverIndex", HTTP_GET, [&server, &serverIndex, &timer]() { server.on("/serverIndex", HTTP_GET, [&server, &serverIndex, &timer]() {
timerAlarmWrite(timer, BOOTTIMEOUT * 1000000, false); timerAlarmWrite(timer, BOOTTIMEOUT * 1000000, false);
server.sendHeader("Connection", "close"); server.sendHeader("Connection", "keep-alive");
server.send(200, "text/html", serverIndex); server.send(200, "text/html", serverIndex);
}); });
@ -137,7 +137,6 @@ void start_boot_menu(void) {
[&server]() { [&server]() {
server.sendHeader("Connection", "close"); server.sendHeader("Connection", "close");
server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK"); server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
delay(5000);
WiFi.disconnect(true); WiFi.disconnect(true);
if (!Update.hasError()) if (!Update.hasError())
RTC_runmode = RUNMODE_POWERCYCLE; RTC_runmode = RUNMODE_POWERCYCLE;