Skip to content

Commit 2719b4e

Browse files
authored
Merge branch 'master' into release/v3.0.x
2 parents 165fa0f + 64b62dc commit 2719b4e

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Diff for: cores/esp32/esp32-hal-time.c

+8-6
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,17 @@ static void setTimeZone(long offset, int daylight) {
5151
void configTime(long gmtOffset_sec, int daylightOffset_sec, const char *server1, const char *server2, const char *server3) {
5252
//tcpip_adapter_init(); // Should not hurt anything if already inited
5353
esp_netif_init();
54-
if (sntp_enabled()) {
55-
sntp_stop();
56-
}
5754

5855
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
5956
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
6057
LOCK_TCPIP_CORE();
6158
}
6259
#endif
6360

61+
if (sntp_enabled()) {
62+
sntp_stop();
63+
}
64+
6465
sntp_setoperatingmode(SNTP_OPMODE_POLL);
6566
sntp_setservername(0, (char *)server1);
6667
sntp_setservername(1, (char *)server2);
@@ -83,16 +84,17 @@ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char *server1,
8384
void configTzTime(const char *tz, const char *server1, const char *server2, const char *server3) {
8485
//tcpip_adapter_init(); // Should not hurt anything if already inited
8586
esp_netif_init();
86-
if (sntp_enabled()) {
87-
sntp_stop();
88-
}
8987

9088
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
9189
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
9290
LOCK_TCPIP_CORE();
9391
}
9492
#endif
9593

94+
if (sntp_enabled()) {
95+
sntp_stop();
96+
}
97+
9698
sntp_setoperatingmode(SNTP_OPMODE_POLL);
9799
sntp_setservername(0, (char *)server1);
98100
sntp_setservername(1, (char *)server2);

Diff for: libraries/WebServer/src/Parsing.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ bool WebServer::_parseRequest(NetworkClient &client) {
187187
_currentRaw->status = RAW_WRITE;
188188

189189
while (_currentRaw->totalSize < _clientContentLength) {
190-
_currentRaw->currentSize = client.readBytes(_currentRaw->buf, HTTP_RAW_BUFLEN);
190+
size_t read_len = std::min(_clientContentLength - _currentRaw->totalSize, (size_t)HTTP_RAW_BUFLEN);
191+
_currentRaw->currentSize = client.readBytes(_currentRaw->buf, read_len);
191192
_currentRaw->totalSize += _currentRaw->currentSize;
192193
if (_currentRaw->currentSize == 0) {
193194
_currentRaw->status = RAW_ABORTED;

0 commit comments

Comments
 (0)