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 {
6161 // / same as end()
6262 void end () override {
6363 if (connected ()) {
64+ // write final 0 chunk if necessary
65+ if (is_chunked_output_active) client_ptr->println (0 , HEX);
66+ client_ptr->flush ();
6467 LOGI (" stop" );
6568 client_ptr->stop ();
6669 }
@@ -284,6 +287,7 @@ class HttpRequest : public BaseStream {
284287 size_t result = 0 ;
285288 if (isChunked ()) {
286289 if (len > 0 ) {
290+ is_chunked_output_active = true ;
287291 client_ptr->println (len, HEX);
288292 result = client_ptr->write (data, len);
289293 client_ptr->println ();
@@ -343,6 +347,7 @@ class HttpRequest : public BaseStream {
343347 int32_t clientTimeout = URL_CLIENT_TIMEOUT; // 60000;
344348 void (*http_connect_callback)(HttpRequest &request, Url &url,
345349 HttpRequestHeader &request_header) = nullptr ;
350+ bool is_chunked_output_active = false ;
346351
347352 // opens a connection to the indicated host
348353 virtual int connect (const char *ip, uint16_t port, int32_t timeout) {
You can’t perform that action at this time.
0 commit comments