diff --git a/plugin/executable/rate_limiter/rate_limiter.go b/plugin/executable/rate_limiter/rate_limiter.go index a4ce902db..61e298b69 100644 --- a/plugin/executable/rate_limiter/rate_limiter.go +++ b/plugin/executable/rate_limiter/rate_limiter.go @@ -21,6 +21,7 @@ package rate_limiter import ( "context" + "io" "github.com/IrineSistiana/mosdns/v5/coremain" "github.com/IrineSistiana/mosdns/v5/pkg/query_context" @@ -52,6 +53,7 @@ func (args *Args) init() { } var _ sequence.Executable = (*RateLimiter)(nil) +var _ io.Closer = (*RateLimiter)(nil) type RateLimiter struct { l rate_limiter.RateLimiter @@ -77,6 +79,10 @@ func (s *RateLimiter) Exec(ctx context.Context, qCtx *query_context.Context) err return nil } +func (s *RateLimiter) Close() error { + return s.l.Close() +} + func refuse(q *dns.Msg) *dns.Msg { r := new(dns.Msg) r.SetReply(q)