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
+5 -5
View File
@@ -16,7 +16,7 @@ import (
// FileInfo.Blocks that the remote device already has, and version represents
// the version of the file that the remote device is downloading.
type deviceFolderFileDownloadState struct {
blockIndexes []int32
blockIndexes []int
version protocol.Vector
blockSize int
}
@@ -30,7 +30,7 @@ type deviceFolderDownloadState struct {
// Has returns whether a block at that specific index, and that specific version of the file
// is currently available on the remote device for pulling from a temporary file.
func (p *deviceFolderDownloadState) Has(file string, version protocol.Vector, index int32) bool {
func (p *deviceFolderDownloadState) Has(file string, version protocol.Vector, index int) bool {
p.mut.RLock()
defer p.mut.RUnlock()
@@ -56,9 +56,9 @@ func (p *deviceFolderDownloadState) Update(updates []protocol.FileDownloadProgre
for _, update := range updates {
local, ok := p.files[update.Name]
if update.UpdateType == protocol.UpdateTypeForget && ok && local.version.Equal(update.Version) {
if update.UpdateType == protocol.FileDownloadProgressUpdateTypeForget && ok && local.version.Equal(update.Version) {
delete(p.files, update.Name)
} else if update.UpdateType == protocol.UpdateTypeAppend {
} else if update.UpdateType == protocol.FileDownloadProgressUpdateTypeAppend {
if !ok {
local = deviceFolderFileDownloadState{
blockIndexes: update.BlockIndexes,
@@ -137,7 +137,7 @@ func (t *deviceDownloadState) Update(folder string, updates []protocol.FileDownl
// Has returns whether block at that specific index, and that specific version of the file
// is currently available on the remote device for pulling from a temporary file.
func (t *deviceDownloadState) Has(folder, file string, version protocol.Vector, index int32) bool {
func (t *deviceDownloadState) Has(folder, file string, version protocol.Vector, index int) bool {
if t == nil {
return false
}