diff options
author | Christian Berendt <berendt@b1-systems.de> | 2013-10-24 16:19:17 +0200 |
---|---|---|
committer | Christian Berendt <berendt@b1-systems.de> | 2013-10-24 16:19:17 +0200 |
commit | dd82481f59b35a8dcc586868e61753210e9eba0c (patch) | |
tree | ef36601779534b395d29d4a7237a16d60eb5ddbd | |
parent | 128d3221cc6a0cb4f111b2c4c5024345a6b1dd10 (diff) | |
download | nextcloud-server-dd82481f59b35a8dcc586868e61753210e9eba0c.tar.gz nextcloud-server-dd82481f59b35a8dcc586868e61753210e9eba0c.zip |
add configuration parameter to manually set the timeout of HTTP requests
-rwxr-xr-x | apps/files_external/lib/config.php | 3 | ||||
-rw-r--r-- | apps/files_external/lib/swift.php | 5 | ||||
-rw-r--r-- | apps/files_external/tests/config.php | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 65d541c4b16..1210156df0b 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -95,7 +95,8 @@ class OC_Mount_Config { 'tenant' => 'Tenantname (OpenStack Object Storage)', 'password' => '*Password (OpenStack Object Storage)', 'service_name' => 'Service Name (OpenStack Object Storage)', - 'url' => 'URL of identity endpoint (OpenStack Object Storage)' + 'url' => 'URL of identity endpoint (OpenStack Object Storage)', + 'timeout' => 'Timeout of HTTP requests in seconds (optional)', ) ); } diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index fe28e124fe3..bb650dacc7b 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -109,6 +109,11 @@ class Swift extends \OC\Files\Storage\Common { } $this->anchor = new \OpenCloud\OpenStack($params['url'], $settings); + + if (isset($params['timeout'])) { + $this->anchor->setHttpTimeout($params['timeout']); + } + $this->connection = $this->anchor->ObjectStore($params['service_name'], $params['region'], 'publicURL'); try { diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php index 57653d05d00..a523809e2f9 100644 --- a/apps/files_external/tests/config.php +++ b/apps/files_external/tests/config.php @@ -30,7 +30,7 @@ return array( 'client_secret' => '', 'token' => '', ), - 'swift'=>array( + 'swift' => array( 'run' => false, 'user' => 'test', 'bucket' => 'test', @@ -39,7 +39,8 @@ return array( //'tenant' => 'test', //to be used only with OpenStack Object Storage //'password' => 'test', //to be use only with OpenStack Object Storage //'service_name' => 'swift', //should be 'swift' for OpenStack Object Storage and 'cloudFiles' for Rackspace Cloud Files (default value) - //'url' => 'https://identity.api.rackspacecloud.com/v2.0/' //to be used with Rackspace Cloud Files and OpenStack Object Storage + //'url' => 'https://identity.api.rackspacecloud.com/v2.0/', //to be used with Rackspace Cloud Files and OpenStack Object Storage + //'timeout' => 5 // timeout of HTTP requests in seconds ), 'smb'=>array( 'run'=>false, |