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
38ecddfc
Commit
38ecddfc
authored
Jul 06, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6f0929b0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
1 deletion
+33
-1
go/zodb/storage/zeo/zrpc.go
go/zodb/storage/zeo/zrpc.go
+33
-1
No files found.
go/zodb/storage/zeo/zrpc.go
View file @
38ecddfc
...
@@ -260,10 +260,42 @@ func pktDecodeZ(pkb *pktBuf) (msg, error) {
...
@@ -260,10 +260,42 @@ func pktDecodeZ(pkb *pktBuf) (msg, error) {
// pktDecodeM decodes raw M (msgpack) packet into message.
// pktDecodeM decodes raw M (msgpack) packet into message.
func
pktDecodeM
(
pkb
*
pktBuf
)
(
msg
,
error
)
{
func
pktDecodeM
(
pkb
*
pktBuf
)
(
msg
,
error
)
{
var
m
msg
var
m
msg
err
:=
msgpack
.
DecodeStructAsArray
(
pkb
.
Payload
(),
&
m
)
//err := msgpack.DecodeStructAsArray(pkb.Payload(), &m)
var
tpkt
tuple
err
:=
msgpack
.
Decode
(
pkb
.
Payload
(),
&
tpkt
)
if
err
!=
nil
{
if
err
!=
nil
{
return
m
,
err
return
m
,
err
}
}
if
len
(
tpkt
)
!=
4
{
return
m
,
derrf
(
"len(msg-tuple)=%d; expected 4"
,
len
(
tpkt
))
}
var
ok
bool
m
.
msgid
,
ok
=
tpkt
[
0
]
.
(
int64
)
// XXX can be int8, uint8, int16, ...
if
!
ok
{
return
m
,
derrf
(
"msgid: got %T; expected int"
,
tpkt
[
0
])
}
flags
,
ok
:=
tpkt
[
1
]
.
(
int64
)
if
!
ok
{
bflags
,
ok
:=
tpkt
[
1
]
.
(
bool
)
if
!
ok
{
return
m
,
derrf
(
"flags: got %T; expected int|bool"
,
tpkt
[
1
])
}
if
bflags
{
flags
=
1
}
// else: flags is already = 0
}
// XXX check flags are in range?
m
.
flags
=
msgFlags
(
flags
)
m
.
method
,
ok
=
tpkt
[
2
]
.
(
string
)
if
!
ok
{
return
m
,
derrf
(
".%d: method: got %T; expected str"
,
m
.
msgid
,
tpkt
[
2
])
}
m
.
arg
=
tpkt
[
3
]
// XXX []interface{} -> tuple
return
m
,
nil
return
m
,
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