mirror of
https://github.com/soypat/lneto.git
synced 2026-09-11 17:19:30 +00:00
Add round-robin implementation (#66)
* add handler.encapsulateNode * implement round robin handler approach * simplify round robin implementation * leave TODO * internet.node touch up * fix conflict resolve f-up * replace certain ErrShortBuffer with ErrTruncatedFrame error
This commit is contained in:
+2
-2
@@ -111,13 +111,13 @@ func (op OptionCodec) ForEachOption(opts []byte, fn func(OptionKind, []byte) err
|
||||
continue
|
||||
}
|
||||
if len(opts[off:]) < 1 {
|
||||
return lneto.ErrShortBuffer
|
||||
return lneto.ErrTruncatedFrame
|
||||
}
|
||||
size := int(opts[off]) // Total option length including kind and length bytes.
|
||||
off++
|
||||
dataLen := size - 2 // Data bytes after kind and length.
|
||||
if dataLen < 0 || len(opts[off:]) < dataLen {
|
||||
return lneto.ErrShortBuffer
|
||||
return lneto.ErrTruncatedFrame
|
||||
}
|
||||
|
||||
if !skipSizeValidation {
|
||||
|
||||
Reference in New Issue
Block a user