diff --git a/bridge/soulseek/messages.go b/bridge/soulseek/messages.go index 8a8332d6..80575293 100644 --- a/bridge/soulseek/messages.go +++ b/bridge/soulseek/messages.go @@ -27,6 +27,7 @@ const ( var ignoreMessageCodes = map[uint32]bool{ 7: true, + 36: true, 64: true, 69: true, 83: true, @@ -272,7 +273,7 @@ func unpackMessage[T soulseekMessage](reader io.Reader) (T, error) { return data, nil } -func readMessage(reader io.Reader) (soulseekMessage, error) { +func (b* Bsoulseek) readMessage(reader io.Reader) (soulseekMessage, error) { var length uint32 err := binary.Read(reader, binary.LittleEndian, &length) if err != nil { @@ -321,10 +322,10 @@ func readMessage(reader io.Reader) (soulseekMessage, error) { return unpackMessage[privateMessageReceive](reader) default: _, ignore := ignoreMessageCodes[code] - if ignore { - return nil, nil + if !ignore { + b.Log.Errorf("Unknown message code: %d", code) } - return nil, fmt.Errorf("Unknown message code: %d", code) + return nil, nil } } diff --git a/bridge/soulseek/soulseek.go b/bridge/soulseek/soulseek.go index 81483bf7..60b95a7e 100644 --- a/bridge/soulseek/soulseek.go +++ b/bridge/soulseek/soulseek.go @@ -37,7 +37,7 @@ func New(cfg *bridge.Config) bridge.Bridger { func (b *Bsoulseek) receiveMessages() { for { - msg, err := readMessage(b.conn) + msg, err := b.readMessage(b.conn) if err != nil { b.fatalErrors <- fmt.Errorf("Reading message failed: %s", err) return