diff options
author | Frank Karlitschek <frank@owncloud.org> | 2013-02-25 16:30:11 +0100 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2013-02-25 16:30:11 +0100 |
commit | 3009b43e3d54c3191f9282e626d6fcaf9cd042e7 (patch) | |
tree | 9539df65eb4aad017a78761f8a0501e6f3affe0c /lib | |
parent | 9ee5069f2a1d76c899eeef6cec0f06387764fabd (diff) | |
download | nextcloud-server-3009b43e3d54c3191f9282e626d6fcaf9cd042e7.tar.gz nextcloud-server-3009b43e3d54c3191f9282e626d6fcaf9cd042e7.zip |
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 87facda1804..f2a43e42106 100755 --- a/lib/util.php +++ b/lib/util.php @@ -569,11 +569,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; @@ -587,6 +592,9 @@ class OC_Util { $return = false; } + // restore the original timeout + ini_set("default_socket_timeout", $old_timeout); + return $return; } |