From 2c66ab38ad0353d941b343cb06022ef921ef4fec Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 30 May 2011 19:24:19 -0700 Subject: [PATCH] whoops, was using offset wrong in filewriter --- lib/go/camli/schema/filewriter.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/go/camli/schema/filewriter.go b/lib/go/camli/schema/filewriter.go index 5e5e6006f..f96af3752 100644 --- a/lib/go/camli/schema/filewriter.go +++ b/lib/go/camli/schema/filewriter.go @@ -38,13 +38,11 @@ func WriteFileFromReader(bs blobserver.Storage, filename string, r io.Reader) (* // Naive for now. Just in 1MB chunks. // TODO: rolling hash and hash trees. - parts := []ContentPart{} - size, offset := int64(0), int64(0) + parts, size := []ContentPart{}, int64(0) buf := new(bytes.Buffer) for { buf.Reset() - offset = size n, err := io.Copy(buf, io.LimitReader(r, 1<<20)) if err != nil { @@ -76,7 +74,7 @@ func WriteFileFromReader(bs blobserver.Storage, filename string, r io.Reader) (* BlobRefString: br.String(), BlobRef: br, Size: uint64(n), - Offset: uint64(offset), + Offset: 0, // into BlobRef to read from (not of dest) }) }