mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: added some timeout safeguards for curl calls (#5743)
This commit is contained in:
committed by
Tony Murray
parent
5733fb27fa
commit
a19b2614dc
@@ -1093,6 +1093,9 @@ function version_info($remote = true)
|
||||
curl_setopt($api, CURLOPT_USERAGENT, 'LibreNMS');
|
||||
curl_setopt($api, CURLOPT_URL, $config['github_api'].'commits/master');
|
||||
curl_setopt($api, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($api, CURLOPT_TIMEOUT, 5);
|
||||
curl_setopt($api, CURLOPT_TIMEOUT_MS, 5000);
|
||||
curl_setopt($api, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
$output['github'] = json_decode(curl_exec($api), true);
|
||||
}
|
||||
list($local_sha, $local_date) = explode('|', rtrim(`git show --pretty='%H|%ct' -s HEAD`));
|
||||
|
Reference in New Issue
Block a user