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 ( ...@@ -33,6 +33,8 @@ const (
FixMap_4 Op = 0b1000_0000 // 1000_XXXX FixMap_4 Op = 0b1000_0000 // 1000_XXXX
FixArray_4 Op = 0b1001_0000 // 1001_XXXX FixArray_4 Op = 0b1001_0000 // 1001_XXXX
Nil Op = 0xc0
False Op = 0xc2 False Op = 0xc2
True Op = 0xc3 True Op = 0xc3
......
...@@ -131,6 +131,13 @@ var memBuf types.Type // type of mem.Buf ...@@ -131,6 +131,13 @@ var memBuf types.Type // type of mem.Buf
// registry of enums // registry of enums
var enumRegistry = map[types.Type]int{} // type -> enum type serial 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 // bytes.Buffer + bell & whistles
type Buffer struct { type Buffer struct {
...@@ -961,10 +968,15 @@ func (s *sizerM) genBasic(path string, typ *types.Basic, userType types.Type) { ...@@ -961,10 +968,15 @@ func (s *sizerM) genBasic(path string, typ *types.Basic, userType types.Type) {
upath = fmt.Sprintf("%s(%s)", typ.Name(), upath) 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 { if userType == zodbTid || userType == zodbOid {
s.size.Add(1+1+8) // mbin8 + 8 + [8]data // INVALID_{TID,OID} must be NIL on the wire
return 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 // enums are encoded as extensions
...@@ -997,12 +1009,18 @@ func (e *encoderM) genBasic(path string, typ *types.Basic, userType types.Type) ...@@ -997,12 +1009,18 @@ func (e *encoderM) genBasic(path string, typ *types.Basic, userType types.Type)
upath = fmt.Sprintf("%s(%s)", typ.Name(), upath) 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 { 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] = byte(msgpack.Bin8)", e.n); e.n++
e.emit("data[%v] = 8", 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.emit("binary.BigEndian.PutUint64(data[%v:], uint64(%s))", e.n, path)
e.n += 8 e.n += 8
e.resetPos()
e.emit("}")
return return
} }
...@@ -1456,6 +1474,17 @@ func (e *encoderCommon) genSliceCommon(xe CodeGenCustomize, path string, typ *ty ...@@ -1456,6 +1474,17 @@ func (e *encoderCommon) genSliceCommon(xe CodeGenCustomize, path string, typ *ty
e.emit("}") 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) { func (d *decoderN) genSliceHead(assignto string, typ *types.Slice, obj types.Object) {
d.genBasic("l:", types.Typ[types.Uint32], nil) d.genBasic("l:", types.Typ[types.Uint32], nil)
} }
......
...@@ -1385,7 +1385,18 @@ overflow: ...@@ -1385,7 +1385,18 @@ overflow:
} }
func (p *AnswerRecovery) neoMsgEncodedLenM() int { 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) { func (p *AnswerRecovery) neoMsgEncodeM(data []byte) {
...@@ -1394,12 +1405,24 @@ func (p *AnswerRecovery) neoMsgEncodeM(data []byte) { ...@@ -1394,12 +1405,24 @@ func (p *AnswerRecovery) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint64(data[1:], uint64(p.PTid)) n := msgpack.PutUint64(data[1:], uint64(p.PTid))
data = data[1+n:] data = data[1+n:]
} }
data[0] = byte(msgpack.Bin8) if p.BackupTid == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.BackupTid)) data = data[1:]
data[10] = byte(msgpack.Bin8) } else {
data[11] = 8 data[0] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[12:], uint64(p.TruncateTid)) 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) { func (p *AnswerRecovery) neoMsgDecodeM(data []byte) (int, error) {
...@@ -1522,17 +1545,40 @@ overflow: ...@@ -1522,17 +1545,40 @@ overflow:
} }
func (p *AnswerLastIDs) neoMsgEncodedLenM() int { 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) { func (p *AnswerLastIDs) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.LastOid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.LastOid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.LastTid)) 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) { func (p *AnswerLastIDs) neoMsgDecodeM(data []byte) (int, error) {
...@@ -2609,25 +2655,42 @@ overflow: ...@@ -2609,25 +2655,42 @@ overflow:
} }
func (p *AnswerUnfinishedTransactions) neoMsgEncodedLenM() int { 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) { func (p *AnswerUnfinishedTransactions) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.MaxTID == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.MaxTID)) 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) l := len(p.TidList)
n := msgpack.PutArrayHead(data[11:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.TidList[i] a := &p.TidList[i]
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if (*a).UnfinishedTID == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64((*a).UnfinishedTID)) data = data[2:]
data = data[11:] } 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) { ...@@ -2662,10 +2725,10 @@ func (p *AnswerUnfinishedTransactions) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*11 { if uint64(len(data)) < uint64(l)*1 {
goto overflow goto overflow
} }
nread += uint64(l) * 11 nread += uint64(l) * 1
p.TidList = make([]struct{ UnfinishedTID zodb.Tid }, l) p.TidList = make([]struct{ UnfinishedTID zodb.Tid }, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TidList[i] a := &p.TidList[i]
...@@ -2796,7 +2859,7 @@ overflow: ...@@ -2796,7 +2859,7 @@ overflow:
} }
func (p *AnswerLockedTransactions) neoMsgEncodedLenM() int { 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) { func (p *AnswerLockedTransactions) neoMsgEncodeM(data []byte) {
...@@ -2811,13 +2874,24 @@ 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] }) sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] })
for _, key := range keyv { for _, key := range keyv {
data[0] = byte(msgpack.Bin8) if key == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(key)) data = data[1:]
data[10] = byte(msgpack.Bin8) } else {
data[11] = 8 data[0] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[12:], uint64(p.TidDict[key])) data[1] = 8
data = data[20:] 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) { ...@@ -2844,10 +2918,10 @@ func (p *AnswerLockedTransactions) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*20 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 20 nread += uint64(l) * 0
p.TidDict = make(map[zodb.Tid]zodb.Tid, l) p.TidDict = make(map[zodb.Tid]zodb.Tid, l)
m := p.TidDict m := p.TidDict
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
...@@ -2901,14 +2975,26 @@ overflow: ...@@ -2901,14 +2975,26 @@ overflow:
} }
func (p *FinalTID) neoMsgEncodedLenM() int { 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) { func (p *FinalTID) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.TTID == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID)) 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) { func (p *FinalTID) neoMsgDecodeM(data []byte) (int, error) {
...@@ -2964,14 +3050,26 @@ overflow: ...@@ -2964,14 +3050,26 @@ overflow:
} }
func (p *AnswerFinalTID) neoMsgEncodedLenM() int { 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) { func (p *AnswerFinalTID) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) { func (p *AnswerFinalTID) neoMsgDecodeM(data []byte) (int, error) {
...@@ -3029,17 +3127,40 @@ overflow: ...@@ -3029,17 +3127,40 @@ overflow:
} }
func (p *ValidateTransaction) neoMsgEncodedLenM() int { 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) { func (p *ValidateTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.TTID == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.Tid)) 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) { func (p *ValidateTransaction) neoMsgDecodeM(data []byte) (int, error) {
...@@ -3102,14 +3223,26 @@ overflow: ...@@ -3102,14 +3223,26 @@ overflow:
} }
func (p *BeginTransaction) neoMsgEncodedLenM() int { 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) { func (p *BeginTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) { func (p *BeginTransaction) neoMsgDecodeM(data []byte) (int, error) {
...@@ -3165,14 +3298,26 @@ overflow: ...@@ -3165,14 +3298,26 @@ overflow:
} }
func (p *AnswerBeginTransaction) neoMsgEncodedLenM() int { 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) { func (p *AnswerBeginTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) { func (p *AnswerBeginTransaction) neoMsgDecodeM(data []byte) (int, error) {
...@@ -3254,22 +3399,33 @@ overflow: ...@@ -3254,22 +3399,33 @@ overflow:
func (p *FailedVote) neoMsgEncodedLenM() int { func (p *FailedVote) neoMsgEncodedLenM() int {
var size 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++ { for i := 0; i < len(p.NodeList); i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
size += msgpack.Int32Size(int32((*a))) 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) { func (p *FailedVote) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) l := len(p.NodeList)
n := msgpack.PutArrayHead(data[11:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
{ {
...@@ -3405,24 +3561,41 @@ overflow: ...@@ -3405,24 +3561,41 @@ overflow:
} }
func (p *FinishTransaction) neoMsgEncodedLenM() int { 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) { func (p *FinishTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3) data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) l := len(p.OIDList)
n := msgpack.PutArrayHead(data[11:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.OIDList[i] a := &p.OIDList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -3431,10 +3604,15 @@ func (p *FinishTransaction) neoMsgEncodeM(data []byte) {
data = data[0+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.CheckedList[i] a := &p.CheckedList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -3469,10 +3647,10 @@ func (p *FinishTransaction) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.OIDList = make([]zodb.Oid, l) p.OIDList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OIDList[i] a := &p.OIDList[i]
...@@ -3493,10 +3671,10 @@ func (p *FinishTransaction) neoMsgDecodeM(data []byte) (int, error) { ...@@ -3493,10 +3671,10 @@ func (p *FinishTransaction) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.CheckedList = make([]zodb.Oid, l) p.CheckedList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.CheckedList[i] a := &p.CheckedList[i]
...@@ -3544,17 +3722,40 @@ overflow: ...@@ -3544,17 +3722,40 @@ overflow:
} }
func (p *AnswerTransactionFinished) neoMsgEncodedLenM() int { 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) { func (p *AnswerTransactionFinished) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.TTid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.Tid)) 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) { func (p *AnswerTransactionFinished) neoMsgDecodeM(data []byte) (int, error) {
...@@ -3619,17 +3820,40 @@ overflow: ...@@ -3619,17 +3820,40 @@ overflow:
} }
func (p *LockInformation) neoMsgEncodedLenM() int { 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) { func (p *LockInformation) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.Ttid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Ttid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.Tid)) 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) { func (p *LockInformation) neoMsgDecodeM(data []byte) (int, error) {
...@@ -3692,14 +3916,26 @@ overflow: ...@@ -3692,14 +3916,26 @@ overflow:
} }
func (p *AnswerInformationLocked) neoMsgEncodedLenM() int { 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) { func (p *AnswerInformationLocked) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Ttid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Ttid)) 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) { func (p *AnswerInformationLocked) neoMsgDecodeM(data []byte) (int, error) {
...@@ -3780,24 +4016,41 @@ overflow: ...@@ -3780,24 +4016,41 @@ overflow:
} }
func (p *InvalidateObjects) neoMsgEncodedLenM() int { 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) { func (p *InvalidateObjects) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) l := len(p.OidList)
n := msgpack.PutArrayHead(data[11:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -3832,10 +4085,10 @@ func (p *InvalidateObjects) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
...@@ -3881,14 +4134,26 @@ overflow: ...@@ -3881,14 +4134,26 @@ overflow:
} }
func (p *NotifyUnlockInformation) neoMsgEncodedLenM() int { 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) { func (p *NotifyUnlockInformation) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.TTID == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID)) 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) { func (p *NotifyUnlockInformation) neoMsgDecodeM(data []byte) (int, error) {
...@@ -4034,7 +4299,7 @@ overflow: ...@@ -4034,7 +4299,7 @@ overflow:
} }
func (p *AnswerNewOIDs) neoMsgEncodedLenM() int { 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) { func (p *AnswerNewOIDs) neoMsgEncodeM(data []byte) {
...@@ -4045,10 +4310,15 @@ func (p *AnswerNewOIDs) neoMsgEncodeM(data []byte) { ...@@ -4045,10 +4310,15 @@ func (p *AnswerNewOIDs) neoMsgEncodeM(data []byte) {
data = data[1+n:] data = data[1+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -4075,10 +4345,10 @@ func (p *AnswerNewOIDs) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
...@@ -4126,17 +4396,40 @@ overflow: ...@@ -4126,17 +4396,40 @@ overflow:
} }
func (p *NotifyDeadlock) neoMsgEncodedLenM() int { 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) { func (p *NotifyDeadlock) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.TTid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.LockingTid)) 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) { func (p *NotifyDeadlock) neoMsgDecodeM(data []byte) (int, error) {
...@@ -4201,17 +4494,40 @@ overflow: ...@@ -4201,17 +4494,40 @@ overflow:
} }
func (p *RebaseTransaction) neoMsgEncodedLenM() int { 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) { func (p *RebaseTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.TTid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.LockingTid)) 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) { func (p *RebaseTransaction) neoMsgDecodeM(data []byte) (int, error) {
...@@ -4297,7 +4613,7 @@ overflow: ...@@ -4297,7 +4613,7 @@ overflow:
} }
func (p *AnswerRebaseTransaction) neoMsgEncodedLenM() int { 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) { func (p *AnswerRebaseTransaction) neoMsgEncodeM(data []byte) {
...@@ -4308,10 +4624,15 @@ func (p *AnswerRebaseTransaction) neoMsgEncodeM(data []byte) { ...@@ -4308,10 +4624,15 @@ func (p *AnswerRebaseTransaction) neoMsgEncodeM(data []byte) {
data = data[1+n:] data = data[1+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -4338,10 +4659,10 @@ func (p *AnswerRebaseTransaction) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
...@@ -4389,17 +4710,40 @@ overflow: ...@@ -4389,17 +4710,40 @@ overflow:
} }
func (p *RebaseObject) neoMsgEncodedLenM() int { 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) { func (p *RebaseObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.TTid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.Oid)) 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) { func (p *RebaseObject) neoMsgDecodeM(data []byte) (int, error) {
...@@ -4487,25 +4831,48 @@ overflow: ...@@ -4487,25 +4831,48 @@ overflow:
} }
func (p *AnswerRebaseObject) neoMsgEncodedLenM() int { 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) { func (p *AnswerRebaseObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 5) 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[1] = byte(msgpack.Bin8)
data[2] = 8 data[2] = 20
binary.BigEndian.PutUint64(data[3:], uint64(p.Serial)) copy(data[3:], p.Checksum[:])
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[:])
{ {
l := len(p.Data.XData()) l := len(p.Data.XData())
n := msgpack.PutBinHead(data[44:], l) n := msgpack.PutBinHead(data[23:], l)
data = data[44+n:] data = data[23+n:]
copy(data, p.Data.XData()) copy(data, p.Data.XData())
data = data[l:] data = data[l:]
} }
...@@ -4627,34 +4994,79 @@ overflow: ...@@ -4627,34 +4994,79 @@ overflow:
} }
func (p *StoreObject) neoMsgEncodedLenM() int { 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) { func (p *StoreObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 7) 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[1] = byte(msgpack.Bin8)
data[2] = 8 data[2] = 20
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid)) copy(data[3:], p.Checksum[:])
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[:])
{ {
l := len(p.Data) l := len(p.Data)
n := msgpack.PutBinHead(data[44:], l) n := msgpack.PutBinHead(data[23:], l)
data = data[44+n:] data = data[23+n:]
copy(data, p.Data) copy(data, p.Data)
data = data[l:] data = data[l:]
} }
data[0] = byte(msgpack.Bin8) if p.DataSerial == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.DataSerial)) data = data[1:]
data[10] = byte(msgpack.Bin8) } else {
data[11] = 8 data[0] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[12:], uint64(p.Tid)) 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) { func (p *StoreObject) neoMsgDecodeM(data []byte) (int, error) {
...@@ -4761,14 +5173,26 @@ overflow: ...@@ -4761,14 +5173,26 @@ overflow:
} }
func (p *AnswerStoreObject) neoMsgEncodedLenM() int { 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) { func (p *AnswerStoreObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Conflict == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Conflict)) 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) { func (p *AnswerStoreObject) neoMsgDecodeM(data []byte) (int, error) {
...@@ -4850,22 +5274,33 @@ overflow: ...@@ -4850,22 +5274,33 @@ overflow:
func (p *AbortTransaction) neoMsgEncodedLenM() int { func (p *AbortTransaction) neoMsgEncodedLenM() int {
var size 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++ { for i := 0; i < len(p.NodeList); i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
size += msgpack.Int32Size(int32((*a))) 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) { func (p *AbortTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) l := len(p.NodeList)
n := msgpack.PutArrayHead(data[11:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
{ {
...@@ -5028,18 +5463,30 @@ overflow: ...@@ -5028,18 +5463,30 @@ overflow:
} }
func (p *StoreTransaction) neoMsgEncodedLenM() int { 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) { func (p *StoreTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 5) data[0] = byte(msgpack.FixArray_4 | 5)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) l := len(p.User)
n := msgpack.PutBinHead(data[11:], l) n := msgpack.PutBinHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
copy(data, p.User) copy(data, p.User)
data = data[l:] data = data[l:]
} }
...@@ -5063,10 +5510,15 @@ func (p *StoreTransaction) neoMsgEncodeM(data []byte) { ...@@ -5063,10 +5510,15 @@ func (p *StoreTransaction) neoMsgEncodeM(data []byte) {
data = data[0+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -5128,10 +5580,10 @@ func (p *StoreTransaction) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
...@@ -5222,14 +5674,26 @@ overflow: ...@@ -5222,14 +5674,26 @@ overflow:
} }
func (p *VoteTransaction) neoMsgEncodedLenM() int { 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) { func (p *VoteTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) { func (p *VoteTransaction) neoMsgDecodeM(data []byte) (int, error) {
...@@ -5334,20 +5798,54 @@ overflow: ...@@ -5334,20 +5798,54 @@ overflow:
} }
func (p *GetObject) neoMsgEncodedLenM() int { 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) { func (p *GetObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3) data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8) if p.Oid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.At)) data[2] = 8
data[21] = byte(msgpack.Bin8) binary.BigEndian.PutUint64(data[3:], uint64(p.Oid))
data[22] = 8 data = data[11:]
binary.BigEndian.PutUint64(data[23:], uint64(p.Before)) }
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) { func (p *GetObject) neoMsgDecodeM(data []byte) (int, error) {
...@@ -5446,34 +5944,79 @@ overflow: ...@@ -5446,34 +5944,79 @@ overflow:
} }
func (p *AnswerObject) neoMsgEncodedLenM() int { 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) { func (p *AnswerObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 7) 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[1] = byte(msgpack.Bin8)
data[2] = 8 data[2] = 20
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid)) copy(data[3:], p.Checksum[:])
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[:])
{ {
l := len(p.Data.XData()) l := len(p.Data.XData())
n := msgpack.PutBinHead(data[54:], l) n := msgpack.PutBinHead(data[23:], l)
data = data[54+n:] data = data[23+n:]
copy(data, p.Data.XData()) copy(data, p.Data.XData())
data = data[l:] data = data[l:]
} }
data[0] = byte(msgpack.Bin8) if p.DataSerial == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.DataSerial)) 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) { func (p *AnswerObject) neoMsgDecodeM(data []byte) (int, error) {
...@@ -5700,7 +6243,7 @@ overflow: ...@@ -5700,7 +6243,7 @@ overflow:
} }
func (p *AnswerTIDs) neoMsgEncodedLenM() int { 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) { func (p *AnswerTIDs) neoMsgEncodeM(data []byte) {
...@@ -5711,10 +6254,15 @@ func (p *AnswerTIDs) neoMsgEncodeM(data []byte) { ...@@ -5711,10 +6254,15 @@ func (p *AnswerTIDs) neoMsgEncodeM(data []byte) {
data = data[1+n:] data = data[1+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.TIDList[i] a := &p.TIDList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -5741,10 +6289,10 @@ func (p *AnswerTIDs) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.TIDList = make([]zodb.Tid, l) p.TIDList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TIDList[i] a := &p.TIDList[i]
...@@ -5790,14 +6338,26 @@ overflow: ...@@ -5790,14 +6338,26 @@ overflow:
} }
func (p *TransactionInformation) neoMsgEncodedLenM() int { 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) { func (p *TransactionInformation) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) { func (p *TransactionInformation) neoMsgDecodeM(data []byte) (int, error) {
...@@ -5931,18 +6491,30 @@ overflow: ...@@ -5931,18 +6491,30 @@ overflow:
} }
func (p *AnswerTransactionInformation) neoMsgEncodedLenM() int { 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) { func (p *AnswerTransactionInformation) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 6) data[0] = byte(msgpack.FixArray_4 | 6)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) l := len(p.User)
n := msgpack.PutBinHead(data[11:], l) n := msgpack.PutBinHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
copy(data, p.User) copy(data, p.User)
data = data[l:] data = data[l:]
} }
...@@ -5967,10 +6539,15 @@ func (p *AnswerTransactionInformation) neoMsgEncodeM(data []byte) { ...@@ -5967,10 +6539,15 @@ func (p *AnswerTransactionInformation) neoMsgEncodeM(data []byte) {
data = data[1+n:] data = data[1+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -6044,10 +6621,10 @@ func (p *AnswerTransactionInformation) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
...@@ -6097,17 +6674,29 @@ overflow: ...@@ -6097,17 +6674,29 @@ overflow:
} }
func (p *ObjectHistory) neoMsgEncodedLenM() int { 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) { func (p *ObjectHistory) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3) data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8) if p.Oid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid)) 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) n := msgpack.PutUint64(data[0:], p.First)
data = data[11+n:] data = data[0+n:]
} }
{ {
n := msgpack.PutUint64(data[0:], p.Last) n := msgpack.PutUint64(data[0:], p.Last)
...@@ -6219,31 +6808,53 @@ overflow: ...@@ -6219,31 +6808,53 @@ overflow:
func (p *AnswerObjectHistory) neoMsgEncodedLenM() int { func (p *AnswerObjectHistory) neoMsgEncodedLenM() int {
var size 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++ { for i := 0; i < len(p.HistoryList); i++ {
a := &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) 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) { func (p *AnswerObjectHistory) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.Oid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid)) 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) l := len(p.HistoryList)
n := msgpack.PutArrayHead(data[11:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.HistoryList[i] a := &p.HistoryList[i]
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if (*a).Serial == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64((*a).Serial)) 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) n := msgpack.PutUint32(data[0:], (*a).Size)
data = data[11+n:] data = data[0+n:]
} }
} }
} }
...@@ -8155,30 +8766,69 @@ overflow: ...@@ -8155,30 +8766,69 @@ overflow:
} }
func (p *ObjectUndoSerial) neoMsgEncodedLenM() int { 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) { func (p *ObjectUndoSerial) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 4) data[0] = byte(msgpack.FixArray_4 | 4)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.LTID)) data[2] = 8
data[21] = byte(msgpack.Bin8) binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data[22] = 8 data = data[11:]
binary.BigEndian.PutUint64(data[23:], uint64(p.UndoneTID)) }
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) l := len(p.OidList)
n := msgpack.PutArrayHead(data[31:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[31+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -8227,10 +8877,10 @@ func (p *ObjectUndoSerial) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
...@@ -8320,7 +8970,7 @@ overflow: ...@@ -8320,7 +8970,7 @@ overflow:
} }
func (p *AnswerObjectUndoSerial) neoMsgEncodedLenM() int { 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) { func (p *AnswerObjectUndoSerial) neoMsgEncodeM(data []byte) {
...@@ -8335,18 +8985,36 @@ 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] }) sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] })
for _, key := range keyv { for _, key := range keyv {
data[0] = byte(msgpack.Bin8) if key == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(key)) data = data[1:]
data[10] = byte(msgpack.FixArray_4 | 3) } else {
data[11] = byte(msgpack.Bin8) data[0] = byte(msgpack.Bin8)
data[12] = 8 data[1] = 8
binary.BigEndian.PutUint64(data[13:], uint64(p.ObjectTIDDict[key].CurrentSerial)) binary.BigEndian.PutUint64(data[2:], uint64(key))
data[21] = byte(msgpack.Bin8) data = data[10:]
data[22] = 8 }
binary.BigEndian.PutUint64(data[23:], uint64(p.ObjectTIDDict[key].UndoSerial)) data[0] = byte(msgpack.FixArray_4 | 3)
data[31] = byte(msgpack.Bool(p.ObjectTIDDict[key].IsCurrent)) if p.ObjectTIDDict[key].CurrentSerial == 18446744073709551615 {
data = data[32:] 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) { ...@@ -8373,10 +9041,10 @@ func (p *AnswerObjectUndoSerial) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*32 { if uint64(len(data)) < uint64(l)*2 {
goto overflow goto overflow
} }
nread += uint64(l) * 32 nread += uint64(l) * 2
p.ObjectTIDDict = make(map[zodb.Oid]struct { p.ObjectTIDDict = make(map[zodb.Oid]struct {
CurrentSerial zodb.Tid CurrentSerial zodb.Tid
UndoSerial zodb.Tid UndoSerial zodb.Tid
...@@ -8472,20 +9140,43 @@ overflow: ...@@ -8472,20 +9140,43 @@ overflow:
} }
func (p *AskTIDsFrom) neoMsgEncodedLenM() int { 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) { func (p *AskTIDsFrom) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 4) data[0] = byte(msgpack.FixArray_4 | 4)
data[1] = byte(msgpack.Bin8) if p.MinTID == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.MinTID)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.MaxTID)) 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) n := msgpack.PutUint32(data[0:], p.Length)
data = data[21+n:] data = data[0+n:]
} }
{ {
n := msgpack.PutUint32(data[0:], p.Partition) n := msgpack.PutUint32(data[0:], p.Partition)
...@@ -8596,7 +9287,7 @@ overflow: ...@@ -8596,7 +9287,7 @@ overflow:
} }
func (p *AnswerTIDsFrom) neoMsgEncodedLenM() int { 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) { func (p *AnswerTIDsFrom) neoMsgEncodeM(data []byte) {
...@@ -8607,10 +9298,15 @@ func (p *AnswerTIDsFrom) neoMsgEncodeM(data []byte) { ...@@ -8607,10 +9298,15 @@ func (p *AnswerTIDsFrom) neoMsgEncodeM(data []byte) {
data = data[1+n:] data = data[1+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.TidList[i] a := &p.TidList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -8637,10 +9333,10 @@ func (p *AnswerTIDsFrom) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.TidList = make([]zodb.Tid, l) p.TidList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TidList[i] a := &p.TidList[i]
...@@ -8686,14 +9382,26 @@ overflow: ...@@ -8686,14 +9382,26 @@ overflow:
} }
func (p *Pack) neoMsgEncodedLenM() int { 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) { func (p *Pack) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) { func (p *Pack) neoMsgDecodeM(data []byte) (int, error) {
...@@ -8849,7 +9557,17 @@ func (p *CheckReplicas) neoMsgEncodedLenM() int { ...@@ -8849,7 +9557,17 @@ func (p *CheckReplicas) neoMsgEncodedLenM() int {
for key := range p.PartitionDict { for key := range p.PartitionDict {
size += msgpack.Uint32Size(key) + msgpack.Int32Size(int32(p.PartitionDict[key])) 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) { func (p *CheckReplicas) neoMsgEncodeM(data []byte) {
...@@ -8874,12 +9592,24 @@ func (p *CheckReplicas) neoMsgEncodeM(data []byte) { ...@@ -8874,12 +9592,24 @@ func (p *CheckReplicas) neoMsgEncodeM(data []byte) {
} }
} }
} }
data[0] = byte(msgpack.Bin8) if p.MinTID == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID)) data = data[1:]
data[10] = byte(msgpack.Bin8) } else {
data[11] = 8 data[0] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTID)) 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) { func (p *CheckReplicas) neoMsgDecodeM(data []byte) (int, error) {
...@@ -9014,7 +9744,18 @@ overflow: ...@@ -9014,7 +9744,18 @@ overflow:
} }
func (p *CheckPartition) neoMsgEncodedLenM() int { 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) { func (p *CheckPartition) neoMsgEncodeM(data []byte) {
...@@ -9043,12 +9784,24 @@ 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) n := msgpack.PutUint16(data[0:], p.Source.Address.Port)
data = data[0+n:] data = data[0+n:]
} }
data[0] = byte(msgpack.Bin8) if p.MinTID == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID)) data = data[1:]
data[10] = byte(msgpack.Bin8) } else {
data[11] = 8 data[0] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTID)) 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) { func (p *CheckPartition) neoMsgDecodeM(data []byte) (int, error) {
...@@ -9183,7 +9936,18 @@ overflow: ...@@ -9183,7 +9936,18 @@ overflow:
} }
func (p *CheckTIDRange) neoMsgEncodedLenM() int { 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) { func (p *CheckTIDRange) neoMsgEncodeM(data []byte) {
...@@ -9196,12 +9960,24 @@ func (p *CheckTIDRange) neoMsgEncodeM(data []byte) { ...@@ -9196,12 +9960,24 @@ func (p *CheckTIDRange) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[0:], p.Length) n := msgpack.PutUint32(data[0:], p.Length)
data = data[0+n:] data = data[0+n:]
} }
data[0] = byte(msgpack.Bin8) if p.MinTID == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID)) data = data[1:]
data[10] = byte(msgpack.Bin8) } else {
data[11] = 8 data[0] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTID)) 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) { func (p *CheckTIDRange) neoMsgDecodeM(data []byte) (int, error) {
...@@ -9290,7 +10066,13 @@ overflow: ...@@ -9290,7 +10066,13 @@ overflow:
} }
func (p *AnswerCheckTIDRange) neoMsgEncodedLenM() int { 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) { func (p *AnswerCheckTIDRange) neoMsgEncodeM(data []byte) {
...@@ -9302,9 +10084,15 @@ func (p *AnswerCheckTIDRange) neoMsgEncodeM(data []byte) { ...@@ -9302,9 +10084,15 @@ func (p *AnswerCheckTIDRange) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.Bin8) data[0] = byte(msgpack.Bin8)
data[1] = 20 data[1] = 20
copy(data[2:], p.Checksum[:]) copy(data[2:], p.Checksum[:])
data[22] = byte(msgpack.Bin8) if p.MaxTID == 18446744073709551615 {
data[23] = 8 data[22] = msgpack.Nil
binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID)) 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) { func (p *AnswerCheckTIDRange) neoMsgDecodeM(data []byte) (int, error) {
...@@ -9388,7 +10176,23 @@ overflow: ...@@ -9388,7 +10176,23 @@ overflow:
} }
func (p *CheckSerialRange) neoMsgEncodedLenM() int { 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) { func (p *CheckSerialRange) neoMsgEncodeM(data []byte) {
...@@ -9401,15 +10205,33 @@ func (p *CheckSerialRange) neoMsgEncodeM(data []byte) { ...@@ -9401,15 +10205,33 @@ func (p *CheckSerialRange) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[0:], p.Length) n := msgpack.PutUint32(data[0:], p.Length)
data = data[0+n:] data = data[0+n:]
} }
data[0] = byte(msgpack.Bin8) if p.MinTID == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID)) data = data[1:]
data[10] = byte(msgpack.Bin8) } else {
data[11] = 8 data[0] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTID)) data[1] = 8
data[20] = byte(msgpack.Bin8) binary.BigEndian.PutUint64(data[2:], uint64(p.MinTID))
data[21] = 8 data = data[10:]
binary.BigEndian.PutUint64(data[22:], uint64(p.MinOID)) }
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) { func (p *CheckSerialRange) neoMsgDecodeM(data []byte) (int, error) {
...@@ -9509,7 +10331,18 @@ overflow: ...@@ -9509,7 +10331,18 @@ overflow:
} }
func (p *AnswerCheckSerialRange) neoMsgEncodedLenM() int { 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) { func (p *AnswerCheckSerialRange) neoMsgEncodeM(data []byte) {
...@@ -9521,15 +10354,27 @@ func (p *AnswerCheckSerialRange) neoMsgEncodeM(data []byte) { ...@@ -9521,15 +10354,27 @@ func (p *AnswerCheckSerialRange) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.Bin8) data[0] = byte(msgpack.Bin8)
data[1] = 20 data[1] = 20
copy(data[2:], p.TidChecksum[:]) copy(data[2:], p.TidChecksum[:])
data[22] = byte(msgpack.Bin8) if p.MaxTID == 18446744073709551615 {
data[23] = 8 data[22] = msgpack.Nil
binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID)) data = data[23:]
data[32] = byte(msgpack.Bin8) } else {
data[33] = 20 data[22] = byte(msgpack.Bin8)
copy(data[34:], p.OidChecksum[:]) data[23] = 8
data[54] = byte(msgpack.Bin8) binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID))
data[55] = 8 data = data[32:]
binary.BigEndian.PutUint64(data[56:], uint64(p.MaxOID)) }
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) { func (p *AnswerCheckSerialRange) neoMsgDecodeM(data []byte) (int, error) {
...@@ -9839,14 +10684,26 @@ overflow: ...@@ -9839,14 +10684,26 @@ overflow:
} }
func (p *AnswerLastTransaction) neoMsgEncodedLenM() int { 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) { func (p *AnswerLastTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) { func (p *AnswerLastTransaction) neoMsgDecodeM(data []byte) (int, error) {
...@@ -9906,20 +10763,54 @@ overflow: ...@@ -9906,20 +10763,54 @@ overflow:
} }
func (p *CheckCurrentSerial) neoMsgEncodedLenM() int { 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) { func (p *CheckCurrentSerial) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3) data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.Oid)) data[2] = 8
data[21] = byte(msgpack.Bin8) binary.BigEndian.PutUint64(data[3:], uint64(p.Tid))
data[22] = 8 data = data[11:]
binary.BigEndian.PutUint64(data[23:], uint64(p.Serial)) }
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) { func (p *CheckCurrentSerial) neoMsgDecodeM(data []byte) (int, error) {
...@@ -9989,15 +10880,27 @@ overflow: ...@@ -9989,15 +10880,27 @@ overflow:
} }
func (p *AnswerCheckCurrentSerial) neoMsgEncodedLenM() int { 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) { func (p *AnswerCheckCurrentSerial) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.FixArray_4 | 1) data[1] = byte(msgpack.FixArray_4 | 1)
data[2] = byte(msgpack.Bin8) if p.AnswerStoreObject.Conflict == 18446744073709551615 {
data[3] = 8 data[2] = msgpack.Nil
binary.BigEndian.PutUint64(data[4:], uint64(p.AnswerStoreObject.Conflict)) 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) { func (p *AnswerCheckCurrentSerial) neoMsgDecodeM(data []byte) (int, error) {
...@@ -10065,17 +10968,40 @@ overflow: ...@@ -10065,17 +10968,40 @@ overflow:
} }
func (p *NotifyTransactionFinished) neoMsgEncodedLenM() int { 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) { func (p *NotifyTransactionFinished) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 2) data[0] = byte(msgpack.FixArray_4 | 2)
data[1] = byte(msgpack.Bin8) if p.TTID == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.TTID)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.MaxTID)) 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) { func (p *NotifyTransactionFinished) neoMsgDecodeM(data []byte) (int, error) {
...@@ -10205,21 +11131,32 @@ overflow: ...@@ -10205,21 +11131,32 @@ overflow:
func (p *Replicate) neoMsgEncodedLenM() int { func (p *Replicate) neoMsgEncodedLenM() int {
var size 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 { for key := range p.SourceDict {
size += msgpack.Uint32Size(key) + msgpack.BinHeadSize(len(p.SourceDict[key])) + len(p.SourceDict[key]) 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) { func (p *Replicate) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3) data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) l := len(p.UpstreamName)
n := msgpack.PutBinHead(data[11:], l) n := msgpack.PutBinHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
copy(data, p.UpstreamName) copy(data, p.UpstreamName)
data = data[l:] data = data[l:]
} }
...@@ -10345,7 +11282,13 @@ overflow: ...@@ -10345,7 +11282,13 @@ overflow:
} }
func (p *ReplicationDone) neoMsgEncodedLenM() int { 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) { func (p *ReplicationDone) neoMsgEncodeM(data []byte) {
...@@ -10354,9 +11297,15 @@ func (p *ReplicationDone) neoMsgEncodeM(data []byte) { ...@@ -10354,9 +11297,15 @@ func (p *ReplicationDone) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[1:], p.Offset) n := msgpack.PutUint32(data[1:], p.Offset)
data = data[1+n:] data = data[1+n:]
} }
data[0] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.Tid)) 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) { func (p *ReplicationDone) neoMsgDecodeM(data []byte) (int, error) {
...@@ -10456,7 +11405,18 @@ overflow: ...@@ -10456,7 +11405,18 @@ overflow:
} }
func (p *FetchTransactions) neoMsgEncodedLenM() int { 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) { func (p *FetchTransactions) neoMsgEncodeM(data []byte) {
...@@ -10469,22 +11429,39 @@ func (p *FetchTransactions) neoMsgEncodeM(data []byte) { ...@@ -10469,22 +11429,39 @@ func (p *FetchTransactions) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[0:], p.Length) n := msgpack.PutUint32(data[0:], p.Length)
data = data[0+n:] data = data[0+n:]
} }
data[0] = byte(msgpack.Bin8) if p.MinTid == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTid)) data = data[1:]
data[10] = byte(msgpack.Bin8) } else {
data[11] = 8 data[0] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTid)) 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) l := len(p.TxnKnownList)
n := msgpack.PutArrayHead(data[20:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[20+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.TxnKnownList[i] a := &p.TxnKnownList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -10547,10 +11524,10 @@ func (p *FetchTransactions) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.TxnKnownList = make([]zodb.Tid, l) p.TxnKnownList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TxnKnownList[i] a := &p.TxnKnownList[i]
...@@ -10623,27 +11600,55 @@ overflow: ...@@ -10623,27 +11600,55 @@ overflow:
} }
func (p *AnswerFetchTransactions) neoMsgEncodedLenM() int { 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) { func (p *AnswerFetchTransactions) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 3) data[0] = byte(msgpack.FixArray_4 | 3)
data[1] = byte(msgpack.Bin8) if p.PackTid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.PackTid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.NextTid)) 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) l := len(p.TxnDeleteList)
n := msgpack.PutArrayHead(data[21:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[21+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.TxnDeleteList[i] a := &p.TxnDeleteList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -10685,10 +11690,10 @@ func (p *AnswerFetchTransactions) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.TxnDeleteList = make([]zodb.Tid, l) p.TxnDeleteList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TxnDeleteList[i] a := &p.TxnDeleteList[i]
...@@ -10801,10 +11806,30 @@ overflow: ...@@ -10801,10 +11806,30 @@ overflow:
func (p *FetchObjects) neoMsgEncodedLenM() int { func (p *FetchObjects) neoMsgEncodedLenM() int {
var size 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 { 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) { func (p *FetchObjects) neoMsgEncodeM(data []byte) {
...@@ -10817,38 +11842,67 @@ func (p *FetchObjects) neoMsgEncodeM(data []byte) { ...@@ -10817,38 +11842,67 @@ func (p *FetchObjects) neoMsgEncodeM(data []byte) {
n := msgpack.PutUint32(data[0:], p.Length) n := msgpack.PutUint32(data[0:], p.Length)
data = data[0+n:] data = data[0+n:]
} }
data[0] = byte(msgpack.Bin8) if p.MinTid == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.MinTid)) data = data[1:]
data[10] = byte(msgpack.Bin8) } else {
data[11] = 8 data[0] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[12:], uint64(p.MaxTid)) data[1] = 8
data[20] = byte(msgpack.Bin8) binary.BigEndian.PutUint64(data[2:], uint64(p.MinTid))
data[21] = 8 data = data[10:]
binary.BigEndian.PutUint64(data[22:], uint64(p.MinOid)) }
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) l := len(p.ObjKnownDict)
n := msgpack.PutMapHead(data[30:], l) n := msgpack.PutMapHead(data[0:], l)
data = data[30+n:] data = data[0+n:]
keyv := make([]zodb.Tid, 0, l) keyv := make([]zodb.Tid, 0, l)
for key := range p.ObjKnownDict { for key := range p.ObjKnownDict {
keyv = append(keyv, key) keyv = append(keyv, key)
} }
sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] }) sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] })
for _, key := range keyv { for _, key := range keyv {
data[0] = byte(msgpack.Bin8) if key == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(key)) 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]) l := len(p.ObjKnownDict[key])
n := msgpack.PutArrayHead(data[10:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[10+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.ObjKnownDict[key][i] a := &p.ObjKnownDict[key][i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -10943,10 +11997,10 @@ func (p *FetchObjects) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
mv = make([]zodb.Oid, l) mv = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &mv[i] a := &mv[i]
...@@ -11059,46 +12113,95 @@ overflow: ...@@ -11059,46 +12113,95 @@ overflow:
func (p *AnswerFetchObjects) neoMsgEncodedLenM() int { func (p *AnswerFetchObjects) neoMsgEncodedLenM() int {
var size 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 { 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) { func (p *AnswerFetchObjects) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 4) data[0] = byte(msgpack.FixArray_4 | 4)
data[1] = byte(msgpack.Bin8) if p.PackTid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.PackTid)) data = data[2:]
data[11] = byte(msgpack.Bin8) } else {
data[12] = 8 data[1] = byte(msgpack.Bin8)
binary.BigEndian.PutUint64(data[13:], uint64(p.NextTid)) data[2] = 8
data[21] = byte(msgpack.Bin8) binary.BigEndian.PutUint64(data[3:], uint64(p.PackTid))
data[22] = 8 data = data[11:]
binary.BigEndian.PutUint64(data[23:], uint64(p.NextOid)) }
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) l := len(p.ObjDeleteDict)
n := msgpack.PutMapHead(data[31:], l) n := msgpack.PutMapHead(data[0:], l)
data = data[31+n:] data = data[0+n:]
keyv := make([]zodb.Tid, 0, l) keyv := make([]zodb.Tid, 0, l)
for key := range p.ObjDeleteDict { for key := range p.ObjDeleteDict {
keyv = append(keyv, key) keyv = append(keyv, key)
} }
sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] }) sort.Slice(keyv, func(i, j int) bool { return keyv[i] < keyv[j] })
for _, key := range keyv { for _, key := range keyv {
data[0] = byte(msgpack.Bin8) if key == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(key)) 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]) l := len(p.ObjDeleteDict[key])
n := msgpack.PutArrayHead(data[10:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[10+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.ObjDeleteDict[key][i] a := &p.ObjDeleteDict[key][i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -11172,10 +12275,10 @@ func (p *AnswerFetchObjects) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
mv = make([]zodb.Oid, l) mv = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &mv[i] a := &mv[i]
...@@ -11305,18 +12408,35 @@ overflow: ...@@ -11305,18 +12408,35 @@ overflow:
} }
func (p *AddTransaction) neoMsgEncodedLenM() int { 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) { func (p *AddTransaction) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 7) data[0] = byte(msgpack.FixArray_4 | 7)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) l := len(p.User)
n := msgpack.PutBinHead(data[11:], l) n := msgpack.PutBinHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
copy(data, p.User) copy(data, p.User)
data = data[l:] data = data[l:]
} }
...@@ -11335,19 +12455,30 @@ func (p *AddTransaction) neoMsgEncodeM(data []byte) { ...@@ -11335,19 +12455,30 @@ func (p *AddTransaction) neoMsgEncodeM(data []byte) {
data = data[l:] data = data[l:]
} }
data[0] = byte(msgpack.Bool(p.Packed)) data[0] = byte(msgpack.Bool(p.Packed))
data[1] = byte(msgpack.Bin8) if p.TTid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.TTid)) 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) l := len(p.OidList)
n := msgpack.PutArrayHead(data[11:], l) n := msgpack.PutArrayHead(data[0:], l)
data = data[11+n:] data = data[0+n:]
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
data[0] = byte(msgpack.Bin8) if (*a) == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64((*a))) data = data[1:]
data = data[10:] } 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) { ...@@ -11428,10 +12559,10 @@ func (p *AddTransaction) neoMsgDecodeM(data []byte) (int, error) {
} }
nread += uint64(len(data) - len(tail)) nread += uint64(len(data) - len(tail))
data = tail data = tail
if uint64(len(data)) < uint64(l)*10 { if uint64(len(data)) < uint64(l)*0 {
goto overflow goto overflow
} }
nread += uint64(l) * 10 nread += uint64(l) * 0
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
...@@ -11504,31 +12635,65 @@ overflow: ...@@ -11504,31 +12635,65 @@ overflow:
} }
func (p *AddObject) neoMsgEncodedLenM() int { 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) { func (p *AddObject) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 6) 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[1] = byte(msgpack.Bin8)
data[2] = 8 data[2] = 20
binary.BigEndian.PutUint64(data[3:], uint64(p.Oid)) copy(data[3:], p.Checksum[:])
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[:])
{ {
l := len(p.Data.XData()) l := len(p.Data.XData())
n := msgpack.PutBinHead(data[44:], l) n := msgpack.PutBinHead(data[23:], l)
data = data[44+n:] data = data[23+n:]
copy(data, p.Data.XData()) copy(data, p.Data.XData())
data = data[l:] data = data[l:]
} }
data[0] = byte(msgpack.Bin8) if p.DataSerial == 18446744073709551615 {
data[1] = 8 data[0] = msgpack.Nil
binary.BigEndian.PutUint64(data[2:], uint64(p.DataSerial)) 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) { func (p *AddObject) neoMsgDecodeM(data []byte) (int, error) {
...@@ -11628,14 +12793,26 @@ overflow: ...@@ -11628,14 +12793,26 @@ overflow:
} }
func (p *Truncate) neoMsgEncodedLenM() int { 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) { func (p *Truncate) neoMsgEncodeM(data []byte) {
data[0] = byte(msgpack.FixArray_4 | 1) data[0] = byte(msgpack.FixArray_4 | 1)
data[1] = byte(msgpack.Bin8) if p.Tid == 18446744073709551615 {
data[2] = 8 data[1] = msgpack.Nil
binary.BigEndian.PutUint64(data[3:], uint64(p.Tid)) 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) { 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