mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-09-26 21:01:14 +08:00
fix(mcast-backend): code conciseness
Signed-off-by: Adam Rizkalla <ajarizzo@gmail.com>
This commit is contained in:

committed by
Steffen Vogel

parent
c1050496db
commit
7a00daf405
@@ -5,6 +5,7 @@ package mcast
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"syscall"
|
||||
@@ -75,14 +76,13 @@ func NewBackend(cfg *signaling.BackendConfig, logger *log.Logger) (signaling.Bac
|
||||
}
|
||||
|
||||
var env signalingproto.Envelope
|
||||
err = proto.Unmarshal(buf[:n], &env)
|
||||
if err != nil {
|
||||
if err = proto.Unmarshal(buf[:n], &env); err != nil {
|
||||
b.logger.Error("Error unmarshaling protobuf", zap.Error(err))
|
||||
continue
|
||||
}
|
||||
|
||||
if err := b.SubscriptionsRegistry.NewMessage(&env); err != nil {
|
||||
if err == signaling.ErrNotSubscribed {
|
||||
if errors.Is(err, signaling.ErrNotSubscribed) {
|
||||
// Message wasn't for us but we will get everything over multicast, just ignore it.
|
||||
} else {
|
||||
b.logger.Error("Failed to decrypt message", zap.Error(err))
|
||||
|
Reference in New Issue
Block a user