Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 02e5172

Browse files
vicatcume-no-dev
authored andcommitted
Fix Timeout Bug in WebServer (#2938)
1 parent d2816b2 commit 02e5172

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void loop() {
9696
client.setCACert(rootCACertificate);
9797

9898
// Reading data over SSL may be slow, use an adequate timeout
99-
client.setTimeout(12000);
99+
client.setTimeout(12000 / 1000); // timeout argument is defined in seconds for setTimeout
100100

101101
// The line below is optional. It can be used to blink the LED on the board during flashing
102102
// The LED will be on during download of one buffer of data from the network. The LED will

‎libraries/WebServer/src/WebServer.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ void WebServer::handleClient() {
302302
// Wait for data from client to become available
303303
if (_currentClient.available()) {
304304
if (_parseRequest(_currentClient)) {
305-
_currentClient.setTimeout(HTTP_MAX_SEND_WAIT);
305+
// because HTTP_MAX_SEND_WAIT is expressed in milliseconds,
306+
// it must be divided by 1000
307+
_currentClient.setTimeout(HTTP_MAX_SEND_WAIT / 1000);
306308
_contentLength = CONTENT_LENGTH_NOT_SET;
307309
_handleRequest();
308310

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /