Skip to content
Snippets Groups Projects
Commit b7a5cc2f authored by Frank Karlitschek's avatar Frank Karlitschek
Browse files

use socket timeout of 10 sec to stay responsive even with a slow internet...

use socket timeout of 10 sec to stay responsive even with a slow internet connection or a not working server
parent 4dba9183
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,16 @@ class OC_Updater{ ...@@ -42,7 +42,16 @@ class OC_Updater{
//fetch xml data from updater //fetch xml data from updater
$url=$updaterurl.'?version='.$versionstring; $url=$updaterurl.'?version='.$versionstring;
$xml=@file_get_contents($url);
// set a sensible timeout of 10 sec to stay responsive even if the update server is down.
$ctx = stream_context_create(
array(
'http' => array(
'timeout' => 10
)
)
);
$xml=@file_get_contents($url, 0, $ctx);
if($xml==FALSE) { if($xml==FALSE) {
return array(); return array();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment