From d4eaec5cbd0161234c3624786fa42b02906590cb Mon Sep 17 00:00:00 2001 From: Zoltan Papp Date: Fri, 17 May 2024 23:41:47 +0200 Subject: [PATCH] Followup messages modification --- relay/messages/message.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/relay/messages/message.go b/relay/messages/message.go index ee4947afe..a7d5452f0 100644 --- a/relay/messages/message.go +++ b/relay/messages/message.go @@ -109,12 +109,11 @@ func MarshalTransportMsg(channelId uint16, payload []byte) []byte { return msg } -func UnmarshalTransportMsg(buf []byte) (uint16, []byte, error) { +func UnmarshalTransportPayload(buf []byte) ([]byte, error) { if len(buf) < 3 { - return 0, nil, ErrInvalidMessageLength + return nil, ErrInvalidMessageLength } - channelId := uint16(buf[1])<<8 | uint16(buf[2]) - return channelId, buf[3:], nil + return buf[3:], nil } func UnmarshalTransportID(buf []byte) (uint16, error) {