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>
Fri, 22 Jan 2016 11:20:03 +0000 (12:20 +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 3de88e2259ea3507946a7fd37c7445fa8440b34e..c251a03d4551e0ef0a209050b691793a8771ad85 100644 (file)
@@ -121,6 +121,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;