taildrop: remove breaking abstraction layers for apple (#10728)

Removes the avoidFinalRename logic and all associated code as it is no longer required by the Apple clients.
Enables resume logic to be usable for Apple clients.

Fixes tailscale/corp#14772

Signed-off-by: Rhea Ghosh <rhea@tailscale.com>
This commit is contained in:
Rhea Ghosh
2024-01-09 14:11:34 -06:00
committed by GitHub
parent 7df9af2f5c
commit 4ce33c9758
6 changed files with 20 additions and 58 deletions
+1 -9
View File
@@ -90,15 +90,6 @@ type ManagerOptions struct {
// copy them out, and then delete them.
DirectFileMode bool
// AvoidFinalRename specifies whether in DirectFileMode
// we should avoid renaming "foo.jpg.partial" to "foo.jpg" after reception.
//
// TODO(joetsai,rhea): Delete this. This is currently depended upon
// in the Apple platforms since it violates the abstraction layer
// and directly assumes how taildrop represents partial files.
// Right now, file resumption does not work on Apple.
AvoidFinalRename bool
// SendFileNotify is called periodically while a file is actively
// receiving the contents for the file. There is a final call
// to the function when reception completes.
@@ -244,6 +235,7 @@ func (m *Manager) IncomingFiles() []ipn.PartialFile {
DeclaredSize: f.size,
Received: f.copied,
PartialPath: f.partialPath,
FinalPath: f.finalPath,
Done: f.done,
})
return true