From f5753c6a8cac5a57a042b0388f38abeff5d1f37d Mon Sep 17 00:00:00 2001 From: radhitya Date: Thu, 18 Jun 2026 12:42:29 +0700 Subject: migration to new dns library --- internal/server/server.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'internal/server/server.go') diff --git a/internal/server/server.go b/internal/server/server.go index 8f991eb..1aa3256 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/miekg/dns" + "codeberg.org/miekg/dns" "linum/internal/resolver" "linum/internal/blocklist" "linum/internal/cache" @@ -41,7 +41,6 @@ r *resolver.Resolver, c *cache.Cache, b *blocklist.Blocklist) (*Server, error) { Handler: mux, UDPSize: 4096, ReadTimeout: 5 * time.Second, - WriteTimeout: 5 * time.Second, ReusePort: true, } } @@ -52,7 +51,6 @@ r *resolver.Resolver, c *cache.Cache, b *blocklist.Blocklist) (*Server, error) { Net: "tcp", Handler: mux, ReadTimeout: 5 * time.Second, - WriteTimeout: 5 * time.Second, } } @@ -97,10 +95,10 @@ func (s *Server) Run(ctx context.Context) error { defer cancel() if s.udp != nil { - s.udp.ShutdownContext(shutdownCtx) + s.udp.Shutdown(shutdownCtx) } if s.tcp != nil { - s.tcp.ShutdownContext(shutdownCtx) + s.tcp.Shutdown(shutdownCtx) } if s.doh != nil { s.doh.Shutdown(shutdownCtx) @@ -113,10 +111,10 @@ func (s *Server) Run(ctx context.Context) error { func (s *Server) Close() error { if s.udp != nil { - s.udp.Shutdown() + s.udp.Shutdown(context.Background()) } if s.tcp != nil { - s.tcp.Shutdown() + s.tcp.Shutdown(context.Background()) } if s.doh != nil { s.doh.Close() -- cgit v1.2.3