From 2404bac045a15fd3955ceecb17646b956a002bf5 Mon Sep 17 00:00:00 2001 From: Daniel Mangum Date: Mon, 4 Nov 2024 09:13:43 -0500 Subject: [PATCH] [udp/server] remove unused response cache The UDP server implementation creates a response message cache and periodically checks for expirations, but nothing is ever loaded or stored in the cache. Signed-off-by: Daniel Mangum --- udp/server/server.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/udp/server/server.go b/udp/server/server.go index beffe0ea..1ec8100a 100644 --- a/udp/server/server.go +++ b/udp/server/server.go @@ -14,7 +14,6 @@ import ( "github.com/plgd-dev/go-coap/v3/net/blockwise" "github.com/plgd-dev/go-coap/v3/net/monitor/inactivity" "github.com/plgd-dev/go-coap/v3/net/responsewriter" - "github.com/plgd-dev/go-coap/v3/pkg/cache" coapSync "github.com/plgd-dev/go-coap/v3/pkg/sync" "github.com/plgd-dev/go-coap/v3/udp/client" ) @@ -27,7 +26,6 @@ type Server struct { serverStartedChan chan struct{} doneCancel context.CancelFunc cancel context.CancelFunc - responseMsgCache *cache.Cache[string, []byte] connsMutex sync.Mutex conns map[string]*client.Conn @@ -92,7 +90,6 @@ func New(opt ...Option) *Server { serverStartedChan: serverStartedChan, doneCtx: doneCtx, doneCancel: doneCancel, - responseMsgCache: cache.NewCache[string, []byte](), conns: make(map[string]*client.Conn), cfg: &cfg, @@ -140,7 +137,6 @@ func (s *Server) Serve(l *coapNet.UDPConn) error { s.cfg.PeriodicRunner(func(now time.Time) bool { s.handleInactivityMonitors(now) - s.responseMsgCache.CheckExpirations(now) return s.ctx.Err() == nil })