diff options
Diffstat (limited to 'internal/server/server.go')
| -rw-r--r-- | internal/server/server.go | 12 |
1 files changed, 5 insertions, 7 deletions
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() |
