Add CURLOPT_CONNECTTIMEOUT

(cherry picked from commit 0c05e6593e)
This commit is contained in:
M. Dent 2019-03-06 08:52:26 +00:00 committed by Mario
parent 571e9bf26a
commit a81286c795

View File

@ -114,6 +114,13 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60)); @curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
} }
if(x($opts,'connecttimeout') && intval($opts['connecttimeout'])) {
@curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, intval($opts['connecttimeout']));
}
else {
$curl_contime = intval(@get_config('system','curl_connecttimeout'));
@curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, (($curl_contime !== false) ? $curl_contime : 30));
}
if(x($opts,'http_auth')) { if(x($opts,'http_auth')) {
// "username" . ':' . "password" // "username" . ':' . "password"