Commit 06dda0c6 authored by Andreas Bigger's avatar Andreas Bigger

batcher config validation maxframesize

parent fb3513c0
...@@ -12,6 +12,7 @@ import ( ...@@ -12,6 +12,7 @@ import (
) )
var ( var (
ErrMaxFrameSizeZero = errors.New("max frame size cannot be zero")
ErrChannelTimeoutTooSmall = errors.New("channel timeout is less than the safety margin") ErrChannelTimeoutTooSmall = errors.New("channel timeout is less than the safety margin")
ErrInputTargetReached = errors.New("target amount of input data reached") ErrInputTargetReached = errors.New("target amount of input data reached")
ErrMaxFrameIndex = errors.New("max frame index reached (uint16)") ErrMaxFrameIndex = errors.New("max frame index reached (uint16)")
...@@ -77,6 +78,13 @@ func (cc *ChannelConfig) Check() error { ...@@ -77,6 +78,13 @@ func (cc *ChannelConfig) Check() error {
return ErrChannelTimeoutTooSmall return ErrChannelTimeoutTooSmall
} }
// If the [MaxFrameSize] is set to 0, the channel builder
// will infinitely loop when trying to create frames in the
// [channelBuilder.OutputFrames] function.
if cc.MaxFrameSize == 0 {
return ErrMaxFrameSizeZero
}
return nil return nil
} }
......
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