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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
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
Show 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
...
@@ -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
)))
...
...
go/neo/server/storage.go
View file @
2677c346
...
@@ -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
...
...
go/neo/t/t.sh
View file @
2677c346
...
@@ -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"
...
...
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