aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdash_server.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/dash_server.py b/dash_server.py
index 1b9e1cd..5ed4fd2 100755
--- a/dash_server.py
+++ b/dash_server.py
@@ -143,13 +143,13 @@ class DataStream:
def read(self, chunk):
with self._data_cond:
- while self._eof is False and len(self._data) <= chunk:
+ while self._eof is False and chunk >= len(self._data):
self._data_cond.wait()
- if self._eof:
- return bytes()
+ if chunk < len(self._data):
+ return self._data[chunk]
- return self._data[chunk]
+ return bytes()
class StreamCache: