move common::dns to utils::dns

move dns

move
This commit is contained in:
Luna Yao
2026-04-18 23:14:25 +02:00
parent c71ab7543f
commit 5a516a195c
9 changed files with 12 additions and 16 deletions
+2 -2
View File
@@ -3,7 +3,6 @@ use std::{net::SocketAddr, sync::Arc};
use super::{create_connector_by_url, http_connector::TunnelWithInfo};
use crate::{
common::{
dns::{RESOLVER, resolve_txt_record},
error::Error,
global_ctx::ArcGlobalCtx,
log,
@@ -15,8 +14,9 @@ use anyhow::Context;
use dashmap::DashSet;
use hickory_proto::rr::RData;
use hickory_resolver::proto::rr::rdata::SRV;
use rand::{Rng as _, seq::SliceRandom};
use rand::{seq::SliceRandom, Rng as _};
use strum::VariantArray;
use crate::utils::dns::{resolve_txt_record, RESOLVER};
fn weighted_choice<T>(options: &[(T, u64)]) -> Option<&T> {
let total_weight = options.iter().map(|(_, weight)| *weight).sum();