diff options
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; } |