From 26952067dbb4a75eab8751cdb2afeb4f67e14bb3 Mon Sep 17 00:00:00 2001 From: MacBookAirM2 Date: Thu, 23 Mar 2023 09:48:58 +0800 Subject: [PATCH] LengthField chg MaxFrameLength to uint64 --- zcode/lengthfieldframedecoder.go | 2 +- zcode/lengthfieldframeinterceptor.go | 2 +- ziface/iLengthFied.go | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zcode/lengthfieldframedecoder.go b/zcode/lengthfieldframedecoder.go index 3cc5799e..95105995 100644 --- a/zcode/lengthfieldframedecoder.go +++ b/zcode/lengthfieldframedecoder.go @@ -199,7 +199,7 @@ func NewLengthFieldFrameDecoderByLengthField(lengthField ziface.LengthField) zif } -func NewLengthFieldFrameDecoder(maxFrameLength int64, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) ziface.ILengthField { +func NewLengthFieldFrameDecoder(maxFrameLength uint64, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) ziface.ILengthField { return NewLengthFieldFrameDecoderByLengthField(ziface.LengthField{ MaxFrameLength: maxFrameLength, LengthFieldOffset: lengthFieldOffset, diff --git a/zcode/lengthfieldframeinterceptor.go b/zcode/lengthfieldframeinterceptor.go index e11de259..5978a67d 100644 --- a/zcode/lengthfieldframeinterceptor.go +++ b/zcode/lengthfieldframeinterceptor.go @@ -14,7 +14,7 @@ type LengthFieldFrameInterceptor struct { decoder ziface.ILengthField } -func NewLengthFieldFrameInterceptor(maxFrameLength int64, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) *LengthFieldFrameInterceptor { +func NewLengthFieldFrameInterceptor(maxFrameLength uint64, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) *LengthFieldFrameInterceptor { return &LengthFieldFrameInterceptor{ decoder: NewLengthFieldFrameDecoder(maxFrameLength, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip), } diff --git a/ziface/iLengthFied.go b/ziface/iLengthFied.go index 1803ab62..3387b00a 100644 --- a/ziface/iLengthFied.go +++ b/ziface/iLengthFied.go @@ -12,9 +12,9 @@ type LengthField struct { //小端模式:是指数据的高字节保存在内存的高地址中,而数据的低字节保存在内存的低地址中,高地址部分权值高,低地址部分权值低,和我们的日常逻辑方法一致。 //不了解的自行查阅一下资料 Order binary.ByteOrder - MaxFrameLength int64 //最大帧长度 - LengthFieldOffset int //长度字段偏移量 - LengthFieldLength int //长度域字段的字节数 - LengthAdjustment int //长度调整 - InitialBytesToStrip int //需要跳过的字节数 + MaxFrameLength uint64 //最大帧长度 + LengthFieldOffset int //长度字段偏移量 + LengthFieldLength int //长度域字段的字节数 + LengthAdjustment int //长度调整 + InitialBytesToStrip int //需要跳过的字节数 }