Skip to content

Commit

Permalink
Merge branch 'master' into release/v3.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev authored Dec 14, 2024
2 parents 8e59a1b + 64b62dc commit 3c3ff48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 8 additions & 6 deletions cores/esp32/esp32-hal-time.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ static void setTimeZone(long offset, int daylight) {
void configTime(long gmtOffset_sec, int daylightOffset_sec, const char *server1, const char *server2, const char *server3) {
//tcpip_adapter_init(); // Should not hurt anything if already inited
esp_netif_init();
if (sntp_enabled()) {
sntp_stop();
}

#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
LOCK_TCPIP_CORE();
}
#endif

if (sntp_enabled()) {
sntp_stop();
}

sntp_setoperatingmode(SNTP_OPMODE_POLL);
sntp_setservername(0, (char *)server1);
sntp_setservername(1, (char *)server2);
Expand All @@ -83,16 +84,17 @@ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char *server1,
void configTzTime(const char *tz, const char *server1, const char *server2, const char *server3) {
//tcpip_adapter_init(); // Should not hurt anything if already inited
esp_netif_init();
if (sntp_enabled()) {
sntp_stop();
}

#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
LOCK_TCPIP_CORE();
}
#endif

if (sntp_enabled()) {
sntp_stop();
}

sntp_setoperatingmode(SNTP_OPMODE_POLL);
sntp_setservername(0, (char *)server1);
sntp_setservername(1, (char *)server2);
Expand Down
3 changes: 2 additions & 1 deletion libraries/WebServer/src/Parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ bool WebServer::_parseRequest(NetworkClient &client) {
_currentRaw->status = RAW_WRITE;

while (_currentRaw->totalSize < _clientContentLength) {
_currentRaw->currentSize = client.readBytes(_currentRaw->buf, HTTP_RAW_BUFLEN);
size_t read_len = std::min(_clientContentLength - _currentRaw->totalSize, (size_t)HTTP_RAW_BUFLEN);
_currentRaw->currentSize = client.readBytes(_currentRaw->buf, read_len);
_currentRaw->totalSize += _currentRaw->currentSize;
if (_currentRaw->currentSize == 0) {
_currentRaw->status = RAW_ABORTED;
Expand Down

0 comments on commit 3c3ff48

Please sign in to comment.