Set Timeout for curl process

This commit is contained in:
SimonFair
2023-07-15 10:28:43 +01:00
parent dc58e2fd69
commit 90f26f4312
@@ -7,6 +7,7 @@ function httpPost($url, $data)
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT_MS, 1000);
$response = curl_exec($curl);
curl_close($curl);
return $response;
@@ -14,5 +15,4 @@ function httpPost($url, $data)
$var = @parse_ini_file("/var/local/emhttp/var.ini") ?: [];
$rtn = httpPost("http://localhost/webGui/include/SysDrivers.php", ["table"=>"t1create","csrf_token" => $var['csrf_token']]) ;
echo $rtn ;
?>