Made “CURLOPT_TIMEOUT” variable, set it to 45 secs by default
This commit is contained in:
parent
d75a6445ae
commit
fe99014208
1 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
function getfc($url,$timeout,$headers=[]) {
|
||||
function getfc($url,$conntimeout,$timeout=45,$headers=[]) {
|
||||
$curli=curl_init();
|
||||
// i 2 qui sotto servono a far sì che ctrl+c sia intercettato a monte
|
||||
/*curl_setopt($curli,CURLOPT_NOPROGRESS,false);
|
||||
|
@ -8,8 +8,8 @@ function getfc($url,$timeout,$headers=[]) {
|
|||
curl_setopt($curli,CURLOPT_URL,$url);
|
||||
curl_setopt($curli,CURLOPT_RETURNTRANSFER,true);
|
||||
curl_setopt($curli,CURLOPT_FAILONERROR,true);
|
||||
curl_setopt($curli,CURLOPT_TIMEOUT,30);
|
||||
curl_setopt($curli,CURLOPT_CONNECTTIMEOUT,$timeout);
|
||||
curl_setopt($curli,CURLOPT_CONNECTTIMEOUT,$conntimeout);
|
||||
curl_setopt($curli,CURLOPT_TIMEOUT,$timeout);
|
||||
curl_setopt($curli,CURLOPT_HTTPHEADER,$headers);
|
||||
curl_setopt($curli,CURLOPT_HEADER,true);
|
||||
curl_setopt($curli,CURLOPT_ENCODING,'');
|
||||
|
|
Loading…
Reference in a new issue