X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FHTTPRequest.php;h=79419d38e25fbe581504ce2e963e6e68f1354e7f;hb=5af713b33603c87e72f7b66265af385d22f07afd;hp=6fcd610aadbae797fc00d6c535740d29528a0bbb;hpb=aa0b485f3dca72c5448076e913fa54d948cd7731;p=friendica.git diff --git a/src/Network/HTTPRequest.php b/src/Network/HTTPRequest.php index 6fcd610aad..79419d38e2 100644 --- a/src/Network/HTTPRequest.php +++ b/src/Network/HTTPRequest.php @@ -137,6 +137,8 @@ class HTTPRequest implements IHTTPRequest @curl_setopt($ch, CURLOPT_NOBODY, $opts['nobody']); } + @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + if (!empty($opts['timeout'])) { @curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']); } else { @@ -238,6 +240,8 @@ class HTTPRequest implements IHTTPRequest curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); } + @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + if (intval($timeout)) { curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); } else { @@ -331,6 +335,7 @@ class HTTPRequest implements IHTTPRequest curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_NOBODY, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $this->getUserAgent()); @@ -375,6 +380,7 @@ class HTTPRequest implements IHTTPRequest curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_NOBODY, 0); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $this->getUserAgent());