Commit 37dd83e9 authored by Levin Zimmermann's avatar Levin Zimmermann

proto/msgpack: Fix encoding INVALID_{TID,OID}

In pre-msgpack protocol an 'INVALID_{TID,OID}' was always
decoded as 'None' in NEO/py [1]. But in msgpack protocol
this isn't true anymore. An `INVALID_TID` is now decoded
as an `INVALID_TID`. And this then leads to errors later [2].
Instead of restoring NEO/py to a pre-msgpack behaviour, we
fix this on NEO/go side by encoding 'INVALID_{TID,OID}' to NIL
on the wire. This is good as it makes the messages we send
smaller.

[1] https://lab.nexedi.com/nexedi/neoppod/-/blob/6332112cba979dfd29b40fe9f98d097911fde696/neo/lib/protocol.py#L579-583
[2] With SQLite backend we can see the following exception:

Traceback (most recent call last):
  File "/home/levin/neo/neo/tests/functional/__init__.py", line 192, in start
    self.run()
  File "/home/levin/neo/neo/tests/functional/__init__.py", line 288, in run
    getattr(neo.scripts,  self.command).main()
  File "/home/levin/neo/neo/scripts/neostorage.py", line 32, in main
    app.run()
  File "/home/levin/neo/neo/storage/app.py", line 196, in run
    self._run()
  File "/home/levin/neo/neo/storage/app.py", line 227, in _run
    self.doOperation()
  File "/home/levin/neo/neo/storage/app.py", line 301, in doOperation
    poll()
  File "/home/levin/neo/neo/storage/app.py", line 145, in _poll
    self.em.poll(1)
  File "/home/levin/neo/neo/lib/event.py", line 160, in poll
    to_process.process()
  File "/home/levin/neo/neo/lib/connection.py", line 508, in process
    self._handlers.handle(self, self._queue.pop(0))
  File "/home/levin/neo/neo/lib/connection.py", line 93, in handle
    self._handle(connection, packet)
  File "/home/levin/neo/neo/lib/connection.py", line 108, in _handle
    pending[0][1].packetReceived(connection, packet)
  File "/home/levin/neo/neo/lib/handler.py", line 125, in packetReceived
    self.dispatch(*args)
  File "/home/levin/neo/neo/lib/handler.py", line 75, in dispatch
    method(conn, *args, **kw)
  File "/home/levin/neo/neo/storage/handlers/client.py", line 67, in askObject
    o = app.dm.getObject(oid, at, before)
  File "/home/levin/neo/neo/storage/database/manager.py", line 484, in getObject
    before_tid and u64(before_tid))
  File "/home/levin/neo/neo/storage/database/sqlite.py", line 336, in _getObject
    r = q(sql + ' AND tid=?', (partition, oid, tid))
OverflowError: Python int too large to convert to SQLite INTEGER
parent b44769cf
......@@ -33,6 +33,8 @@ const (
FixMap_4 Op = 0b1000_0000 // 1000_XXXX
FixArray_4 Op = 0b1001_0000 // 1001_XXXX
Nil Op = 0xc0
False Op = 0xc2
True Op = 0xc3
......
......@@ -131,6 +131,13 @@ var memBuf types.Type // type of mem.Buf
// registry of enums
var enumRegistry = map[types.Type]int{} // type -> enum type serial
// Define INVALID_TID because encoding behaves different depending
// on if we have an INVALID_TID or not.
//
// NOTE This assumes that INVALID_OID == INVALID_TID
//
// XXX Duplication wrt proto.go
const INVALID_ID uint64 = 1<<64 - 1
// bytes.Buffer + bell & whistles
type Buffer struct {
......@@ -961,10 +968,15 @@ func (s *sizerM) genBasic(path string, typ *types.Basic, userType types.Type) {
upath = fmt.Sprintf("%s(%s)", typ.Name(), upath)
}
// zodb.Tid and zodb.Oid are encoded as [8]bin XXX or nil for INVALID_{TID_OID}
// zodb.Tid and zodb.Oid are encoded as [8]bin or nil for INVALID_{TID_OID}
if userType == zodbTid || userType == zodbOid {
s.size.Add(1+1+8) // mbin8 + 8 + [8]data
return
// INVALID_{TID,OID} must be NIL on the wire
s.emit("if uint64(%s) == %v {", path, INVALID_ID)
s.emit("%v += 1 // mnil", s.var_("size"))
s.emit("} else {")
s.emit("%v += 1+1+8 // mbin8 + 8 + [8]data", s.var_("size"))
s.emit("}")
return
}
// enums are encoded as extensions
......@@ -997,12 +1009,18 @@ func (e *encoderM) genBasic(path string, typ *types.Basic, userType types.Type)
upath = fmt.Sprintf("%s(%s)", typ.Name(), upath)
}
// zodb.Tid and zodb.Oid are encoded as [8]bin XXX or nil
// zodb.Tid and zodb.Oid are encoded as [8]bin or nil
if userType == zodbTid || userType == zodbOid {
e.emit("if %s == %v {", path, INVALID_ID) // INVALID_{TID,OID} =>
e.emit("data[%v] = msgpack.Nil", e.n) // mnil
e.emit("data = data[%v:]", e.n + 1)
e.emit("} else {")
e.emit("data[%v] = byte(msgpack.Bin8)", e.n); e.n++
e.emit("data[%v] = 8", e.n); e.n++
e.emit("binary.BigEndian.PutUint64(data[%v:], uint64(%s))", e.n, path)
e.n += 8
e.resetPos()
e.emit("}")
return
}
......@@ -1456,6 +1474,17 @@ func (e *encoderCommon) genSliceCommon(xe CodeGenCustomize, path string, typ *ty
e.emit("}")
}
// data = data[n:]
// n = 0
//
// XXX duplication wrt decoderCommon.resetPost
func (e *encoderCommon) resetPos() {
if e.n != 0 {
e.emit("data = data[%v:]", e.n)
e.n = 0
}
}
func (d *decoderN) genSliceHead(assignto string, typ *types.Slice, obj types.Object) {
d.genBasic("l:", types.Typ[types.Uint32], nil)
}
......
......@@ -1385,7 +1385,18 @@ overflow:
}
func (p *AnswerRecovery) neoMsgEncodedLenM() int {
return 21 + msgpack.Uint64Size(uint64(p.PTid))
var size int
if uint64(p.BackupTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.TruncateTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.Uint64Size(uint64(p.PTid)) + size
}
func (p *AnswerRecovery) neoMsgEncodeM(data []byte) {
......@@ -1394,12 +1405,24 @@ func (p *AnswerRecovery) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint64(data[1:], uint64(p.PTid))
data = data[1+n:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.BackupTid))
data[10] = byte(msgpack.Bin8)
data[11] = 8
binary.BigEndian.PutUint64(data[12:], uint64(p.TruncateTid))
if p.BackupTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.BackupTid))
data = data[10:]
}
if p.TruncateTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.TruncateTid))
data = data[10:]
}
}
func (p *AnswerRecovery) neoMsgDecodeM(data []byte) (int, error) {
......@@ -1522,17 +1545,40 @@ overflow:
}
func (p *AnswerLastIDs) neoMsgEncodedLenM() int {
return 21
var size int
if uint64(p.LastOid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.LastTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *AnswerLastIDs) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.LastOid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.LastTid))
if p.LastOid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.LastOid))
data = data[11:]
}
if p.LastTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.LastTid))
data = data[10:]
}
}
func (p *AnswerLastIDs) neoMsgDecodeM(data []byte) (int, error) {
......@@ -2609,25 +2655,42 @@ overflow:
}
func (p *AnswerUnfinishedTransactions) neoMsgEncodedLenM() int {
return 11 + msgpack.ArrayHeadSize(len(p.TidList)) + len(p.TidList)*11
var size int
if uint64(p.MaxTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.ArrayHeadSize(len(p.TidList)) + len(p.TidList)*1 + size
}
func (p *AnswerUnfinishedTransactions) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.MaxTID))
if p.MaxTID == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.MaxTID))
data = data[11:]
}
{
l := len(p.TidList)
n := msgpack.PutArrayHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.TidList[i]
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64((*a).UnfinishedTID))
data = data[11:]
if (*a).UnfinishedTID == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64((*a).UnfinishedTID))
data = data[11:]
}
}
}
}
......@@ -2662,10 +2725,10 @@ func (p *AnswerUnfinishedTransactions) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*11 {
if uint64(len(data)) < uint64(l)*1 {
goto overflow
}
nread += uint64(l) * 11
nread += uint64(l) * 1
p.TidList = make([]struct{ UnfinishedTID zodb.Tid }, l)
for i := 0; uint32(i) < l; i++ {
a := &p.TidList[i]
......@@ -2796,7 +2859,7 @@ overflow:
}
func (p *AnswerLockedTransactions) neoMsgEncodedLenM() int {
return 1 + msgpack.MapHeadSize(len(p.TidDict)) + len(p.TidDict)*20
return 1 + msgpack.MapHeadSize(len(p.TidDict)) + len(p.TidDict)*0
}
func (p *AnswerLockedTransactions) neoMsgEncodeM(data []byte) {
......@@ -2811,13 +2874,24 @@ func (p *AnswerLockedTransactions) neoMsgEncodeM(data []byte) {
}
sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] })
for _, key := range keyv {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(key))
data[10] = byte(msgpack.Bin8)
data[11] = 8
binary.BigEndian.PutUint64(data[12:], uint64(p.TidDict[key]))
data = data[20:]
if key == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(key))
data = data[10:]
}
if p.TidDict[key] == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.TidDict[key]))
data = data[10:]
}
}
}
}
......@@ -2844,10 +2918,10 @@ func (p *AnswerLockedTransactions) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*20 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 20
nread += uint64(l) * 0
p.TidDict = make(map[zodb.Tid]zodb.Tid, l)
m := p.TidDict
for i := 0; uint32(i) < l; i++ {
......@@ -2901,14 +2975,26 @@ overflow:
}
func (p *FinalTID) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.TTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *FinalTID) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID))
if p.TTID == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID))
data = data[11:]
}
}
func (p *FinalTID) neoMsgDecodeM(data []byte) (int, error) {
......@@ -2964,14 +3050,26 @@ overflow:
}
func (p *AnswerFinalTID) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *AnswerFinalTID) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
}
func (p *AnswerFinalTID) neoMsgDecodeM(data []byte) (int, error) {
......@@ -3029,17 +3127,40 @@ overflow:
}
func (p *ValidateTransaction) neoMsgEncodedLenM() int {
return 21
var size int
if uint64(p.TTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *ValidateTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.Tid))
if p.TTID == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID))
data = data[11:]
}
if p.Tid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Tid))
data = data[10:]
}
}
func (p *ValidateTransaction) neoMsgDecodeM(data []byte) (int, error) {
......@@ -3102,14 +3223,26 @@ overflow:
}
func (p *BeginTransaction) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *BeginTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
}
func (p *BeginTransaction) neoMsgDecodeM(data []byte) (int, error) {
......@@ -3165,14 +3298,26 @@ overflow:
}
func (p *AnswerBeginTransaction) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *AnswerBeginTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
}
func (p *AnswerBeginTransaction) neoMsgDecodeM(data []byte) (int, error) {
......@@ -3254,22 +3399,33 @@ overflow:
func (p *FailedVote) neoMsgEncodedLenM() int {
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
for i := 0; i < len(p.NodeList); i++ {
a := &p.NodeList[i]
size += msgpack.Int32Size(int32((*a)))
}
return 11 + msgpack.ArrayHeadSize(len(p.NodeList)) + size
return 1 + msgpack.ArrayHeadSize(len(p.NodeList)) + size
}
func (p *FailedVote) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
{
l := len(p.NodeList)
n := msgpack.PutArrayHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.NodeList[i]
{
......@@ -3405,24 +3561,41 @@ overflow:
}
func (p *FinishTransaction) neoMsgEncodedLenM() int {
return 11 + msgpack.ArrayHeadSize(len(p.OIDList)) + len(p.OIDList)*10 + msgpack.ArrayHeadSize(len(p.CheckedList)) + len(p.CheckedList)*10
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.ArrayHeadSize(len(p.OIDList)) + len(p.OIDList)*0 + msgpack.ArrayHeadSize(len(p.CheckedList)) + len(p.CheckedList)*0 + size
}
func (p *FinishTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
{
l := len(p.OIDList)
n := msgpack.PutArrayHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.OIDList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
{
......@@ -3431,10 +3604,15 @@ func (p *FinishTransaction) neoMsgEncodeM(data []byte) {
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.CheckedList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -3469,10 +3647,10 @@ func (p *FinishTransaction) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.OIDList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.OIDList[i]
......@@ -3493,10 +3671,10 @@ func (p *FinishTransaction) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.CheckedList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.CheckedList[i]
......@@ -3544,17 +3722,40 @@ overflow:
}
func (p *AnswerTransactionFinished) neoMsgEncodedLenM() int {
return 21
var size int
if uint64(p.TTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *AnswerTransactionFinished) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.Tid))
if p.TTid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
data = data[11:]
}
if p.Tid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Tid))
data = data[10:]
}
}
func (p *AnswerTransactionFinished) neoMsgDecodeM(data []byte) (int, error) {
......@@ -3619,17 +3820,40 @@ overflow:
}
func (p *LockInformation) neoMsgEncodedLenM() int {
return 21
var size int
if uint64(p.Ttid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *LockInformation) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Ttid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.Tid))
if p.Ttid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Ttid))
data = data[11:]
}
if p.Tid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Tid))
data = data[10:]
}
}
func (p *LockInformation) neoMsgDecodeM(data []byte) (int, error) {
......@@ -3692,14 +3916,26 @@ overflow:
}
func (p *AnswerInformationLocked) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Ttid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *AnswerInformationLocked) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Ttid))
if p.Ttid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Ttid))
data = data[11:]
}
}
func (p *AnswerInformationLocked) neoMsgDecodeM(data []byte) (int, error) {
......@@ -3780,24 +4016,41 @@ overflow:
}
func (p *InvalidateObjects) neoMsgEncodedLenM() int {
return 11 + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*10
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*0 + size
}
func (p *InvalidateObjects) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
{
l := len(p.OidList)
n := msgpack.PutArrayHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.OidList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -3832,10 +4085,10 @@ func (p *InvalidateObjects) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i]
......@@ -3881,14 +4134,26 @@ overflow:
}
func (p *NotifyUnlockInformation) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.TTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *NotifyUnlockInformation) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID))
if p.TTID == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID))
data = data[11:]
}
}
func (p *NotifyUnlockInformation) neoMsgDecodeM(data []byte) (int, error) {
......@@ -4034,7 +4299,7 @@ overflow:
}
func (p *AnswerNewOIDs) neoMsgEncodedLenM() int {
return 1 + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*10
return 1 + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*0
}
func (p *AnswerNewOIDs) neoMsgEncodeM(data []byte) {
......@@ -4045,10 +4310,15 @@ func (p *AnswerNewOIDs) neoMsgEncodeM(data []byte) {
data = data[1+n:]
for i := 0; i < l; i++ {
a := &p.OidList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -4075,10 +4345,10 @@ func (p *AnswerNewOIDs) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i]
......@@ -4126,17 +4396,40 @@ overflow:
}
func (p *NotifyDeadlock) neoMsgEncodedLenM() int {
return 21
var size int
if uint64(p.TTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.LockingTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *NotifyDeadlock) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.LockingTid))
if p.TTid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
data = data[11:]
}
if p.LockingTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.LockingTid))
data = data[10:]
}
}
func (p *NotifyDeadlock) neoMsgDecodeM(data []byte) (int, error) {
......@@ -4201,17 +4494,40 @@ overflow:
}
func (p *RebaseTransaction) neoMsgEncodedLenM() int {
return 21
var size int
if uint64(p.TTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.LockingTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *RebaseTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.LockingTid))
if p.TTid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
data = data[11:]
}
if p.LockingTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.LockingTid))
data = data[10:]
}
}
func (p *RebaseTransaction) neoMsgDecodeM(data []byte) (int, error) {
......@@ -4297,7 +4613,7 @@ overflow:
}
func (p *AnswerRebaseTransaction) neoMsgEncodedLenM() int {
return 1 + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*10
return 1 + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*0
}
func (p *AnswerRebaseTransaction) neoMsgEncodeM(data []byte) {
......@@ -4308,10 +4624,15 @@ func (p *AnswerRebaseTransaction) neoMsgEncodeM(data []byte) {
data = data[1+n:]
for i := 0; i < l; i++ {
a := &p.OidList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -4338,10 +4659,10 @@ func (p *AnswerRebaseTransaction) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i]
......@@ -4389,17 +4710,40 @@ overflow:
}
func (p *RebaseObject) neoMsgEncodedLenM() int {
return 21
var size int
if uint64(p.TTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Oid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *RebaseObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.Oid))
if p.TTid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
data = data[11:]
}
if p.Oid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Oid))
data = data[10:]
}
}
func (p *RebaseObject) neoMsgDecodeM(data []byte) (int, error) {
......@@ -4487,25 +4831,48 @@ overflow:
}
func (p *AnswerRebaseObject) neoMsgEncodedLenM() int {
return 44 + msgpack.BinHeadSize(len(p.Data.XData())) + len(p.Data.XData())
var size int
if uint64(p.Serial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.ConflictSerial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 24 + msgpack.BinHeadSize(len(p.Data.XData())) + len(p.Data.XData()) + size
}
func (p *AnswerRebaseObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 5)
if p.Serial == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Serial))
data = data[11:]
}
if p.ConflictSerial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.ConflictSerial))
data = data[10:]
}
data[0] = byte(msgpack.Bool(p.Compression))
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Serial))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.ConflictSerial))
data[21] = byte(msgpack.Bool(p.Compression))
data[22] = byte(msgpack.Bin8)
data[23] = 20
copy(data[24:], p.Checksum[:])
data[2] = 20
copy(data[3:], p.Checksum[:])
{
l := len(p.Data.XData())
n := msgpack.PutBinHead(data[44:], l)
data = data[44+n:]
n := msgpack.PutBinHead(data[23:], l)
data = data[23+n:]
copy(data, p.Data.XData())
data = data[l:]
}
......@@ -4627,34 +4994,79 @@ overflow:
}
func (p *StoreObject) neoMsgEncodedLenM() int {
return 64 + msgpack.BinHeadSize(len(p.Data)) + len(p.Data)
var size int
if uint64(p.Oid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Serial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.DataSerial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 24 + msgpack.BinHeadSize(len(p.Data)) + len(p.Data) + size
}
func (p *StoreObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 7)
if p.Oid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data = data[11:]
}
if p.Serial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Serial))
data = data[10:]
}
data[0] = byte(msgpack.Bool(p.Compression))
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.Serial))
data[21] = byte(msgpack.Bool(p.Compression))
data[22] = byte(msgpack.Bin8)
data[23] = 20
copy(data[24:], p.Checksum[:])
data[2] = 20
copy(data[3:], p.Checksum[:])
{
l := len(p.Data)
n := msgpack.PutBinHead(data[44:], l)
data = data[44+n:]
n := msgpack.PutBinHead(data[23:], l)
data = data[23+n:]
copy(data, p.Data)
data = data[l:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.DataSerial))
data[10] = byte(msgpack.Bin8)
data[11] = 8
binary.BigEndian.PutUint64(data[12:], uint64(p.Tid))
if p.DataSerial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.DataSerial))
data = data[10:]
}
if p.Tid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Tid))
data = data[10:]
}
}
func (p *StoreObject) neoMsgDecodeM(data []byte) (int, error) {
......@@ -4761,14 +5173,26 @@ overflow:
}
func (p *AnswerStoreObject) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Conflict) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *AnswerStoreObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Conflict))
if p.Conflict == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Conflict))
data = data[11:]
}
}
func (p *AnswerStoreObject) neoMsgDecodeM(data []byte) (int, error) {
......@@ -4850,22 +5274,33 @@ overflow:
func (p *AbortTransaction) neoMsgEncodedLenM() int {
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
for i := 0; i < len(p.NodeList); i++ {
a := &p.NodeList[i]
size += msgpack.Int32Size(int32((*a)))
}
return 11 + msgpack.ArrayHeadSize(len(p.NodeList)) + size
return 1 + msgpack.ArrayHeadSize(len(p.NodeList)) + size
}
func (p *AbortTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
{
l := len(p.NodeList)
n := msgpack.PutArrayHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.NodeList[i]
{
......@@ -5028,18 +5463,30 @@ overflow:
}
func (p *StoreTransaction) neoMsgEncodedLenM() int {
return 11 + msgpack.BinHeadSize(len(p.User)) + len(p.User) + msgpack.BinHeadSize(len(p.Description)) + len(p.Description) + msgpack.BinHeadSize(len(p.Extension)) + len(p.Extension) + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*10
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.BinHeadSize(len(p.User)) + len(p.User) + msgpack.BinHeadSize(len(p.Description)) + len(p.Description) + msgpack.BinHeadSize(len(p.Extension)) + len(p.Extension) + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*0 + size
}
func (p *StoreTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 5)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
{
l := len(p.User)
n := msgpack.PutBinHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutBinHead(data[0:], l)
data = data[0+n:]
copy(data, p.User)
data = data[l:]
}
......@@ -5063,10 +5510,15 @@ func (p *StoreTransaction) neoMsgEncodeM(data []byte) {
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.OidList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -5128,10 +5580,10 @@ func (p *StoreTransaction) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i]
......@@ -5222,14 +5674,26 @@ overflow:
}
func (p *VoteTransaction) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *VoteTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
}
func (p *VoteTransaction) neoMsgDecodeM(data []byte) (int, error) {
......@@ -5334,20 +5798,54 @@ overflow:
}
func (p *GetObject) neoMsgEncodedLenM() int {
return 31
var size int
if uint64(p.Oid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.At) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Before) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *GetObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.At))
data[21] = byte(msgpack.Bin8)
data[22] = 8
binary.BigEndian.PutUint64(data[23:], uint64(p.Before))
if p.Oid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data = data[11:]
}
if p.At == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.At))
data = data[10:]
}
if p.Before == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Before))
data = data[10:]
}
}
func (p *GetObject) neoMsgDecodeM(data []byte) (int, error) {
......@@ -5446,34 +5944,79 @@ overflow:
}
func (p *AnswerObject) neoMsgEncodedLenM() int {
return 64 + msgpack.BinHeadSize(len(p.Data.XData())) + len(p.Data.XData())
var size int
if uint64(p.Oid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Serial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.NextSerial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.DataSerial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 24 + msgpack.BinHeadSize(len(p.Data.XData())) + len(p.Data.XData()) + size
}
func (p *AnswerObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 7)
if p.Oid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data = data[11:]
}
if p.Serial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Serial))
data = data[10:]
}
if p.NextSerial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.NextSerial))
data = data[10:]
}
data[0] = byte(msgpack.Bool(p.Compression))
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.Serial))
data[21] = byte(msgpack.Bin8)
data[22] = 8
binary.BigEndian.PutUint64(data[23:], uint64(p.NextSerial))
data[31] = byte(msgpack.Bool(p.Compression))
data[32] = byte(msgpack.Bin8)
data[33] = 20
copy(data[34:], p.Checksum[:])
data[2] = 20
copy(data[3:], p.Checksum[:])
{
l := len(p.Data.XData())
n := msgpack.PutBinHead(data[54:], l)
data = data[54+n:]
n := msgpack.PutBinHead(data[23:], l)
data = data[23+n:]
copy(data, p.Data.XData())
data = data[l:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.DataSerial))
if p.DataSerial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.DataSerial))
data = data[10:]
}
}
func (p *AnswerObject) neoMsgDecodeM(data []byte) (int, error) {
......@@ -5700,7 +6243,7 @@ overflow:
}
func (p *AnswerTIDs) neoMsgEncodedLenM() int {
return 1 + msgpack.ArrayHeadSize(len(p.TIDList)) + len(p.TIDList)*10
return 1 + msgpack.ArrayHeadSize(len(p.TIDList)) + len(p.TIDList)*0
}
func (p *AnswerTIDs) neoMsgEncodeM(data []byte) {
......@@ -5711,10 +6254,15 @@ func (p *AnswerTIDs) neoMsgEncodeM(data []byte) {
data = data[1+n:]
for i := 0; i < l; i++ {
a := &p.TIDList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -5741,10 +6289,10 @@ func (p *AnswerTIDs) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.TIDList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.TIDList[i]
......@@ -5790,14 +6338,26 @@ overflow:
}
func (p *TransactionInformation) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *TransactionInformation) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
}
func (p *TransactionInformation) neoMsgDecodeM(data []byte) (int, error) {
......@@ -5931,18 +6491,30 @@ overflow:
}
func (p *AnswerTransactionInformation) neoMsgEncodedLenM() int {
return 12 + msgpack.BinHeadSize(len(p.User)) + len(p.User) + msgpack.BinHeadSize(len(p.Description)) + len(p.Description) + msgpack.BinHeadSize(len(p.Extension)) + len(p.Extension) + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*10
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 2 + msgpack.BinHeadSize(len(p.User)) + len(p.User) + msgpack.BinHeadSize(len(p.Description)) + len(p.Description) + msgpack.BinHeadSize(len(p.Extension)) + len(p.Extension) + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*0 + size
}
func (p *AnswerTransactionInformation) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 6)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
{
l := len(p.User)
n := msgpack.PutBinHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutBinHead(data[0:], l)
data = data[0+n:]
copy(data, p.User)
data = data[l:]
}
......@@ -5967,10 +6539,15 @@ func (p *AnswerTransactionInformation) neoMsgEncodeM(data []byte) {
data = data[1+n:]
for i := 0; i < l; i++ {
a := &p.OidList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -6044,10 +6621,10 @@ func (p *AnswerTransactionInformation) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i]
......@@ -6097,17 +6674,29 @@ overflow:
}
func (p *ObjectHistory) neoMsgEncodedLenM() int {
return 11 + msgpack.Uint64Size(p.First) + msgpack.Uint64Size(p.Last)
var size int
if uint64(p.Oid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.Uint64Size(p.First) + msgpack.Uint64Size(p.Last) + size
}
func (p *ObjectHistory) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
if p.Oid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data = data[11:]
}
{
n := msgpack.PutUint64(data[11:], p.First)
data = data[11+n:]
n := msgpack.PutUint64(data[0:], p.First)
data = data[0+n:]
}
{
n := msgpack.PutUint64(data[0:], p.Last)
......@@ -6219,31 +6808,53 @@ overflow:
func (p *AnswerObjectHistory) neoMsgEncodedLenM() int {
var size int
if uint64(p.Oid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
for i := 0; i < len(p.HistoryList); i++ {
a := &p.HistoryList[i]
if uint64((*a).Serial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
size += msgpack.Uint32Size((*a).Size)
}
return 11 + msgpack.ArrayHeadSize(len(p.HistoryList)) + len(p.HistoryList)*11 + size
return 1 + msgpack.ArrayHeadSize(len(p.HistoryList)) + len(p.HistoryList)*1 + size
}
func (p *AnswerObjectHistory) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
if p.Oid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data = data[11:]
}
{
l := len(p.HistoryList)
n := msgpack.PutArrayHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.HistoryList[i]
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64((*a).Serial))
if (*a).Serial == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64((*a).Serial))
data = data[11:]
}
{
n := msgpack.PutUint32(data[11:], (*a).Size)
data = data[11+n:]
n := msgpack.PutUint32(data[0:], (*a).Size)
data = data[0+n:]
}
}
}
......@@ -8155,30 +8766,69 @@ overflow:
}
func (p *ObjectUndoSerial) neoMsgEncodedLenM() int {
return 31 + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*10
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.LTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.UndoneTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*0 + size
}
func (p *ObjectUndoSerial) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 4)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.LTID))
data[21] = byte(msgpack.Bin8)
data[22] = 8
binary.BigEndian.PutUint64(data[23:], uint64(p.UndoneTID))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
if p.LTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.LTID))
data = data[10:]
}
if p.UndoneTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.UndoneTID))
data = data[10:]
}
{
l := len(p.OidList)
n := msgpack.PutArrayHead(data[31:], l)
data = data[31+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.OidList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -8227,10 +8877,10 @@ func (p *ObjectUndoSerial) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i]
......@@ -8320,7 +8970,7 @@ overflow:
}
func (p *AnswerObjectUndoSerial) neoMsgEncodedLenM() int {
return 1 + msgpack.MapHeadSize(len(p.ObjectTIDDict)) + len(p.ObjectTIDDict)*32
return 1 + msgpack.MapHeadSize(len(p.ObjectTIDDict)) + len(p.ObjectTIDDict)*2
}
func (p *AnswerObjectUndoSerial) neoMsgEncodeM(data []byte) {
......@@ -8335,18 +8985,36 @@ func (p *AnswerObjectUndoSerial) neoMsgEncodeM(data []byte) {
}
sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] })
for _, key := range keyv {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(key))
data[10] = byte(msgpack.FixArray_4 | 3)
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.ObjectTIDDict[key].CurrentSerial))
data[21] = byte(msgpack.Bin8)
data[22] = 8
binary.BigEndian.PutUint64(data[23:], uint64(p.ObjectTIDDict[key].UndoSerial))
data[31] = byte(msgpack.Bool(p.ObjectTIDDict[key].IsCurrent))
data = data[32:]
if key == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(key))
data = data[10:]
}
data[0] = byte(msgpack.FixArray_4 | 3)
if p.ObjectTIDDict[key].CurrentSerial == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.ObjectTIDDict[key].CurrentSerial))
data = data[11:]
}
if p.ObjectTIDDict[key].UndoSerial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.ObjectTIDDict[key].UndoSerial))
data = data[10:]
}
data[0] = byte(msgpack.Bool(p.ObjectTIDDict[key].IsCurrent))
data = data[1:]
}
}
}
......@@ -8373,10 +9041,10 @@ func (p *AnswerObjectUndoSerial) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*32 {
if uint64(len(data)) < uint64(l)*2 {
goto overflow
}
nread += uint64(l) * 32
nread += uint64(l) * 2
p.ObjectTIDDict = make(map[zodb.Oid]struct {
CurrentSerial zodb.Tid
UndoSerial zodb.Tid
......@@ -8472,20 +9140,43 @@ overflow:
}
func (p *AskTIDsFrom) neoMsgEncodedLenM() int {
return 21 + msgpack.Uint32Size(p.Length) + msgpack.Uint32Size(p.Partition)
var size int
if uint64(p.MinTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MaxTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.Uint32Size(p.Length) + msgpack.Uint32Size(p.Partition) + size
}
func (p *AskTIDsFrom) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 4)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.MinTID))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.MaxTID))
if p.MinTID == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.MinTID))
data = data[11:]
}
if p.MaxTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MaxTID))
data = data[10:]
}
{
n := msgpack.PutUint32(data[21:], p.Length)
data = data[21+n:]
n := msgpack.PutUint32(data[0:], p.Length)
data = data[0+n:]
}
{
n := msgpack.PutUint32(data[0:], p.Partition)
......@@ -8596,7 +9287,7 @@ overflow:
}
func (p *AnswerTIDsFrom) neoMsgEncodedLenM() int {
return 1 + msgpack.ArrayHeadSize(len(p.TidList)) + len(p.TidList)*10
return 1 + msgpack.ArrayHeadSize(len(p.TidList)) + len(p.TidList)*0
}
func (p *AnswerTIDsFrom) neoMsgEncodeM(data []byte) {
......@@ -8607,10 +9298,15 @@ func (p *AnswerTIDsFrom) neoMsgEncodeM(data []byte) {
data = data[1+n:]
for i := 0; i < l; i++ {
a := &p.TidList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -8637,10 +9333,10 @@ func (p *AnswerTIDsFrom) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.TidList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.TidList[i]
......@@ -8686,14 +9382,26 @@ overflow:
}
func (p *Pack) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *Pack) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
}
func (p *Pack) neoMsgDecodeM(data []byte) (int, error) {
......@@ -8849,7 +9557,17 @@ func (p *CheckReplicas) neoMsgEncodedLenM() int {
for key := range p.PartitionDict {
size += msgpack.Uint32Size(key) + msgpack.Int32Size(int32(p.PartitionDict[key]))
}
return 21 + msgpack.MapHeadSize(len(p.PartitionDict)) + size
if uint64(p.MinTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MaxTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.MapHeadSize(len(p.PartitionDict)) + size
}
func (p *CheckReplicas) neoMsgEncodeM(data []byte) {
......@@ -8874,12 +9592,24 @@ func (p *CheckReplicas) neoMsgEncodeM(data []byte) {
}
}
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID))
data[10] = byte(msgpack.Bin8)
data[11] = 8
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTID))
if p.MinTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID))
data = data[10:]
}
if p.MaxTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MaxTID))
data = data[10:]
}
}
func (p *CheckReplicas) neoMsgDecodeM(data []byte) (int, error) {
......@@ -9014,7 +9744,18 @@ overflow:
}
func (p *CheckPartition) neoMsgEncodedLenM() int {
return 23 + msgpack.Uint32Size(p.Partition) + msgpack.BinHeadSize(len(p.Source.UpstreamName)) + len(p.Source.UpstreamName) + msgpack.BinHeadSize(len(p.Source.Address.Host)) + len(p.Source.Address.Host) + msgpack.Uint16Size(p.Source.Address.Port)
var size int
if uint64(p.MinTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MaxTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 3 + msgpack.Uint32Size(p.Partition) + msgpack.BinHeadSize(len(p.Source.UpstreamName)) + len(p.Source.UpstreamName) + msgpack.BinHeadSize(len(p.Source.Address.Host)) + len(p.Source.Address.Host) + msgpack.Uint16Size(p.Source.Address.Port) + size
}
func (p *CheckPartition) neoMsgEncodeM(data []byte) {
......@@ -9043,12 +9784,24 @@ func (p *CheckPartition) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint16(data[0:], p.Source.Address.Port)
data = data[0+n:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID))
data[10] = byte(msgpack.Bin8)
data[11] = 8
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTID))
if p.MinTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID))
data = data[10:]
}
if p.MaxTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MaxTID))
data = data[10:]
}
}
func (p *CheckPartition) neoMsgDecodeM(data []byte) (int, error) {
......@@ -9183,7 +9936,18 @@ overflow:
}
func (p *CheckTIDRange) neoMsgEncodedLenM() int {
return 21 + msgpack.Uint32Size(p.Partition) + msgpack.Uint32Size(p.Length)
var size int
if uint64(p.MinTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MaxTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.Uint32Size(p.Partition) + msgpack.Uint32Size(p.Length) + size
}
func (p *CheckTIDRange) neoMsgEncodeM(data []byte) {
......@@ -9196,12 +9960,24 @@ func (p *CheckTIDRange) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[0:], p.Length)
data = data[0+n:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID))
data[10] = byte(msgpack.Bin8)
data[11] = 8
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTID))
if p.MinTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID))
data = data[10:]
}
if p.MaxTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MaxTID))
data = data[10:]
}
}
func (p *CheckTIDRange) neoMsgDecodeM(data []byte) (int, error) {
......@@ -9290,7 +10066,13 @@ overflow:
}
func (p *AnswerCheckTIDRange) neoMsgEncodedLenM() int {
return 33 + msgpack.Uint32Size(p.Count)
var size int
if uint64(p.MaxTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 23 + msgpack.Uint32Size(p.Count) + size
}
func (p *AnswerCheckTIDRange) neoMsgEncodeM(data []byte) {
......@@ -9302,9 +10084,15 @@ func (p *AnswerCheckTIDRange) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.Bin8)
data[1] = 20
copy(data[2:], p.Checksum[:])
data[22] = byte(msgpack.Bin8)
data[23] = 8
binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID))
if p.MaxTID == 18446744073709551615 {
data[22] = msgpack.Nil
data = data[23:]
} else {
data[22] = byte(msgpack.Bin8)
data[23] = 8
binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID))
data = data[32:]
}
}
func (p *AnswerCheckTIDRange) neoMsgDecodeM(data []byte) (int, error) {
......@@ -9388,7 +10176,23 @@ overflow:
}
func (p *CheckSerialRange) neoMsgEncodedLenM() int {
return 31 + msgpack.Uint32Size(p.Partition) + msgpack.Uint32Size(p.Length)
var size int
if uint64(p.MinTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MaxTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MinOID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.Uint32Size(p.Partition) + msgpack.Uint32Size(p.Length) + size
}
func (p *CheckSerialRange) neoMsgEncodeM(data []byte) {
......@@ -9401,15 +10205,33 @@ func (p *CheckSerialRange) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[0:], p.Length)
data = data[0+n:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID))
data[10] = byte(msgpack.Bin8)
data[11] = 8
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTID))
data[20] = byte(msgpack.Bin8)
data[21] = 8
binary.BigEndian.PutUint64(data[22:], uint64(p.MinOID))
if p.MinTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID))
data = data[10:]
}
if p.MaxTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MaxTID))
data = data[10:]
}
if p.MinOID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinOID))
data = data[10:]
}
}
func (p *CheckSerialRange) neoMsgDecodeM(data []byte) (int, error) {
......@@ -9509,7 +10331,18 @@ overflow:
}
func (p *AnswerCheckSerialRange) neoMsgEncodedLenM() int {
return 65 + msgpack.Uint32Size(p.Count)
var size int
if uint64(p.MaxTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MaxOID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 45 + msgpack.Uint32Size(p.Count) + size
}
func (p *AnswerCheckSerialRange) neoMsgEncodeM(data []byte) {
......@@ -9521,15 +10354,27 @@ func (p *AnswerCheckSerialRange) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.Bin8)
data[1] = 20
copy(data[2:], p.TidChecksum[:])
data[22] = byte(msgpack.Bin8)
data[23] = 8
binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID))
data[32] = byte(msgpack.Bin8)
data[33] = 20
copy(data[34:], p.OidChecksum[:])
data[54] = byte(msgpack.Bin8)
data[55] = 8
binary.BigEndian.PutUint64(data[56:], uint64(p.MaxOID))
if p.MaxTID == 18446744073709551615 {
data[22] = msgpack.Nil
data = data[23:]
} else {
data[22] = byte(msgpack.Bin8)
data[23] = 8
binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID))
data = data[32:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 20
copy(data[2:], p.OidChecksum[:])
if p.MaxOID == 18446744073709551615 {
data[22] = msgpack.Nil
data = data[23:]
} else {
data[22] = byte(msgpack.Bin8)
data[23] = 8
binary.BigEndian.PutUint64(data[24:], uint64(p.MaxOID))
data = data[32:]
}
}
func (p *AnswerCheckSerialRange) neoMsgDecodeM(data []byte) (int, error) {
......@@ -9839,14 +10684,26 @@ overflow:
}
func (p *AnswerLastTransaction) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *AnswerLastTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
}
func (p *AnswerLastTransaction) neoMsgDecodeM(data []byte) (int, error) {
......@@ -9906,20 +10763,54 @@ overflow:
}
func (p *CheckCurrentSerial) neoMsgEncodedLenM() int {
return 31
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Oid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Serial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *CheckCurrentSerial) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.Oid))
data[21] = byte(msgpack.Bin8)
data[22] = 8
binary.BigEndian.PutUint64(data[23:], uint64(p.Serial))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
if p.Oid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Oid))
data = data[10:]
}
if p.Serial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Serial))
data = data[10:]
}
}
func (p *CheckCurrentSerial) neoMsgDecodeM(data []byte) (int, error) {
......@@ -9989,15 +10880,27 @@ overflow:
}
func (p *AnswerCheckCurrentSerial) neoMsgEncodedLenM() int {
return 12
var size int
if uint64(p.AnswerStoreObject.Conflict) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 2 + size
}
func (p *AnswerCheckCurrentSerial) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.FixArray_4 | 1)
data[2] = byte(msgpack.Bin8)
data[3] = 8
binary.BigEndian.PutUint64(data[4:], uint64(p.AnswerStoreObject.Conflict))
if p.AnswerStoreObject.Conflict == 18446744073709551615 {
data[2] = msgpack.Nil
data = data[3:]
} else {
data[2] = byte(msgpack.Bin8)
data[3] = 8
binary.BigEndian.PutUint64(data[4:], uint64(p.AnswerStoreObject.Conflict))
data = data[12:]
}
}
func (p *AnswerCheckCurrentSerial) neoMsgDecodeM(data []byte) (int, error) {
......@@ -10065,17 +10968,40 @@ overflow:
}
func (p *NotifyTransactionFinished) neoMsgEncodedLenM() int {
return 21
var size int
if uint64(p.TTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MaxTID) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *NotifyTransactionFinished) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.MaxTID))
if p.TTID == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID))
data = data[11:]
}
if p.MaxTID == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MaxTID))
data = data[10:]
}
}
func (p *NotifyTransactionFinished) neoMsgDecodeM(data []byte) (int, error) {
......@@ -10205,21 +11131,32 @@ overflow:
func (p *Replicate) neoMsgEncodedLenM() int {
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
for key := range p.SourceDict {
size += msgpack.Uint32Size(key) + msgpack.BinHeadSize(len(p.SourceDict[key])) + len(p.SourceDict[key])
}
return 11 + msgpack.BinHeadSize(len(p.UpstreamName)) + len(p.UpstreamName) + msgpack.MapHeadSize(len(p.SourceDict)) + size
return 1 + msgpack.BinHeadSize(len(p.UpstreamName)) + len(p.UpstreamName) + msgpack.MapHeadSize(len(p.SourceDict)) + size
}
func (p *Replicate) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
{
l := len(p.UpstreamName)
n := msgpack.PutBinHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutBinHead(data[0:], l)
data = data[0+n:]
copy(data, p.UpstreamName)
data = data[l:]
}
......@@ -10345,7 +11282,13 @@ overflow:
}
func (p *ReplicationDone) neoMsgEncodedLenM() int {
return 11 + msgpack.Uint32Size(p.Offset)
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.Uint32Size(p.Offset) + size
}
func (p *ReplicationDone) neoMsgEncodeM(data []byte) {
......@@ -10354,9 +11297,15 @@ func (p *ReplicationDone) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[1:], p.Offset)
data = data[1+n:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Tid))
data = data[10:]
}
}
func (p *ReplicationDone) neoMsgDecodeM(data []byte) (int, error) {
......@@ -10456,7 +11405,18 @@ overflow:
}
func (p *FetchTransactions) neoMsgEncodedLenM() int {
return 21 + msgpack.Uint32Size(p.Partition) + msgpack.Uint32Size(p.Length) + msgpack.ArrayHeadSize(len(p.TxnKnownList)) + len(p.TxnKnownList)*10
var size int
if uint64(p.MinTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MaxTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.Uint32Size(p.Partition) + msgpack.Uint32Size(p.Length) + msgpack.ArrayHeadSize(len(p.TxnKnownList)) + len(p.TxnKnownList)*0 + size
}
func (p *FetchTransactions) neoMsgEncodeM(data []byte) {
......@@ -10469,22 +11429,39 @@ func (p *FetchTransactions) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[0:], p.Length)
data = data[0+n:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTid))
data[10] = byte(msgpack.Bin8)
data[11] = 8
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTid))
if p.MinTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTid))
data = data[10:]
}
if p.MaxTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MaxTid))
data = data[10:]
}
{
l := len(p.TxnKnownList)
n := msgpack.PutArrayHead(data[20:], l)
data = data[20+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.TxnKnownList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -10547,10 +11524,10 @@ func (p *FetchTransactions) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.TxnKnownList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.TxnKnownList[i]
......@@ -10623,27 +11600,55 @@ overflow:
}
func (p *AnswerFetchTransactions) neoMsgEncodedLenM() int {
return 21 + msgpack.ArrayHeadSize(len(p.TxnDeleteList)) + len(p.TxnDeleteList)*10
var size int
if uint64(p.PackTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.NextTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + msgpack.ArrayHeadSize(len(p.TxnDeleteList)) + len(p.TxnDeleteList)*0 + size
}
func (p *AnswerFetchTransactions) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.PackTid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.NextTid))
if p.PackTid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.PackTid))
data = data[11:]
}
if p.NextTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.NextTid))
data = data[10:]
}
{
l := len(p.TxnDeleteList)
n := msgpack.PutArrayHead(data[21:], l)
data = data[21+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.TxnDeleteList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -10685,10 +11690,10 @@ func (p *AnswerFetchTransactions) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.TxnDeleteList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.TxnDeleteList[i]
......@@ -10801,10 +11806,30 @@ overflow:
func (p *FetchObjects) neoMsgEncodedLenM() int {
var size int
if uint64(p.MinTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MaxTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.MinOid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
for key := range p.ObjKnownDict {
size += msgpack.ArrayHeadSize(len(p.ObjKnownDict[key])) + len(p.ObjKnownDict[key])*10
if uint64(key) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
size += msgpack.ArrayHeadSize(len(p.ObjKnownDict[key])) + len(p.ObjKnownDict[key])*0
}
return 31 + msgpack.Uint32Size(p.Partition) + msgpack.Uint32Size(p.Length) + msgpack.MapHeadSize(len(p.ObjKnownDict)) + len(p.ObjKnownDict)*10 + size
return 1 + msgpack.Uint32Size(p.Partition) + msgpack.Uint32Size(p.Length) + msgpack.MapHeadSize(len(p.ObjKnownDict)) + size
}
func (p *FetchObjects) neoMsgEncodeM(data []byte) {
......@@ -10817,38 +11842,67 @@ func (p *FetchObjects) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[0:], p.Length)
data = data[0+n:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTid))
data[10] = byte(msgpack.Bin8)
data[11] = 8
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTid))
data[20] = byte(msgpack.Bin8)
data[21] = 8
binary.BigEndian.PutUint64(data[22:], uint64(p.MinOid))
if p.MinTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTid))
data = data[10:]
}
if p.MaxTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MaxTid))
data = data[10:]
}
if p.MinOid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.MinOid))
data = data[10:]
}
{
l := len(p.ObjKnownDict)
n := msgpack.PutMapHead(data[30:], l)
data = data[30+n:]
n := msgpack.PutMapHead(data[0:], l)
data = data[0+n:]
keyv := make([]zodb.Tid, 0, l)
for key := range p.ObjKnownDict {
keyv = append(keyv, key)
}
sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] })
for _, key := range keyv {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(key))
if key == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(key))
data = data[10:]
}
{
l := len(p.ObjKnownDict[key])
n := msgpack.PutArrayHead(data[10:], l)
data = data[10+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.ObjKnownDict[key][i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -10943,10 +11997,10 @@ func (p *FetchObjects) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
mv = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &mv[i]
......@@ -11059,46 +12113,95 @@ overflow:
func (p *AnswerFetchObjects) neoMsgEncodedLenM() int {
var size int
if uint64(p.PackTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.NextTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.NextOid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
for key := range p.ObjDeleteDict {
size += msgpack.ArrayHeadSize(len(p.ObjDeleteDict[key])) + len(p.ObjDeleteDict[key])*10
if uint64(key) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
size += msgpack.ArrayHeadSize(len(p.ObjDeleteDict[key])) + len(p.ObjDeleteDict[key])*0
}
return 31 + msgpack.MapHeadSize(len(p.ObjDeleteDict)) + len(p.ObjDeleteDict)*10 + size
return 1 + msgpack.MapHeadSize(len(p.ObjDeleteDict)) + size
}
func (p *AnswerFetchObjects) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 4)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.PackTid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.NextTid))
data[21] = byte(msgpack.Bin8)
data[22] = 8
binary.BigEndian.PutUint64(data[23:], uint64(p.NextOid))
if p.PackTid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.PackTid))
data = data[11:]
}
if p.NextTid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.NextTid))
data = data[10:]
}
if p.NextOid == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.NextOid))
data = data[10:]
}
{
l := len(p.ObjDeleteDict)
n := msgpack.PutMapHead(data[31:], l)
data = data[31+n:]
n := msgpack.PutMapHead(data[0:], l)
data = data[0+n:]
keyv := make([]zodb.Tid, 0, l)
for key := range p.ObjDeleteDict {
keyv = append(keyv, key)
}
sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] })
for _, key := range keyv {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(key))
if key == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(key))
data = data[10:]
}
{
l := len(p.ObjDeleteDict[key])
n := msgpack.PutArrayHead(data[10:], l)
data = data[10+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.ObjDeleteDict[key][i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -11172,10 +12275,10 @@ func (p *AnswerFetchObjects) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
mv = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &mv[i]
......@@ -11305,18 +12408,35 @@ overflow:
}
func (p *AddTransaction) neoMsgEncodedLenM() int {
return 22 + msgpack.BinHeadSize(len(p.User)) + len(p.User) + msgpack.BinHeadSize(len(p.Description)) + len(p.Description) + msgpack.BinHeadSize(len(p.Extension)) + len(p.Extension) + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*10
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.TTid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 2 + msgpack.BinHeadSize(len(p.User)) + len(p.User) + msgpack.BinHeadSize(len(p.Description)) + len(p.Description) + msgpack.BinHeadSize(len(p.Extension)) + len(p.Extension) + msgpack.ArrayHeadSize(len(p.OidList)) + len(p.OidList)*0 + size
}
func (p *AddTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 7)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
{
l := len(p.User)
n := msgpack.PutBinHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutBinHead(data[0:], l)
data = data[0+n:]
copy(data, p.User)
data = data[l:]
}
......@@ -11335,19 +12455,30 @@ func (p *AddTransaction) neoMsgEncodeM(data []byte) {
data = data[l:]
}
data[0] = byte(msgpack.Bool(p.Packed))
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
if p.TTid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid))
data = data[11:]
}
{
l := len(p.OidList)
n := msgpack.PutArrayHead(data[11:], l)
data = data[11+n:]
n := msgpack.PutArrayHead(data[0:], l)
data = data[0+n:]
for i := 0; i < l; i++ {
a := &p.OidList[i]
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
if (*a) == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64((*a)))
data = data[10:]
}
}
}
}
......@@ -11428,10 +12559,10 @@ func (p *AddTransaction) neoMsgDecodeM(data []byte) (int, error) {
}
nread += uint64(len(data) - len(tail))
data = tail
if uint64(len(data)) < uint64(l)*10 {
if uint64(len(data)) < uint64(l)*0 {
goto overflow
}
nread += uint64(l) * 10
nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i]
......@@ -11504,31 +12635,65 @@ overflow:
}
func (p *AddObject) neoMsgEncodedLenM() int {
return 54 + msgpack.BinHeadSize(len(p.Data.XData())) + len(p.Data.XData())
var size int
if uint64(p.Oid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.Serial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
if uint64(p.DataSerial) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 24 + msgpack.BinHeadSize(len(p.Data.XData())) + len(p.Data.XData()) + size
}
func (p *AddObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 6)
if p.Oid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data = data[11:]
}
if p.Serial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.Serial))
data = data[10:]
}
data[0] = byte(msgpack.Bool(p.Compression))
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data[11] = byte(msgpack.Bin8)
data[12] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.Serial))
data[21] = byte(msgpack.Bool(p.Compression))
data[22] = byte(msgpack.Bin8)
data[23] = 20
copy(data[24:], p.Checksum[:])
data[2] = 20
copy(data[3:], p.Checksum[:])
{
l := len(p.Data.XData())
n := msgpack.PutBinHead(data[44:], l)
data = data[44+n:]
n := msgpack.PutBinHead(data[23:], l)
data = data[23+n:]
copy(data, p.Data.XData())
data = data[l:]
}
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.DataSerial))
if p.DataSerial == 18446744073709551615 {
data[0] = msgpack.Nil
data = data[1:]
} else {
data[0] = byte(msgpack.Bin8)
data[1] = 8
binary.BigEndian.PutUint64(data[2:], uint64(p.DataSerial))
data = data[10:]
}
}
func (p *AddObject) neoMsgDecodeM(data []byte) (int, error) {
......@@ -11628,14 +12793,26 @@ overflow:
}
func (p *Truncate) neoMsgEncodedLenM() int {
return 11
var size int
if uint64(p.Tid) == 18446744073709551615 {
size += 1 // mnil
} else {
size += 1 + 1 + 8 // mbin8 + 8 + [8]data
}
return 1 + size
}
func (p *Truncate) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
if p.Tid == 18446744073709551615 {
data[1] = msgpack.Nil
data = data[2:]
} else {
data[1] = byte(msgpack.Bin8)
data[2] = 8
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data = data[11:]
}
}
func (p *Truncate) neoMsgDecodeM(data []byte) (int, error) {
......
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