mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
Fix a hang in the send kitten when transmitting deltas of multiple files
and the files have not changed causing the signature of the second file to arrive after the delta for the first file is transmitted
This commit is contained in:
@@ -834,6 +834,8 @@ func (self *SendHandler) on_file_transfer_response(ftc *FileTransmissionCommand)
|
|||||||
}
|
}
|
||||||
if self.manager.all_acknowledged {
|
if self.manager.all_acknowledged {
|
||||||
self.transfer_finished()
|
self.transfer_finished()
|
||||||
|
} else if ftc.Action == Action_end_data && ftc.File_id != "" {
|
||||||
|
return self.transmit_next_chunk()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -1010,16 +1012,22 @@ func (self *SendManager) next_chunks(callback func(string) loop.IdType) error {
|
|||||||
|
|
||||||
func (self *SendHandler) transmit_next_chunk() (err error) {
|
func (self *SendHandler) transmit_next_chunk() (err error) {
|
||||||
found_chunk := false
|
found_chunk := false
|
||||||
err = self.manager.next_chunks(func(chunk string) loop.IdType {
|
for !found_chunk {
|
||||||
found_chunk = true
|
if err = self.manager.next_chunks(func(chunk string) loop.IdType {
|
||||||
return self.send_payload(chunk)
|
found_chunk = true
|
||||||
})
|
return self.send_payload(chunk)
|
||||||
if err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !found_chunk {
|
if !found_chunk {
|
||||||
if self.manager.all_acknowledged {
|
if self.manager.all_acknowledged {
|
||||||
self.transfer_finished()
|
self.transfer_finished()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
self.manager.update_collective_statuses()
|
||||||
|
if !self.manager.has_transmitting {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user