Skip to content

Commit 747b636

Browse files
committed
WebServer: Keep the connection alive with a client by default
1 parent 474af1a commit 747b636

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ void ESP8266WebServerTemplate<ServerType>::handleClient() {
320320
_currentClient = client;
321321
_currentStatus = HC_WAIT_READ;
322322
_statusChange = millis();
323+
_keepAlive = true;
323324
}
324325

325326
bool keepCurrentClient = false;
@@ -367,7 +368,6 @@ void ESP8266WebServerTemplate<ServerType>::handleClient() {
367368
if (!keepCurrentClient) {
368369
_currentClient = ClientType();
369370
_currentStatus = HC_NONE;
370-
_keepAlive = false;
371371
_currentUpload.reset();
372372
}
373373

@@ -380,7 +380,6 @@ template <typename ServerType>
380380
void ESP8266WebServerTemplate<ServerType>::close() {
381381
_server.close();
382382
_currentStatus = HC_NONE;
383-
_keepAlive = false;
384383
if(!_headerKeysCount)
385384
collectHeaders(0, 0);
386385
}

0 commit comments

Comments
 (0)