Skip to content

Commit

Permalink
Fix apply
Browse files Browse the repository at this point in the history
  • Loading branch information
simon0191 committed Feb 25, 2017
1 parent a18c32b commit 267b159
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gsync_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ func Apply(ctx context.Context, dst io.WriterAt, cache io.ReaderAt, ops <-chan B
if len(o.Data) > 0 {
block = o.Data
} else {
n, err := cache.ReadAt(buffer, indexB)
n, err := cache.ReadAt(buffer, indexB*DefaultBlockSize)
if err != nil && err != io.EOF {
return errors.Wrapf(err, "failed reading cached data")
}

block = buffer[:n]
}

_, err := dst.WriteAt(block, index)
_, err := dst.WriteAt(block, index*DefaultBlockSize)
if err != nil {
return errors.Wrapf(err, "failed writing block at %d", o.Index)
}
Expand Down

0 comments on commit 267b159

Please sign in to comment.