Skip to content

Commit

Permalink
LengthField chg MaxFrameLength to uint64
Browse files Browse the repository at this point in the history
  • Loading branch information
MacBookAirM2 committed Mar 23, 2023
1 parent a700397 commit 2695206
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion zcode/lengthfieldframedecoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion zcode/lengthfieldframeinterceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
10 changes: 5 additions & 5 deletions ziface/iLengthFied.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 //需要跳过的字节数
}

0 comments on commit 2695206

Please sign in to comment.