sync: restore key part accidentally removed prior to earlier submit

Would cause accounting errors before in the face of duplicate uploads.

Change-Id: Ie7c49da1adaf2b9c98ef1015f875a4df8b66729f
This commit is contained in:
Brad Fitzpatrick 2014-03-06 13:23:27 -08:00
parent c1892b5ae5
commit 58ac8b5469
1 changed files with 3 additions and 0 deletions

View File

@ -518,6 +518,9 @@ func (sh *SyncHandler) ReceiveBlob(br blob.Ref, r io.Reader) (sb blob.SizedRef,
func (sh *SyncHandler) addBlobToCopy(sb blob.SizedRef) bool {
sh.mu.Lock()
defer sh.mu.Unlock()
if _, dup := sh.needCopy[sb.Ref]; dup {
return false
}
sh.needCopy[sb.Ref] = sb.Size
sh.bytesRemain += int64(sb.Size)