Skip to content

Commit

Permalink
Webserver: Reduce connection timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 18, 2024
1 parent bfe16fd commit 71354d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Core/WebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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)) {
Expand Down

0 comments on commit 71354d0

Please sign in to comment.