Commit 789323c9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ca25c79d
......@@ -318,10 +318,21 @@ func pktDecodeM(pkb *pktBuf) (msg, error) {
m.flags = msgFlags(v)
// method
m.method, b, err = msgp.ReadStringBytes(b)
s := ""
switch t := msgp.NextType(b); t {
case msgp.StrType:
s, b, err = msgp.ReadStringBytes(b)
case msgp.BinType:
var x []byte
x, b, err = msgp.ReadBytesZC(b)
s = string(x)
default:
err = fmt.Errorf("got %s; expected str|bin", t)
}
if err != nil {
return m, derrf(".%d: method: %s", m.msgid, err)
}
m.method = s
// arg
// it is interface{} - use shamaton/msgpack since msgp does not handle
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment