summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2013-02-25 16:30:11 +0100
committerFrank Karlitschek <frank@owncloud.org>2013-02-25 16:30:11 +0100
commit3009b43e3d54c3191f9282e626d6fcaf9cd042e7 (patch)
tree9539df65eb4aad017a78761f8a0501e6f3affe0c /lib
parent9ee5069f2a1d76c899eeef6cec0f06387764fabd (diff)
downloadnextcloud-server-3009b43e3d54c3191f9282e626d6fcaf9cd042e7.tar.gz
nextcloud-server-3009b43e3d54c3191f9282e626d6fcaf9cd042e7.zip
use a 5 sec timeout for the webdav check
Diffstat (limited to 'lib')
-rwxr-xr-xlib/util.php10
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;
}