Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
2677c346
Commit
2677c346
authored
Sep 11, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
fb3dcb0d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
go/neo/client/client.go
go/neo/client/client.go
+5
-5
go/neo/server/storage.go
go/neo/server/storage.go
+2
-2
go/neo/t/t.sh
go/neo/t/t.sh
+1
-1
No files found.
go/neo/client/client.go
View file @
2677c346
...
...
@@ -22,7 +22,7 @@ package client
import
(
"context"
"crypto/sha1"
//
"crypto/sha1"
"fmt"
"math/rand"
"net/url"
...
...
@@ -448,10 +448,10 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (data []byte, serial zo
data
=
resp
.
Data
checksum
:=
sha1
.
Sum
(
data
)
if
checksum
!=
resp
.
Checksum
{
return
nil
,
0
,
fmt
.
Errorf
(
"data corrupt: checksum mismatch"
)
}
//
checksum := sha1.Sum(data)
//
if checksum != resp.Checksum {
//
return nil, 0, fmt.Errorf("data corrupt: checksum mismatch")
//
}
if
resp
.
Compression
{
data
,
err
=
decompress
(
resp
.
Data
,
make
([]
byte
,
0
,
len
(
resp
.
Data
)))
...
...
go/neo/server/storage.go
View file @
2677c346
...
...
@@ -22,7 +22,7 @@ package server
import
(
"context"
"crypto/sha1"
//
"crypto/sha1"
"fmt"
"sync"
"time"
...
...
@@ -514,7 +514,7 @@ func (stor *Storage) serveClient1(ctx context.Context, req neo.Msg) (resp neo.Ms
Compression
:
false
,
Data
:
data
,
Checksum
:
sha1
.
Sum
(
data
),
// XXX computing every time
//
Checksum: sha1.Sum(data), // XXX computing every time
// XXX .NextSerial
// XXX .DataSerial
...
...
go/neo/t/t.sh
View file @
2677c346
...
...
@@ -280,7 +280,7 @@ bench1() {
return
fi
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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment