From: Mikael Nordfeldth Date: Mon, 18 Jan 2016 21:01:45 +0000 (+0100) Subject: default connect_timeout to 5 instead of extlib 10 X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f768de4b46ec698771426c0c09c24cc2bf297866;p=quix0rs-gnu-social.git default connect_timeout to 5 instead of extlib 10 --- diff --git a/lib/default.php b/lib/default.php index 5b504cea3f..8d8ef11788 100644 --- a/lib/default.php +++ b/lib/default.php @@ -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, diff --git a/lib/httpclient.php b/lib/httpclient.php index 4c7a4a9c64..31f3ae206c 100644 --- a/lib/httpclient.php +++ b/lib/httpclient.php @@ -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;