From 71354d01897b3872981d55dafe684f11bbdca78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 18 Jan 2024 20:04:02 +0100 Subject: [PATCH] Webserver: Reduce connection timeout --- Core/WebServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/WebServer.cpp b/Core/WebServer.cpp index b7b2662af3..e7a80ae486 100644 --- a/Core/WebServer.cpp +++ b/Core/WebServer.cpp @@ -82,7 +82,7 @@ static bool RegisterServer(int port) { http.SetUserAgent(StringFromFormat("PPSSPP/%s", PPSSPP_GIT_VERSION)); - char resource4[1024] = {}; + char resource4[1024]{}; if (http.Resolve(REPORT_HOSTNAME, REPORT_PORT, net::DNSType::IPV4)) { if (http.Connect()) { std::string ip = fd_util::GetLocalIP(http.sock()); @@ -97,7 +97,7 @@ static bool RegisterServer(int port) { if (http.Resolve(REPORT_HOSTNAME, REPORT_PORT, net::DNSType::IPV6)) { // If IPv4 was successful, don't give this as much time (it blocks and sometimes IPv6 is broken.) - double timeout = success ? 2.0 : 20.0; + double timeout = success ? 2.0 : 10.0; // We register both IPv4 and IPv6 in case the other client is using a different one. if (resource4[0] != 0 && http.Connect(timeout)) {