diff --git a/pkg/dmsg/frame.go b/pkg/dmsg/frame.go index 27c7af6013..1c68fab684 100644 --- a/pkg/dmsg/frame.go +++ b/pkg/dmsg/frame.go @@ -17,11 +17,12 @@ const ( // Type returns the transport type string. Type = "dmsg" - hsTimeout = time.Second * 10 - tpBufCap = math.MaxUint16 - tpAckCap = math.MaxUint8 - acceptChSize = 20 - headerLen = 5 // fType(1 byte), chID(2 byte), payLen(2 byte) + hsTimeout = time.Second * 10 + tpBufCap = math.MaxUint16 + tpBufFrameCap = math.MaxUint8 + tpAckCap = math.MaxUint8 + acceptChSize = 20 + headerLen = 5 // fType(1 byte), chID(2 byte), payLen(2 byte) ) func isInitiatorID(tpID uint16) bool { return tpID%2 == 0 } diff --git a/pkg/dmsg/transport.go b/pkg/dmsg/transport.go index 8dd076ecd9..97095ec293 100644 --- a/pkg/dmsg/transport.go +++ b/pkg/dmsg/transport.go @@ -57,6 +57,7 @@ func NewTransport(conn net.Conn, log *logging.Logger, local, remote cipher.PubKe remote: remote, inCh: make(chan Frame), ackBuf: make([]byte, 0, tpAckCap), + buf: make(net.Buffers, 0, tpBufFrameCap), bufCh: make(chan struct{}, 1), done: make(chan struct{}), doneFunc: doneFunc,