Forgot to end receive sessions

This commit is contained in:
Kovid Goyal 2021-11-18 22:31:05 +05:30
parent 646726b385
commit ddb1fcf430
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 1 deletions

View file

@ -244,6 +244,10 @@ def __init__(
self.transfer_done = False
self.use_rsync = use_rsync
@property
def finish_code(self) -> str:
return FileTransmissionCommand(action=Action.finish).serialize()
def start_transfer(self) -> Iterator[str]:
yield FileTransmissionCommand(action=Action.receive, bypass=self.bypass, size=len(self.spec)).serialize()
for i, x in enumerate(self.spec):
@ -438,6 +442,7 @@ def on_file_transfer_response(self, ftc: FileTransmissionCommand) -> None:
else:
self.start_transfer()
if self.manager.transfer_done:
self.send_payload(self.manager.finish_code)
self.quit_after_write_code = 0
self.refresh_progress()
elif self.transmit_started:

View file

@ -815,7 +815,7 @@ def handle_send_cmd(self, cmd: FileTransmissionCommand) -> None:
self.send_transmission_error(asd.id, err)
else:
self.pump_send_chunks(asd)
elif cmd.action is Action.status:
elif cmd.action in (Action.status, Action.finish):
self.drop_send(asd.id)
return
if not asd.accepted: