mirror of https://github.com/perkeep/perkeep.git
index: remove now-longer-necessary blob hash check
Change-Id: Ia2a79655832a840d37666b94a1f101042861c8ff
This commit is contained in:
parent
b80c7ca907
commit
00d8ff5275
|
@ -32,7 +32,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"camlistore.org/pkg/blob"
|
"camlistore.org/pkg/blob"
|
||||||
"camlistore.org/pkg/blobserver"
|
|
||||||
"camlistore.org/pkg/images"
|
"camlistore.org/pkg/images"
|
||||||
"camlistore.org/pkg/jsonsign"
|
"camlistore.org/pkg/jsonsign"
|
||||||
"camlistore.org/pkg/magic"
|
"camlistore.org/pkg/magic"
|
||||||
|
@ -73,17 +72,11 @@ func (ix *Index) reindex(br blob.Ref) {
|
||||||
|
|
||||||
func (ix *Index) ReceiveBlob(blobRef blob.Ref, source io.Reader) (retsb blob.SizedRef, err error) {
|
func (ix *Index) ReceiveBlob(blobRef blob.Ref, source io.Reader) (retsb blob.SizedRef, err error) {
|
||||||
sniffer := NewBlobSniffer(blobRef)
|
sniffer := NewBlobSniffer(blobRef)
|
||||||
hash := blobRef.Hash()
|
written, err := io.Copy(sniffer, source)
|
||||||
var written int64
|
|
||||||
written, err = io.Copy(io.MultiWriter(hash, sniffer), source)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !blobRef.HashMatches(hash) {
|
|
||||||
err = blobserver.ErrCorruptBlob
|
|
||||||
return
|
|
||||||
}
|
|
||||||
sniffer.Parse()
|
sniffer.Parse()
|
||||||
|
|
||||||
bm := ix.s.BeginBatch()
|
bm := ix.s.BeginBatch()
|
||||||
|
|
Loading…
Reference in New Issue