Skip to content

Commit 25b2062

Browse files
committed
Changed seconds to miliseconds in other classes relaed + examples
1 parent 38c8ab4 commit 25b2062

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

libraries/HTTPClient/src/HTTPClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ void HTTPClient::setTimeout(uint16_t timeout)
495495
{
496496
_tcpTimeout = timeout;
497497
if(connected()) {
498-
_client->setTimeout((timeout + 500) / 1000);
498+
_client->setTimeout(timeout + 500); /* / 1000 removed, WifiClient setTimeout changed to ms */
499499
}
500500
}
501501

@@ -1151,7 +1151,7 @@ bool HTTPClient::connect(void)
11511151
}
11521152

11531153
// set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil()
1154-
_client->setTimeout((_tcpTimeout + 500) / 1000);
1154+
_client->setTimeout(_tcpTimeout + 500); /* / 1000 removed, WifiClient setTimeout changed to ms */
11551155

11561156
log_d(" connected to %s:%u", _host.c_str(), _port);
11571157

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 / 1000); // timeout argument is defined in seconds for setTimeout
99+
client.setTimeout(12000); // timeout argument is defined in miliseconds 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void WebServer::handleClient() {
312312
if (_parseRequest(_currentClient)) {
313313
// because HTTP_MAX_SEND_WAIT is expressed in milliseconds,
314314
// it must be divided by 1000
315-
_currentClient.setTimeout(HTTP_MAX_SEND_WAIT / 1000);
315+
_currentClient.setTimeout(HTTP_MAX_SEND_WAIT); /* / 1000 removed, WifiClient setTimeout changed to ms */
316316
_contentLength = CONTENT_LENGTH_NOT_SET;
317317
_handleRequest();
318318

0 commit comments

Comments
 (0)