File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/AudioTools/CoreAudio/AudioHttp Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ class HttpRequest : public BaseStream {
61
61
// / same as end()
62
62
void end () override {
63
63
if (connected ()) {
64
+ // write final 0 chunk if necessary
65
+ if (is_chunked_output_active) client_ptr->println (0 , HEX);
66
+ client_ptr->flush ();
64
67
LOGI (" stop" );
65
68
client_ptr->stop ();
66
69
}
@@ -284,6 +287,7 @@ class HttpRequest : public BaseStream {
284
287
size_t result = 0 ;
285
288
if (isChunked ()) {
286
289
if (len > 0 ) {
290
+ is_chunked_output_active = true ;
287
291
client_ptr->println (len, HEX);
288
292
result = client_ptr->write (data, len);
289
293
client_ptr->println ();
@@ -343,6 +347,7 @@ class HttpRequest : public BaseStream {
343
347
int32_t clientTimeout = URL_CLIENT_TIMEOUT; // 60000;
344
348
void (*http_connect_callback)(HttpRequest &request, Url &url,
345
349
HttpRequestHeader &request_header) = nullptr ;
350
+ bool is_chunked_output_active = false ;
346
351
347
352
// opens a connection to the indicated host
348
353
virtual int connect (const char *ip, uint16_t port, int32_t timeout) {
You can’t perform that action at this time.
0 commit comments