提交 02e51728 编写于 作者: V Victor Aprea 提交者: Me No Dev

Fix Timeout Bug in WebServer (#2938)

上级 d2816b2f
......@@ -96,7 +96,7 @@ void loop() {
client.setCACert(rootCACertificate);
// Reading data over SSL may be slow, use an adequate timeout
client.setTimeout(12000);
client.setTimeout(12000 / 1000); // timeout argument is defined in seconds for setTimeout
// The line below is optional. It can be used to blink the LED on the board during flashing
// The LED will be on during download of one buffer of data from the network. The LED will
......
......@@ -302,7 +302,9 @@ void WebServer::handleClient() {
// Wait for data from client to become available
if (_currentClient.available()) {
if (_parseRequest(_currentClient)) {
_currentClient.setTimeout(HTTP_MAX_SEND_WAIT);
// because HTTP_MAX_SEND_WAIT is expressed in milliseconds,
// it must be divided by 1000
_currentClient.setTimeout(HTTP_MAX_SEND_WAIT / 1000);
_contentLength = CONTENT_LENGTH_NOT_SET;
_handleRequest();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册