Skip to content

Commit c49794f

Browse files
authored
Backport timeout fix
1 parent d8249a6 commit c49794f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/WebServer/src/WebServer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ void WebServer::handleClient() {
299299
case HC_WAIT_READ:
300300
// Wait for data from client to become available
301301
if (_currentClient.available()) {
302+
// because HTTP_MAX_SEND_WAIT is expressed in milliseconds,
303+
// it must be divided by 1000
304+
currentClient.setTimeout(HTTP_MAX_SEND_WAIT / 1000);
302305
if (_parseRequest(_currentClient)) {
303-
// because HTTP_MAX_SEND_WAIT is expressed in milliseconds,
304-
// it must be divided by 1000
305-
_currentClient.setTimeout(HTTP_MAX_SEND_WAIT / 1000);
306306
_contentLength = CONTENT_LENGTH_NOT_SET;
307307
_handleRequest();
308308

0 commit comments

Comments
 (0)