Skip to content

Commit 20dd26b

Browse files
committed
AudioConfig HTTP_CHUNKED_SIZE_MAX_LEN
1 parent 19d470c commit 20dd26b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/AudioConfig.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ typedef WiFiClient WiFiClientSecure;
188188
# define HTTP_MAX_LEN 1024
189189
#endif
190190

191+
// max size of chunked size line
192+
#ifndef HTTP_CHUNKED_SIZE_MAX_LEN
193+
# define HTTP_CHUNKED_SIZE_MAX_LEN 80
194+
#endif
195+
196+
191197
#ifndef USE_RESAMPLE_BUFFER
192198
# define USE_RESAMPLE_BUFFER true
193199
#endif

src/AudioTools/CoreAudio/AudioHttp/HttpChunkReader.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ class HttpChunkReader : public HttpLineReader {
101101
// we read the chunk length which is indicated as hex value
102102
virtual void readChunkLen(Client &client) {
103103
LOGD("HttpChunkReader::readChunkLen");
104-
uint8_t len_str[51];
105-
readlnInternal(client, len_str, 50, false);
104+
uint8_t len_str[HTTP_CHUNKED_SIZE_MAX_LEN+1];
105+
readlnInternal(client, len_str, HTTP_CHUNKED_SIZE_MAX_LEN, false);
106106
LOGD("HttpChunkReader::readChunkLen %s", (const char *)len_str);
107107
open_chunk_len = strtol((char *)len_str, nullptr, 16);
108108

109-
char msg[40];
110-
snprintf(msg,40, "chunk_len: %d", open_chunk_len);
109+
char msg[80];
110+
snprintf(msg, 80, "chunk_len: %d", open_chunk_len);
111111
LOGD("HttpChunkReader::readChunkLen->%s", msg);
112112

113113
if (open_chunk_len == 0) {

0 commit comments

Comments
 (0)