diff options
author | Mario <mario@mariovavti.com> | 2019-03-06 09:52:26 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-03-06 09:52:26 +0100 |
commit | 75a66b716e687aa32960dd002e6a3b4e03e5ee3d (patch) | |
tree | 9322b430e4e9b6c0212edc2e6e783c591a2a6bb8 /include/network.php | |
parent | c43ab50d6618724d8cf7ce4d691db5edca3ac8e0 (diff) | |
parent | 0c05e6593e020180ca678dff6d60c095e23b34cd (diff) | |
download | volse-hubzilla-75a66b716e687aa32960dd002e6a3b4e03e5ee3d.tar.gz volse-hubzilla-75a66b716e687aa32960dd002e6a3b4e03e5ee3d.tar.bz2 volse-hubzilla-75a66b716e687aa32960dd002e6a3b4e03e5ee3d.zip |
Merge branch 'patch-20190305a' into 'dev'
Add CURLOPT_CONNECTTIMEOUT
See merge request hubzilla/core!1542
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/network.php b/include/network.php index 8ac71011e..12f2ad4e9 100644 --- a/include/network.php +++ b/include/network.php @@ -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)); } + 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')) { // "username" . ':' . "password" |