summaryrefslogtreecommitdiff
path: root/kvmd/plugins
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-08-06 03:20:27 +0300
committerMaxim Devaev <[email protected]>2022-08-06 03:20:27 +0300
commitd995349b6311bf06b77ac0e8ccc4a424112feeb0 (patch)
tree58b77c56f81b89917edb3b23bf32e9028336b4e3 /kvmd/plugins
parent2535dce7b88855204a6167b9bcbf19ec413700bc (diff)
compressed mode for /api/msd/read
Diffstat (limited to 'kvmd/plugins')
-rw-r--r--kvmd/plugins/msd/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/kvmd/plugins/msd/__init__.py b/kvmd/plugins/msd/__init__.py
index e5bf2ab1..753a1cd0 100644
--- a/kvmd/plugins/msd/__init__.py
+++ b/kvmd/plugins/msd/__init__.py
@@ -111,6 +111,9 @@ class BaseMsdReader:
def get_total_size(self) -> int:
raise NotImplementedError()
+ def get_chunk_size(self) -> int:
+ raise NotImplementedError()
+
async def read_chunked(self) -> AsyncGenerator[bytes, None]:
if self is not None: # XXX: Vulture and pylint hack
raise NotImplementedError()
@@ -200,6 +203,9 @@ class MsdFileReader(BaseMsdReader): # pylint: disable=too-many-instance-attribu
assert self.__file is not None
return self.__file_size
+ def get_chunk_size(self) -> int:
+ return self.__chunk_size
+
async def read_chunked(self) -> AsyncGenerator[bytes, None]:
assert self.__file is not None
while True: