summaryrefslogtreecommitdiff
path: root/internal/server/server.go
diff options
context:
space:
mode:
authorradhitya <alif@radhitya.org>2026-06-18 12:42:29 +0700
committerradhitya <alif@radhitya.org>2026-06-18 12:42:29 +0700
commitf5753c6a8cac5a57a042b0388f38abeff5d1f37d (patch)
tree96e1241126b23051725edb68a79c8e4603d7e23a /internal/server/server.go
parente05835493f821055e517a3988c6f9256abbc5c24 (diff)
migration to new dns library
Diffstat (limited to 'internal/server/server.go')
-rw-r--r--internal/server/server.go12
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()