Commit 2677c346 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent fb3dcb0d
...@@ -22,7 +22,7 @@ package client ...@@ -22,7 +22,7 @@ package client
import ( import (
"context" "context"
"crypto/sha1" //"crypto/sha1"
"fmt" "fmt"
"math/rand" "math/rand"
"net/url" "net/url"
...@@ -448,10 +448,10 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (data []byte, serial zo ...@@ -448,10 +448,10 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (data []byte, serial zo
data = resp.Data data = resp.Data
checksum := sha1.Sum(data) //checksum := sha1.Sum(data)
if checksum != resp.Checksum { //if checksum != resp.Checksum {
return nil, 0, fmt.Errorf("data corrupt: checksum mismatch") // return nil, 0, fmt.Errorf("data corrupt: checksum mismatch")
} //}
if resp.Compression { if resp.Compression {
data, err = decompress(resp.Data, make([]byte, 0, len(resp.Data))) data, err = decompress(resp.Data, make([]byte, 0, len(resp.Data)))
......
...@@ -22,7 +22,7 @@ package server ...@@ -22,7 +22,7 @@ package server
import ( import (
"context" "context"
"crypto/sha1" //"crypto/sha1"
"fmt" "fmt"
"sync" "sync"
"time" "time"
...@@ -514,7 +514,7 @@ func (stor *Storage) serveClient1(ctx context.Context, req neo.Msg) (resp neo.Ms ...@@ -514,7 +514,7 @@ func (stor *Storage) serveClient1(ctx context.Context, req neo.Msg) (resp neo.Ms
Compression: false, Compression: false,
Data: data, Data: data,
Checksum: sha1.Sum(data), // XXX computing every time //Checksum: sha1.Sum(data), // XXX computing every time
// XXX .NextSerial // XXX .NextSerial
// XXX .DataSerial // XXX .DataSerial
......
...@@ -280,7 +280,7 @@ bench1() { ...@@ -280,7 +280,7 @@ bench1() {
return return
fi fi
go run zsha1.go --log_dir=$log $url go run zsha1.go --log_dir=$log $url
go run zsha1.go --log_dir=$log -useprefetch $url # go run zsha1.go --log_dir=$log -useprefetch $url
} }
echo -e "\n*** FileStorage" echo -e "\n*** FileStorage"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment