all: Move remaining protos to use the vanity plugin (#7009)

This commit is contained in:
Audrius Butkevicius
2020-10-02 08:07:05 +02:00
committed by GitHub
parent 7774932302
commit e027175446
55 changed files with 8353 additions and 1396 deletions
+9 -9
View File
@@ -15,7 +15,7 @@ import (
// sentFolderFileDownloadState represents a state of what we've announced as available
// to some remote device for a specific file.
type sentFolderFileDownloadState struct {
blockIndexes []int32
blockIndexes []int
version protocol.Vector
updated time.Time
created time.Time
@@ -44,7 +44,7 @@ func (s *sentFolderDownloadState) update(pullers []*sharedPullerState) []protoco
pullerVersion := puller.file.Version
pullerBlockIndexesUpdated := puller.AvailableUpdated()
pullerCreated := puller.created
pullerBlockSize := int32(puller.file.BlockSize())
pullerBlockSize := puller.file.BlockSize()
localFile, ok := s.files[name]
@@ -57,13 +57,13 @@ func (s *sentFolderDownloadState) update(pullers []*sharedPullerState) []protoco
updated: pullerBlockIndexesUpdated,
version: pullerVersion,
created: pullerCreated,
blockSize: int(pullerBlockSize),
blockSize: pullerBlockSize,
}
updates = append(updates, protocol.FileDownloadProgressUpdate{
Name: name,
Version: pullerVersion,
UpdateType: protocol.UpdateTypeAppend,
UpdateType: protocol.FileDownloadProgressUpdateTypeAppend,
BlockIndexes: pullerBlockIndexes,
BlockSize: pullerBlockSize,
})
@@ -83,12 +83,12 @@ func (s *sentFolderDownloadState) update(pullers []*sharedPullerState) []protoco
updates = append(updates, protocol.FileDownloadProgressUpdate{
Name: name,
Version: localFile.version,
UpdateType: protocol.UpdateTypeForget,
UpdateType: protocol.FileDownloadProgressUpdateTypeForget,
})
updates = append(updates, protocol.FileDownloadProgressUpdate{
Name: name,
Version: pullerVersion,
UpdateType: protocol.UpdateTypeAppend,
UpdateType: protocol.FileDownloadProgressUpdateTypeAppend,
BlockIndexes: pullerBlockIndexes,
BlockSize: pullerBlockSize,
})
@@ -112,7 +112,7 @@ func (s *sentFolderDownloadState) update(pullers []*sharedPullerState) []protoco
updates = append(updates, protocol.FileDownloadProgressUpdate{
Name: name,
Version: localFile.version,
UpdateType: protocol.UpdateTypeAppend,
UpdateType: protocol.FileDownloadProgressUpdateTypeAppend,
BlockIndexes: newBlocks,
BlockSize: pullerBlockSize,
})
@@ -127,7 +127,7 @@ func (s *sentFolderDownloadState) update(pullers []*sharedPullerState) []protoco
updates = append(updates, protocol.FileDownloadProgressUpdate{
Name: name,
Version: info.version,
UpdateType: protocol.UpdateTypeForget,
UpdateType: protocol.FileDownloadProgressUpdateTypeForget,
})
delete(s.files, name)
}
@@ -144,7 +144,7 @@ func (s *sentFolderDownloadState) destroy() []protocol.FileDownloadProgressUpdat
updates = append(updates, protocol.FileDownloadProgressUpdate{
Name: name,
Version: info.version,
UpdateType: protocol.UpdateTypeForget,
UpdateType: protocol.FileDownloadProgressUpdateTypeForget,
})
delete(s.files, name)
}