From: Tim Düsterhus Date: Thu, 7 Jan 2021 15:07:24 +0000 (+0100) Subject: Configure a 60 second timeout for Guzzle by default X-Git-Tag: 5.4.0_Alpha_1~469 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ea75158ea9cb971449b2c518cafd9a2312430fd7;p=GitHub%2FWoltLab%2FWCF.git Configure a 60 second timeout for Guzzle by default This is acting as a safety net, because the default timeout is infinite. --- 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' => [