'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,
+ 'timeout' => 60,
'proxy_host' => null,
'proxy_port' => null,
'proxy_user' => null,
function __construct($url=null, $method=self::METHOD_GET, $config=array())
{
+ if (is_int(common_config('http', 'timeout'))) {
+ // Reasonably you shouldn't set http/timeout to 0 because of
+ // malicious remote servers that can cause infinitely long
+ // responses... But the default in HTTP_Request2 is 0 for
+ // some reason and should probably be considered a valid value.
+ $this->config['timeout'] = common_config('http', 'timeout');
+ common_debug('Using HTTPClient timeout value of '._ve($this->config['timeout']));
+ } else {
+ common_log(LOG_ERR, 'config option http/timeout is not an integer value: '._ve(common_config('http', 'timeout')));
+ }
$this->config['connect_timeout'] = common_config('http', 'connect_timeout') ?: $this->config['connect_timeout'];
$this->config['max_redirs'] = 10;
$this->config['follow_redirects'] = true;