mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-09 23:19:11 +02:00
[client] pqkem: mention *ErrorMsg in the Decode doc comment
Decode also returns *ErrorMsg for MsgError; list it so callers handling the marker are not misled. Found in cubic review on #7098 (client/internal/pqkem/message.go:95).
This commit is contained in:
@@ -92,7 +92,7 @@ func (m *ErrorMsg) Encode() []byte {
|
|||||||
return frame(MsgError, m.ExchangeID, nil)
|
return frame(MsgError, m.ExchangeID, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode parses a framed message into one of *OfferMsg / *AnswerMsg.
|
// Decode parses a framed message into one of *OfferMsg / *AnswerMsg / *ErrorMsg.
|
||||||
func Decode(buf []byte) (MsgType, any, error) {
|
func Decode(buf []byte) (MsgType, any, error) {
|
||||||
if len(buf) < headerSize {
|
if len(buf) < headerSize {
|
||||||
return 0, nil, fmt.Errorf("message too short: %d bytes", len(buf))
|
return 0, nil, fmt.Errorf("message too short: %d bytes", len(buf))
|
||||||
|
|||||||
Reference in New Issue
Block a user