mirror of
https://github.com/friendica/friendica
synced 2024-11-09 16:22:56 +00:00
Merge pull request #9025 from annando/timeout-loop
Avoid loop situations and connection timeouts
This commit is contained in:
commit
a8431584ba
2 changed files with 7 additions and 1 deletions
|
@ -166,7 +166,7 @@ class Relation
|
|||
}
|
||||
|
||||
if (empty($contact)) {
|
||||
$contact = Contact::getByURL($url);
|
||||
$contact = Contact::getByURL($url, false);
|
||||
}
|
||||
|
||||
if (empty($contact)) {
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue