Send a started response after each dest file is registered

This commit is contained in:
Kovid Goyal
2021-09-08 09:59:45 +05:30
parent af5c0b3b71
commit 745e97e0ab
2 changed files with 11 additions and 6 deletions
+4 -1
View File
@@ -58,7 +58,7 @@ class TransmissionType(NameReprEnum):
rsync = auto()
ErrorCode = Enum('ErrorCode', 'OK EINVAL EPERM EISDIR')
ErrorCode = Enum('ErrorCode', 'OK STARTED EINVAL EPERM EISDIR')
class TransmissionError(Exception):
@@ -437,6 +437,9 @@ class FileTransmission:
self.send_fail_on_os_error(err, 'Failed to create directory', ar, df.file_id)
else:
self.send_status_response(ErrorCode.OK, ar.id, df.file_id, name=df.name)
else:
if ar.send_acknowledgements:
self.send_status_response(code=ErrorCode.STARTED, request_id=ar.id, file_id=df.file_id, name=df.name)
elif cmd.action in (Action.data, Action.end_data):
try:
df = ar.add_data(cmd)