From 0e8446158325cdae8d627c0b47d58391c3030d72 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Fri, 6 Sep 2024 19:05:39 -0400 Subject: [PATCH] AsyncResponseStream: Use TCP_MSS as default size --- src/ESPAsyncWebServer.h | 2 +- src/WebResponseImpl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ESPAsyncWebServer.h b/src/ESPAsyncWebServer.h index 58aa27df9..20be1cb47 100644 --- a/src/ESPAsyncWebServer.h +++ b/src/ESPAsyncWebServer.h @@ -249,7 +249,7 @@ class AsyncWebServerRequest { AsyncWebServerResponse *beginResponse(Stream &stream, const String& contentType, size_t len, AwsTemplateProcessor callback=nullptr); AsyncWebServerResponse *beginResponse(const String& contentType, size_t len, AwsResponseFiller callback, AwsTemplateProcessor templateCallback=nullptr); AsyncWebServerResponse *beginChunkedResponse(const String& contentType, AwsResponseFiller callback, AwsTemplateProcessor templateCallback=nullptr); - AsyncResponseStream *beginResponseStream(const String& contentType, size_t bufferSize=1460); + AsyncResponseStream *beginResponseStream(const String& contentType, size_t bufferSize=TCP_MSS); AsyncWebServerResponse *beginResponse_P(int code, const String& contentType, const uint8_t * content, size_t len, AwsTemplateProcessor callback=nullptr); AsyncWebServerResponse *beginResponse_P(int code, const String& contentType, PGM_P content, AwsTemplateProcessor callback=nullptr); diff --git a/src/WebResponseImpl.h b/src/WebResponseImpl.h index 48595e18f..a8d8122fe 100644 --- a/src/WebResponseImpl.h +++ b/src/WebResponseImpl.h @@ -125,7 +125,7 @@ class AsyncResponseStream: public AsyncAbstractResponse, public Print { DynamicBufferListPrint _print; size_t _offset; public: - AsyncResponseStream(const String& contentType, size_t bufferSize); + AsyncResponseStream(const String& contentType, size_t bufferSize=TCP_MSS); ~AsyncResponseStream(); bool _sourceValid() const { return (_state < RESPONSE_END); } virtual size_t _fillBuffer(uint8_t *buf, size_t maxLen) override;