diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-02-25 08:27:20 -0800 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-02-25 08:27:20 -0800 |
commit | 946a064fc6b57915c09026e0b02d0bed01a852e3 (patch) | |
tree | 316643da64a5a729f46ce5e8fd31d62158e21dce /lib | |
parent | f50be257041b6569f2322a51c71e0728f828a1f0 (diff) | |
parent | 3009b43e3d54c3191f9282e626d6fcaf9cd042e7 (diff) | |
download | nextcloud-server-946a064fc6b57915c09026e0b02d0bed01a852e3.tar.gz nextcloud-server-946a064fc6b57915c09026e0b02d0bed01a852e3.zip |
Merge pull request #1891 from owncloud/set_timeout
use a 5 sec timeout for the webdav check
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/util.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php index dd56e0308a2..0d608db53a5 100755 --- a/lib/util.php +++ b/lib/util.php @@ -556,11 +556,16 @@ class OC_Util { if (!function_exists('curl_init')) { return true; } - $settings = array( 'baseUri' => OC_Helper::linkToRemote('webdav'), ); + // save the old timeout so that we can restore it later + $old_timeout=ini_get("default_socket_timeout"); + + // use a 5 sec timeout for the check. Should be enough for local requests. + ini_set("default_socket_timeout", 5); + $client = new \Sabre_DAV_Client($settings); $return = true; @@ -574,6 +579,9 @@ class OC_Util { $return = false; } + // restore the original timeout + ini_set("default_socket_timeout", $old_timeout); + return $return; } |