From 58ac8b5469103ae7a58e56ef5a54208097388ba3 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 6 Mar 2014 13:23:27 -0800 Subject: [PATCH] sync: restore key part accidentally removed prior to earlier submit Would cause accounting errors before in the face of duplicate uploads. Change-Id: Ie7c49da1adaf2b9c98ef1015f875a4df8b66729f --- pkg/server/sync.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/server/sync.go b/pkg/server/sync.go index 22b3a28ce..f9ef87096 100644 --- a/pkg/server/sync.go +++ b/pkg/server/sync.go @@ -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)