From eeffa25c2c14c0ff8ab2278334b3827fba73cf46 Mon Sep 17 00:00:00 2001 From: Milkey Tan Date: Tue, 7 Nov 2023 20:43:20 +0800 Subject: [PATCH] ObjectPool IsUdpEnabled --- Arashi.Aoi/Routes/DnsQueryRoutes.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Arashi.Aoi/Routes/DnsQueryRoutes.cs b/Arashi.Aoi/Routes/DnsQueryRoutes.cs index 74eecee00..bdaf83213 100644 --- a/Arashi.Aoi/Routes/DnsQueryRoutes.cs +++ b/Arashi.Aoi/Routes/DnsQueryRoutes.cs @@ -21,10 +21,12 @@ class DnsQueryRoutes public static IPEndPoint BackUpEndPoint = IPEndPoint.Parse(Config.BackUpStream); public static ObjectPool UpPool = new(() => - new DnsClient(UpEndPoint.Address, Config.TimeOut, UpEndPoint.Port != 0 ? UpEndPoint.Port : 53)); + new DnsClient(UpEndPoint.Address, Config.TimeOut, UpEndPoint.Port != 0 ? UpEndPoint.Port : 53) + {IsUdpEnabled = !Config.OnlyTcpEnable, IsTcpEnabled = true}); public static ObjectPool BackUpPool = new(() => - new DnsClient(BackUpEndPoint.Address, Config.TimeOut, BackUpEndPoint.Port != 0 ? UpEndPoint.Port : 53)); + new DnsClient(BackUpEndPoint.Address, Config.TimeOut, BackUpEndPoint.Port != 0 ? UpEndPoint.Port : 53) + {IsUdpEnabled = !Config.OnlyTcpEnable, IsTcpEnabled = true}); public static void DnsQueryRoute(IEndpointRouteBuilder endpoints)