From 482639445447f7b3b6b6755c51c5fd57e2939db2 Mon Sep 17 00:00:00 2001 From: KekmaTime <22am014@sctce.ac.in> Date: Mon, 18 Mar 2024 20:00:26 +0530 Subject: [PATCH] Added new HTTP connection setting to the reqwest::ClientBuilder to timeout requests for fetching the search results from the upstream search engines. --- src/results/aggregator.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/results/aggregator.rs b/src/results/aggregator.rs index b46befd..5244a76 100644 --- a/src/results/aggregator.rs +++ b/src/results/aggregator.rs @@ -77,6 +77,7 @@ pub async fn aggregate( let client = CLIENT.get_or_init(|| { ClientBuilder::new() .timeout(Duration::from_secs(config.request_timeout as u64)) // Add timeout to request to avoid DDOSing the server + .connect_timeout(Duration::from_secs(config.request_timeout as u64)) // Add timeout to request to avoid DDOSing the server .https_only(true) .gzip(true) .brotli(true)