Configure a 60 second timeout for Guzzle by default
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 7 Jan 2021 15:07:24 +0000 (16:07 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 7 Jan 2021 15:07:24 +0000 (16:07 +0100)
This is acting as a safety net, because the default timeout is infinite.

wcfsetup/install/files/lib/system/io/HttpFactory.class.php
wcfsetup/install/files/lib/util/HTTPRequest.class.php

index 7ee07e2fe4cf2f8a7b822c197dc3ce6556c202c0..0868653556e96d3c109ff1e5f17b753a57f58a4c 100644 (file)
@@ -57,6 +57,7 @@ final class HttpFactory {
                $defaults = [
                        'proxy' => PROXY_SERVER_HTTP,
                        'headers' => [],
+                       'timeout' => 60,
                ];
                
                foreach ($defaults as $key => $value) {
index cfd678f4673c9fa57170fca7fee506a17e41a135..2c81c3b7d289cc9da96f261bffbfda0f12f74453 100644 (file)
@@ -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' => [