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
@@ -513,6 +513,9 @@ function location_to_latlng($device)
|
||||
$curl_init = curl_init($api_url);
|
||||
set_curl_proxy($curl_init);
|
||||
curl_setopt($curl_init, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl_init, CURLOPT_TIMEOUT, 2);
|
||||
curl_setopt($curl_init, CURLOPT_TIMEOUT_MS, 2000);
|
||||
curl_setopt($curl_init, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
$data = json_decode(curl_exec($curl_init), true);
|
||||
// Parse the data from the specific Geocode services.
|
||||
switch ($config['geoloc']['engine']) {
|
||||
|
||||
Reference in New Issue
Block a user