Skip to content

Commit 2695206

Browse files
author
MacBookAirM2
committed
LengthField chg MaxFrameLength to uint64
1 parent a700397 commit 2695206

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

zcode/lengthfieldframedecoder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func NewLengthFieldFrameDecoderByLengthField(lengthField ziface.LengthField) zif
199199

200200
}
201201

202-
func NewLengthFieldFrameDecoder(maxFrameLength int64, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) ziface.ILengthField {
202+
func NewLengthFieldFrameDecoder(maxFrameLength uint64, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) ziface.ILengthField {
203203
return NewLengthFieldFrameDecoderByLengthField(ziface.LengthField{
204204
MaxFrameLength: maxFrameLength,
205205
LengthFieldOffset: lengthFieldOffset,

zcode/lengthfieldframeinterceptor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type LengthFieldFrameInterceptor struct {
1414
decoder ziface.ILengthField
1515
}
1616

17-
func NewLengthFieldFrameInterceptor(maxFrameLength int64, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) *LengthFieldFrameInterceptor {
17+
func NewLengthFieldFrameInterceptor(maxFrameLength uint64, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) *LengthFieldFrameInterceptor {
1818
return &LengthFieldFrameInterceptor{
1919
decoder: NewLengthFieldFrameDecoder(maxFrameLength, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip),
2020
}

ziface/iLengthFied.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ type LengthField struct {
1212
//小端模式:是指数据的高字节保存在内存的高地址中,而数据的低字节保存在内存的低地址中,高地址部分权值高,低地址部分权值低,和我们的日常逻辑方法一致。
1313
//不了解的自行查阅一下资料
1414
Order binary.ByteOrder
15-
MaxFrameLength int64 //最大帧长度
16-
LengthFieldOffset int //长度字段偏移量
17-
LengthFieldLength int //长度域字段的字节数
18-
LengthAdjustment int //长度调整
19-
InitialBytesToStrip int //需要跳过的字节数
15+
MaxFrameLength uint64 //最大帧长度
16+
LengthFieldOffset int //长度字段偏移量
17+
LengthFieldLength int //长度域字段的字节数
18+
LengthAdjustment int //长度调整
19+
InitialBytesToStrip int //需要跳过的字节数
2020
}

0 commit comments

Comments
 (0)