Add timeout and HTTP size to streamer EOF checks
HTTPStreamer assumed the server would drop the connection when no more data was available to be transferred from the source file. For individual files, though, the web server will send the expected length in the headers and leave the connection open (i.e. to recycle the connection and accelerate web browsing). In this case, the streamer would effectively hang waiting for more data than was being transmitted. Now check the read data against the expected data, and also add a 0.5s timeout no matter what to the reading. Tested on streaming and served files, seems to work fine.
This commit is contained in:
1 parent
2dac08ef4e
commit
c5da8c3062
2 files changed
+11
-3
No files matched your search
@@ -43,7 +43,8 @@ class AudioFileSourceHTTPStream : public AudioFileSource
|
||||
|
||||
private:
|
||||
HTTPClient http;
|
||||
uint32_t pos;
|
||||
int pos;
|
||||
int size;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user