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
de0d5028
Commit
de0d5028
authored
Sep 11, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
51d087af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
go/neo/client/client.go
go/neo/client/client.go
+3
-1
go/neo/protogen.go
go/neo/protogen.go
+3
-3
go/neo/zproto-marshal.go
go/neo/zproto-marshal.go
+1
-1
No files found.
go/neo/client/client.go
View file @
de0d5028
...
...
@@ -454,14 +454,16 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (data *zodb.Buf, serial
//}
if
resp
.
Compression
{
// XXX cleanup mess vvv
data2
:=
zodb
.
BufAlloc
(
len
(
data
.
Data
))
data2
.
Data
=
data2
.
Data
[
:
0
]
udata
,
err
=
decompress
(
resp
.
Data
,
data2
)
udata
,
err
:=
decompress
(
data
.
Data
,
data2
.
Data
)
data
.
Free
()
if
err
!=
nil
{
data2
.
Free
()
return
nil
,
0
,
fmt
.
Errorf
(
"data corrupt: %v"
,
err
)
}
data2
.
Data
=
udata
data
=
data2
}
...
...
go/neo/protogen.go
View file @
de0d5028
...
...
@@ -926,11 +926,11 @@ func (d *decoder) genSlice1(assignto string, typ types.Type) {
// emit code to size/encode/decode zodb.Buf
// same as slice1 but buffer is allocated via zodb.BufAlloc
func
(
s
*
sizer
)
genBuf
(
path
string
)
{
s
.
genSlice1
(
path
+
".Data"
,
nil
)
// XXX typ unused
s
.
genSlice1
(
path
+
".Data"
,
nil
/* typ unused */
)
}
func
(
e
*
encoder
)
genBuf
(
path
string
)
{
e
.
genSlice1
(
path
+
".Data"
,
nil
)
// XXX typ unused
e
.
genSlice1
(
path
+
".Data"
,
nil
/* typ unused */
)
}
func
(
d
*
decoder
)
genBuf
(
path
string
)
{
...
...
@@ -943,7 +943,7 @@ func (d *decoder) genBuf(path string) {
d
.
overflow
.
AddExpr
(
"l"
)
// TODO eventually do not copy but reference original
d
.
emit
(
"%v= zodb.BufAlloc(
l
)"
,
path
)
d
.
emit
(
"%v= zodb.BufAlloc(
int(l)
)"
,
path
)
d
.
emit
(
"copy(%v.Data, data[:l])"
,
path
)
d
.
emit
(
"data = data[l:]"
)
...
...
go/neo/zproto-marshal.go
View file @
de0d5028
...
...
@@ -1966,7 +1966,7 @@ func (p *AnswerObject) neoMsgDecode(data []byte) (int, error) {
goto
overflow
}
nread
+=
8
+
l
p
.
Data
=
zodb
.
BufAlloc
(
l
)
p
.
Data
=
zodb
.
BufAlloc
(
int
(
l
)
)
copy
(
p
.
Data
.
Data
,
data
[
:
l
])
data
=
data
[
l
:
]
}
...
...
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