]> source.dussan.org Git - nextcloud-server.git/commitdiff
use a 5 sec timeout for the webdav check
authorFrank Karlitschek <frank@owncloud.org>
Mon, 25 Feb 2013 15:30:11 +0000 (16:30 +0100)
committerFrank Karlitschek <frank@owncloud.org>
Mon, 25 Feb 2013 15:30:11 +0000 (16:30 +0100)
lib/util.php

index 87facda18049afe4d3e816c03e5c7e6e9de943f8..f2a43e42106cc2c04e12f9ecd715cbd693b84f8b 100755 (executable)
@@ -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;
        }