Skip to content

Commit 8774a00

Browse files
committed
Fix: AsyncResponseStream could cause a 1 sec delay...
...and eventually trigger the watchdog in case maxLen is greater than the remaining bytes in the buffer, read with readBytes
1 parent 25845e7 commit 8774a00

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/WebResponses.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@ AsyncResponseStream::AsyncResponseStream(const char *contentType, size_t bufferS
820820
_code = 200;
821821
_contentLength = 0;
822822
_contentType = contentType;
823+
_content.setTimeout(0); // because readBytes() includes a timed read which waits for data for 1 sec by default if length > data in buffer
823824
if (!_content.reserve(bufferSize)) {
824825
#ifdef ESP32
825826
log_e("Failed to allocate");

0 commit comments

Comments
 (0)