Replace HTTPRequest's timeout by connect_timeout + read_timeout
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 26 Nov 2020 11:26:00 +0000 (12:26 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 26 Nov 2020 11:26:00 +0000 (12:26 +0100)
The timeout in 5.2 only applied to the connect() syscall. Guzzle's timeout
option applies to the total transfer. Replace it by connect_timeout +
read_timeout for backwards compatibility for code that expected the actual
transfer to take an arbitrary amount of time.

wcfsetup/install/files/lib/util/HTTPRequest.class.php

index a3dd16ef89cebb7f828899bf5abf065a95593331..2867920d993bbdb7ed5ac41dfa21cc1093d28911 100644 (file)
@@ -166,7 +166,8 @@ final class HTTPRequest {
                };
                
                $options = [
-                       'timeout' => $this->options['timeout'],
+                       'connect_timeout' => $this->options['timeout'],
+                       'read_timeout' => $this->options['timeout'],
                        'allow_redirects' => [
                                'max' => $this->options['maxDepth'],
                                'track_redirects' => true,