serve dlna: fix panic: Logger uninitialized.

Before this change we forgot to initialize the logger for the dlna
server. This meant when it needed to log something, it paniced
instead.

See: https://forum.rclone.org/t/rclone-serve-dlna-after-few-hours-of-idle-running-panic-logger-uninitialized-names/34835
This commit is contained in:
Nick Craig-Wood 2022-12-16 14:32:39 +00:00
parent 3a6f1f5cd7
commit 614d79121a

View File

@ -17,6 +17,7 @@ import (
"github.com/anacrolix/dms/soap" "github.com/anacrolix/dms/soap"
"github.com/anacrolix/dms/ssdp" "github.com/anacrolix/dms/ssdp"
"github.com/anacrolix/dms/upnp" "github.com/anacrolix/dms/upnp"
"github.com/anacrolix/log"
"github.com/rclone/rclone/cmd" "github.com/rclone/rclone/cmd"
"github.com/rclone/rclone/cmd/serve/dlna/data" "github.com/rclone/rclone/cmd/serve/dlna/data"
"github.com/rclone/rclone/cmd/serve/dlna/dlnaflags" "github.com/rclone/rclone/cmd/serve/dlna/dlnaflags"
@ -404,6 +405,7 @@ func (s *server) ssdpInterface(intf net.Interface) {
Server: serverField, Server: serverField,
UUID: s.RootDeviceUUID, UUID: s.RootDeviceUUID,
NotifyInterval: s.AnnounceInterval, NotifyInterval: s.AnnounceInterval,
Logger: log.Default,
} }
// An interface with these flags should be valid for SSDP. // An interface with these flags should be valid for SSDP.