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
f302d93e
Commit
f302d93e
authored
Sep 12, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
55cd6072
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
5 deletions
+19
-5
go/neo/protogen.go
go/neo/protogen.go
+2
-2
go/neo/server/storage.go
go/neo/server/storage.go
+6
-0
go/neo/zproto-marshal.go
go/neo/zproto-marshal.go
+3
-3
go/zodb/buffer.go
go/zodb/buffer.go
+8
-0
No files found.
go/neo/protogen.go
View file @
f302d93e
...
...
@@ -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
/* typ unused */
)
s
.
genSlice1
(
path
+
".
XData()
"
,
nil
/* typ unused */
)
}
func
(
e
*
encoder
)
genBuf
(
path
string
)
{
e
.
genSlice1
(
path
+
".
Data
"
,
nil
/* typ unused */
)
e
.
genSlice1
(
path
+
".
XData()
"
,
nil
/* typ unused */
)
}
func
(
d
*
decoder
)
genBuf
(
path
string
)
{
...
...
go/neo/server/storage.go
View file @
f302d93e
...
...
@@ -471,6 +471,12 @@ func (stor *Storage) serveClient(ctx context.Context, req neo.Request) {
return
}
// XXX hack -> resp.Release()
// XXX req.Msg release too?
if
resp
,
ok
:=
resp
.
(
*
neo
.
AnswerObject
);
ok
{
resp
.
Data
.
Release
()
}
// keep on going in the same goroutine to avoid goroutine creation overhead
// TODO += timeout -> go away if inactive
req
,
err
=
link
.
Recv1
()
...
...
go/neo/zproto-marshal.go
View file @
f302d93e
...
...
@@ -1930,7 +1930,7 @@ func (*AnswerObject) neoMsgCode() uint16 {
}
func
(
p
*
AnswerObject
)
neoMsgEncodedLen
()
int
{
return
57
+
len
(
p
.
Data
.
Data
)
return
57
+
len
(
p
.
Data
.
XData
()
)
}
func
(
p
*
AnswerObject
)
neoMsgEncode
(
data
[]
byte
)
{
...
...
@@ -1940,10 +1940,10 @@ func (p *AnswerObject) neoMsgEncode(data []byte) {
(
data
[
24
:
])[
0
]
=
bool2byte
(
p
.
Compression
)
copy
(
data
[
25
:
],
p
.
Checksum
[
:
])
{
l
:=
uint32
(
len
(
p
.
Data
.
Data
))
l
:=
uint32
(
len
(
p
.
Data
.
XData
()
))
binary
.
BigEndian
.
PutUint32
(
data
[
45
:
],
l
)
data
=
data
[
49
:
]
copy
(
data
,
p
.
Data
.
Data
)
copy
(
data
,
p
.
Data
.
XData
()
)
data
=
data
[
l
:
]
}
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
DataSerial
))
...
...
go/zodb/buffer.go
View file @
f302d93e
...
...
@@ -171,3 +171,11 @@ func (buf *Buf) Cap() int {
}
return
0
}
// XData return's buf.Data or nil if buf == nil.
func
(
buf
*
Buf
)
XData
()
[]
byte
{
if
buf
!=
nil
{
return
buf
.
Data
}
return
nil
}
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