]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
default connect_timeout to 5 instead of extlib 10
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 18 Jan 2016 21:01:45 +0000 (22:01 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 18 Jan 2016 21:01:45 +0000 (22:01 +0100)
lib/default.php
lib/httpclient.php

index 5b504cea3f84e0a4ab47a5913a0bfbe28a83fdc8..8d8ef1178810a98a8806b75d8969f03acafb3f5d 100644 (file)
@@ -353,6 +353,7 @@ $default =
         array('ssl_cafile' => false, // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt') (this activates "ssl_verify_peer")
               'ssl_verify_host' => true,    // HTTPRequest2 makes sure this is set to CURLOPT_SSL_VERIFYHOST==2 if using curl
               'curl' => false, // Use CURL backend for HTTP fetches if available. (If not, PHP's socket streams will be used.)
+              'connect_timeout' => 5,
               'proxy_host' => null,
               'proxy_port' => null,
               'proxy_user' => null,
index 4c7a4a9c6493b3d88f702e6c5508d27a58d2a630..31f3ae206c39f8544acfad363b7a30e940713797 100644 (file)
@@ -116,6 +116,7 @@ class HTTPClient extends HTTP_Request2
 
     function __construct($url=null, $method=self::METHOD_GET, $config=array())
     {
+        $this->config['connect_timeout'] = common_config('http', 'connect_timeout') ?: $this->config['connect_timeout'];
         $this->config['max_redirs'] = 10;
         $this->config['follow_redirects'] = true;