From ea75158ea9cb971449b2c518cafd9a2312430fd7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 7 Jan 2021 16:07:24 +0100 Subject: [PATCH] Configure a 60 second timeout for Guzzle by default This is acting as a safety net, because the default timeout is infinite. --- wcfsetup/install/files/lib/system/io/HttpFactory.class.php | 1 + wcfsetup/install/files/lib/util/HTTPRequest.class.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/wcfsetup/install/files/lib/system/io/HttpFactory.class.php b/wcfsetup/install/files/lib/system/io/HttpFactory.class.php index 7ee07e2fe4..0868653556 100644 --- a/wcfsetup/install/files/lib/system/io/HttpFactory.class.php +++ b/wcfsetup/install/files/lib/system/io/HttpFactory.class.php @@ -57,6 +57,7 @@ final class HttpFactory { $defaults = [ 'proxy' => PROXY_SERVER_HTTP, 'headers' => [], + 'timeout' => 60, ]; foreach ($defaults as $key => $value) { diff --git a/wcfsetup/install/files/lib/util/HTTPRequest.class.php b/wcfsetup/install/files/lib/util/HTTPRequest.class.php index cfd678f467..2c81c3b7d2 100644 --- a/wcfsetup/install/files/lib/util/HTTPRequest.class.php +++ b/wcfsetup/install/files/lib/util/HTTPRequest.class.php @@ -167,6 +167,8 @@ final class HTTPRequest { }; $options = [ + // No overall timeout + 'timeout' => 0, 'connect_timeout' => $this->options['timeout'], 'read_timeout' => $this->options['timeout'], 'allow_redirects' => [ -- 2.20.1