diff --git a/net/mosdns/Makefile b/net/mosdns/Makefile index b1d7b37c..44ac6b83 100644 --- a/net/mosdns/Makefile +++ b/net/mosdns/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mosdns -PKG_VERSION:=3.0.0 +PKG_VERSION:=3.1.0 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/IrineSistiana/mosdns/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=f9e0ff34e4ae0345f0887c47840128f850d7400c6d407242d3848a6462547e58 +PKG_HASH:=1eb30326b074bfe4731ca46497e1eecef5e2ac2d602a482fa552c50ddc972fe5 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILE:=LICENSE diff --git a/net/mosdns/patches/010-redis_cache-fixed-cache-could-store-a-key-with-zero-ttl.patch b/net/mosdns/patches/010-redis_cache-fixed-cache-could-store-a-key-with-zero-ttl.patch deleted file mode 100644 index 8a278e31..00000000 --- a/net/mosdns/patches/010-redis_cache-fixed-cache-could-store-a-key-with-zero-ttl.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0565ec359eb16b7cf10dcab9dd8e5be221ed9539 Mon Sep 17 00:00:00 2001 -From: IrineSistiana <49315432+IrineSistiana@users.noreply.github.com> -Date: Thu, 6 Jan 2022 16:50:46 +0800 -Subject: [PATCH] redis_cache: fixed cache could store a key with zero ttl - ---- - dispatcher/pkg/cache/redis_cache/redis_cache.go | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - ---- a/dispatcher/pkg/cache/redis_cache/redis_cache.go -+++ b/dispatcher/pkg/cache/redis_cache/redis_cache.go -@@ -61,14 +61,16 @@ func (r *RedisCache) Get(ctx context.Con - } - - func (r *RedisCache) Store(ctx context.Context, key string, v []byte, storedTime, expirationTime time.Time) error { -- if time.Now().After(expirationTime) { -+ now := time.Now() -+ ttl := expirationTime.Sub(now) -+ if ttl <= 0 { // For redis, zero ttl means the key has no expiration time. - return nil - } - - data := packRedisData(storedTime, expirationTime, v) - defer pool.ReleaseBuf(data) - -- return r.client.Set(ctx, key, data, expirationTime.Sub(time.Now())).Err() -+ return r.client.Set(ctx, key, data, ttl).Err() - } - - // Close closes the redis client. diff --git a/net/mosdns/patches/020-fixed-240.patch b/net/mosdns/patches/020-fixed-240.patch deleted file mode 100644 index 3020e556..00000000 --- a/net/mosdns/patches/020-fixed-240.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 653c7a03222d9135a6f9bfbeff3aaddc300762b4 Mon Sep 17 00:00:00 2001 -From: IrineSistiana <49315432+IrineSistiana@users.noreply.github.com> -Date: Thu, 6 Jan 2022 19:59:33 +0800 -Subject: [PATCH] fixed #240 - ---- - dispatcher/plugin/executable/forward/forward.go | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - ---- a/dispatcher/plugin/executable/forward/forward.go -+++ b/dispatcher/plugin/executable/forward/forward.go -@@ -158,8 +158,13 @@ func (f *forwardPlugin) Exec(ctx context - func (f *forwardPlugin) exec(ctx context.Context, qCtx *handler.Context) error { - var r *dns.Msg - var err error -- if f.fastIPHandler != nil { -- r, _, err = f.fastIPHandler.ExchangeFastest(qCtx.Q().Copy(), f.upstreams) -+ q := qCtx.Q() -+ if f.fastIPHandler != nil && len(q.Question) == 1 { -+ // Only call ExchangeFastest if the query has one question. -+ // ExchangeFastest will use the first question name as host name. -+ // It won't check questions range. So it will it panic if len(q.Question) == 0. -+ // Ref: https://github.com/IrineSistiana/mosdns/issues/240 -+ r, _, err = f.fastIPHandler.ExchangeFastest(q.Copy(), f.upstreams) - } else { - r, err = f.bu.ExchangeParallel(ctx, qCtx) - } diff --git a/net/mosdns/patches/030-fixed-nil-pointer-in-653c7a03222d9135a6f9bfbeff3aaddc3007.patch b/net/mosdns/patches/030-fixed-nil-pointer-in-653c7a03222d9135a6f9bfbeff3aaddc3007.patch deleted file mode 100644 index 67068706..00000000 --- a/net/mosdns/patches/030-fixed-nil-pointer-in-653c7a03222d9135a6f9bfbeff3aaddc3007.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 189e1c810fcdda95fee732fb37ba73e08055989f Mon Sep 17 00:00:00 2001 -From: IrineSistiana <49315432+IrineSistiana@users.noreply.github.com> -Date: Thu, 6 Jan 2022 23:07:28 +0800 -Subject: [PATCH] fixed nil pointer in 653c7a03222d9135a6f9bfbeff3aaddc300762b4 - #240 - ---- - dispatcher/plugin/executable/forward/forward.go | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - ---- a/dispatcher/plugin/executable/forward/forward.go -+++ b/dispatcher/plugin/executable/forward/forward.go -@@ -116,12 +116,11 @@ func newForwarder(bp *handler.BP, args * - }) - } - -+ f.bu = bundled_upstream.NewBundledUpstream(bu, bp.L()) -+ - if args.FastestIP { - f.fastIPHandler = fastip.NewFastestAddr() -- } else { -- f.bu = bundled_upstream.NewBundledUpstream(bu, bp.L()) - } -- - return f, nil - } -