mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-21 18:22:37 +02:00
Followup messages modification
This commit is contained in:
parent
6ae7a790f2
commit
d4eaec5cbd
@ -109,12 +109,11 @@ func MarshalTransportMsg(channelId uint16, payload []byte) []byte {
|
|||||||
return msg
|
return msg
|
||||||
}
|
}
|
||||||
|
|
||||||
func UnmarshalTransportMsg(buf []byte) (uint16, []byte, error) {
|
func UnmarshalTransportPayload(buf []byte) ([]byte, error) {
|
||||||
if len(buf) < 3 {
|
if len(buf) < 3 {
|
||||||
return 0, nil, ErrInvalidMessageLength
|
return nil, ErrInvalidMessageLength
|
||||||
}
|
}
|
||||||
channelId := uint16(buf[1])<<8 | uint16(buf[2])
|
return buf[3:], nil
|
||||||
return channelId, buf[3:], nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func UnmarshalTransportID(buf []byte) (uint16, error) {
|
func UnmarshalTransportID(buf []byte) (uint16, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user